My mod has skill trees, and I though of ways to display them. I decided that a system like the achievement GUI would be the best way to go.
So how would I draw the actual achievement GUI? I thought I should extend
GuiAchievements
, but it requires a
StatFileWriter
in its constructor. The obfuscated fields in
GuiAchievements
aren't helping either. So is there a way to render a custom GUI like the achievement GUI?
Use the
KeyBinding
class that comes with forge instead of the LWJGL Keyboard.isKeyDown(). A tutorial on how to use key bindings is here: http://www.minecraftforge.net/wiki/Key_Binding
(It's also better to use KeyBindings because the client can change what keys do what.)
How would I get the amount of ticks passed between two triggers? (e.g. a onItemRightClick trigger)
Example:
@Override
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World worldIn, EntityPlayer playerIn, EnumHand hand) {
int ticks = getTicks(); // gets ticks since the last time getTicks() was called
System.out.println(ticks);
return new ActionResult(EnumActionResult.PASS, stack);
}
How would I make the getTicks() method?
2 replies
Important Information
By using this site, you agree to our Terms of Use.