Posted January 28, 201312 yr How to replace a method/ add a method in a minecraft base class? I'm currently working on a mod. [shadow=black,right][glow=green,2,300]☟ ☞ uyjulian's website ☜ ☝[/glow][/shadow]
January 28, 201312 yr Author I'm editing the class "KeyBindings.java" and I am doing these things: #Adding methods to see if a key is down, or to toggle it #Adding a field to allow mods to see the status of the key http://pastebin.com/vMdbSa69 [shadow=black,right][glow=green,2,300]☟ ☞ uyjulian's website ☜ ☝[/glow][/shadow]
January 29, 201312 yr Why not submit a pull request to forge for this? Other modders could use these things too.
January 29, 201312 yr Author Because the file isn't there. [shadow=black,right][glow=green,2,300]☟ ☞ uyjulian's website ☜ ☝[/glow][/shadow]
January 30, 201312 yr Author help? [shadow=black,right][glow=green,2,300]☟ ☞ uyjulian's website ☜ ☝[/glow][/shadow]
January 31, 201312 yr in client proxy KeyBindingRegistry.registerKeyBinding(new MyKeys()); then package RPGCraft.central; import java.util.EnumSet; import org.lwjgl.input.Keyboard; import net.minecraft.client.Minecraft; import net.minecraft.client.settings.KeyBinding; import net.minecraft.src.ModLoader; import cpw.mods.fml.client.registry.KeyBindingRegistry.KeyHandler; import cpw.mods.fml.common.TickType; public class MyKeys extends KeyHandler { public QuestKeys(KeyBinding[] keyBindings, boolean[] repeatings) { super(keyBindings, repeatings); // TODO Auto-generated constructor stub } @Override public String getLabel() { return "Quests"; } @Override public void keyDown(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd, boolean isRepeat) { if(!tickEnd ){ //do other things the kb.keyCode its the pressed key System.out.println(kb.keyCode); } } @Override public void keyUp(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd) { // TODO Auto-generated method stub } @Override public EnumSet<TickType> ticks() { // TODO Auto-generated method stub return EnumSet.of(TickType.CLIENT); } }
January 31, 201312 yr Author i also want to do it with the vanilla keys, too... [shadow=black,right][glow=green,2,300]☟ ☞ uyjulian's website ☜ ☝[/glow][/shadow]
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.