Jump to content

lizardman

Members
  • Posts

    7
  • Joined

  • Last visited

Everything posted by lizardman

  1. You can probably have it extend the vanilla hopper class, overriding methods as needed. If not, copy its code.
  2. Yeah, I'd prefer to avoid core mods as well. I'm not at home right now, but when I do I'll give that a shot! If that fails, I may look around for other published apis
  3. Hmm. Looks like I've got to look into core mods then. Having the item still swing is my absolute last resort. Thanks for the help!
  4. Back again with another question. I'm attempting to rewrite some items' left click functionality, and while I have managed to intercept the keypress and cancel it, I can't seem to find a way to make this account for the player rebinding their attack button. The reason I want to rewrite the item's functionality is because I want to induce custom attacking behavior - for example, a long charging time that immobilizes the player, or an attack that jumps them forward/backward a few blocks. Here's the relevant snippet: @SubscribeEvent public void onMouseClick(MouseEvent event) { if(event.getButton() == LEFT_CLICK) { // LEFT_CLICK = 0 FMLLog.log(Level.INFO, "[MonsterHunter] Default attack button is: %s", Minecraft.getMinecraft().gameSettings.keyBindAttack.getKeyCode()); ItemStack heldItem = Minecraft.getMinecraft().thePlayer.getHeldItem(EnumHand.MAIN_HAND); if(heldItem != null && heldItem.getItem() instanceof WeaponBase) { FMLLog.log(Level.INFO, "[MonsterHunter] Successfully intercepted left click!"); event.setCanceled(true); } } } The only method I can find that allows me to intercept key events (KeyInputEvent) doesn't allow me to cancel them, so I can't get rid of the swinging animation like this snippet does. Any advice? Or am I going about this the entirely wrong way?
  5. Tried this, and it worked like a charm! Now I guess it's time to find out why that works so this doesn't happen again. Thanks!
  6. Alright, thanks for the advice. Rendering is really the most confusing part for me right now - I've never really worked with anything like it in the past. I'll give those a shot after work.
  7. Hey all, first time poster. I'm just learning how to use Forge, so I'm trying to make a chest clone. I've copied over most of the Chest's code, with a bit of my own -- it's meant to ALWAYS be a double chest that can only store a certain type of item. So far, it works great - reliably creates the second dummy block, synchronized inventory between blocks, etc. But, when rendering it, the block renders off of the player's position rather than its own - causing it to (rather humorously) follow the player. Below is my code: Chest Block Tile Entity Tile Entity Renderer Frankly, I'm stumped. I'm fairly confident the root of the problem is in one of these three classes, but if need be I can provide the rest related to it. Any advice?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.