Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

GotoLink

Members
  • Joined

  • Last visited

Everything posted by GotoLink

  1. You are giving a null in your recipe. That is all i can tell without the code.
  2. I stand corrected, I didn't read all of your code. This should work : @Override public void openChest() { if(bagpack.hasTagCompound()) { readFromNBT(bagpack.getTagCompound());//Bag pack has some info for the inventory } else { bagpack.setTagCompound(writeToNBT(new NBTTagCompound()));//this is a "new" bagpack } } @Override public void closeChest() { if(! bagpack.hasTagCompound()) { //Should never be reached, since done when opening the first time bagpack.setTagCompound(writeToNBT(new NBTTagCompound())); } else {//We made changes to the inventory, save them bagpack.setTagCompound(writeToNBT(bagpack.getTagCompound())); } }
  3. I never tried to canceled it...but this doesn't sound good indeed. I store the info and use a TickHandler to run checks, yes. Obviously, it is limited to one block break per player per tick, but i doubt it make any difference for players.
  4. event.manager.soundPoolSounds.addSound("flintstonetools:stonestrike.ogg"); par3World.playSoundAtEntity(par2EntityPlayer, "flintstonetools:stonestrike", 1.0F, 1.0F);
  5. Yes, there are tutorials. First step is checking if entity and renderer are registered properly.
  6. No, those methods don't give you the ItemStack as a variable. Use your code inside a method which gives you the player or item in your container class or item. If necessary, send packets from your gui.
  7. No hook, grass spreading is hardcoded in BlockGrass.
  8. @Guff It doesn't matter where you implement IInventory. TileEntity is only one of the possible implementation. @Lua You only need to call writeToNBT(stack.getTagCompound());//To save readFromNBT(stack.getTagCompound());//To load
  9. https://github.com/MinecraftForge/MinecraftForge/pull/623 The PR is still open, but Lex discussed it last week. It could include a BlockDropXP event too. @hydroflame We already have PlayerInteractEvent and Action.RIGHT_CLICK_X handling most Block placed events
  10. 1. Look at Minecart and Boat code. Vehicle are simply entities that the player can ride 2.&3. Look at the Gui & Textures tutorial.
  11. If you are on 1.6, those are useless: public int getMaxHealth() { return 15; } public String getTexture() { return "textures/bee.png"; }
  12. You could use an IItemRenderer and use renderblocks i suppose...or use an ItemBlock.
  13. lol an ugly hack you say ? It has no effect on performance so I am too lazy to edit that private boolean value.
  14. I was thinking about sending a packet and rendering the animation yourself.
  15. Only one swing can happen at a time, this is hardcoded in the swing behaviour. So, you want to cancel the first swing. Since you know player.swingItem() ; the rest is your code. No Forge nor Minecraft can help you.
  16. All you need is isJumping set to true at some point. The rest you can handle with packets if needed. Edit: You can use LivingJumpEvent instead of a TickHandler, too.
  17. Actually, I think this is due to addChatMessage(String), as it uses ChatMessageComponent system now.
  18. Yes, as a side effect, the animation packet isn't sent. You wanted to cancel the swing, here it is.
  19. Personally, I use PlayerInteractEvent, Action.LEFT_CLICK_BLOCK and some reflection to get the block break status.
  20. You know you can register ticks on client side too, don't you ?
  21. Why not using translateToLocalFormatted(string, object[]) ?
  22. You said you had an item. The easy way is certainly to use an item to place the block. Which means you want noone to get the actual block, only the item. Then when block is broken, spawn an EntityItem which contains the item (again, not the block).
  23. Forge EntityRegistry registers mobs in maps. There is no limitation, provided you don't "registerGlobalEntityId".
  24. That wouldn't work at all since you changed the method args and calling swingItem() when the swing is in progress doesn't do anything (see swingItem() method) public void onUpdate(ItemStack stack, World world, Entity entity, int slot, boolean isCurrentItem) { if(entity instanceof EntityPlayer && isCurrentItem) { EntityPlayer player = (EntityPlayer)entity; if(player.isSwingInProgress) { player.isSwingInProgress = false; } } } This might work.
  25. Yes, "Open call hierarchy" (other language ), then you can follow the calls by clicking again on the line You are already doing the click check with if(entityLiving.isSwingInProgress)

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.