Skip 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.

Draco18s

Members
  • Joined

  • Last visited

Everything posted by Draco18s

  1. When the item stack is created you need to set the attribute modifiers (attack damage and attack speed). Anytime you update the NBT to have a different value, you would have to update the attributes as well.
  2. That's the worst idea. All of those instances would then need to be garbage collected.
  3. It's a Forge event. So no, its not likely to be changed.
  4. Cancelable means that where the event is used, the code queries if the event was actually cancelled before continuing on with the operation. In this case, it isn't cancelable because it's an event informing other code "hey, this happened." It's too late to do anything about it.
  5. https://stackoverflow.com/a/8851063/1663383
  6. Yes. That is precisely what I am saying.
  7. Sorry, it's createTileEntity.
  8. You need a custom IRecipe implementation. Have a look at Choonster's testmod3, you'll want to look at the gold armor upgrade things. Pay special attention to the _factories.json file.
  9. Most block methods are deprecated but that's irrelevant as the point of deprecated methods is "do not invoke" which says nothing about overriding (that is: if you want to know about a block, as its IBlockState object, not the block).
  10. Do not use ITileEntityProvider. It is old, out dated, bad, and broken. Just use the hasTileEntity and getTileEntity methods already available in the Block class.
  11. someTileEntity.hasCapability(...) someTileEntity.getCapability(...) https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/ores/entities/TileEntitySifter.java#L135-L158 http://mcforge.readthedocs.io/en/latest/datastorage/capabilities/
  12. ISidedInventory extends IInventory
  13. Caused by: java.lang.NullPointerException at net.minecraft.item.ItemStack.areItemStacksEqual(ItemStack.java:432) ~[ItemStack.class:?] You have a null item stack somewhere.
  14. remove the isRemote check
  15. Found the problem: if (!world.isRemote) { TileEntity te = world.getTileEntity(pos); if (!(te instanceof TileMyFurnace)) { return false; } player.openGui(MyBlocks.instance, Reference.MY_GUI, world, pos.getX(), pos.getY(), pos.getZ()); } You need to open the GUI on both sides.
  16. wrench = new ItemBase("wrench").setCreativeTab(CreativeTabs.WHATEVER); No override needed.
  17. You can turn the resource location into a string. The point is to get your mod ID into the unlocalized name as to avoid name conflicts (language entries are NOT mod specific). e.g. https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/hardlib/EasyRegistry.java#L95 Hmm... There's no need to override setCreativeTab: https://github.com/AnZaNaMa/Modularity/blob/master/src/main/java/com/anzanama/modularity/common/item/ItemBase.java#L27 Just call it in the item's constructor with whatever tab you want. Not seeing any other issues, though.
  18. Question, why do you pass this off to the item only to have the item pass it back to the registry class? https://github.com/AnZaNaMa/Modularity/blob/master/src/main/java/com/anzanama/modularity/Registry.java#L45-L54 You could just call registerItemModel(wrench, 0, new ModelResourceLocation(wrench.getRegistryName(),"normal")) Also: https://github.com/AnZaNaMa/Modularity/blob/master/src/main/java/com/anzanama/modularity/common/item/ItemBase.java#L14 NO. BAD. There is no reason save this. https://github.com/AnZaNaMa/Modularity/blob/master/src/main/java/com/anzanama/modularity/common/item/ItemBase.java#L18 setUnlocalizedName(getRegistryName()) https://github.com/AnZaNaMa/Modularity/blob/master/src/main/java/com/anzanama/modularity/Registry.java#L46 This event is client-side-only: https://github.com/AnZaNaMa/Modularity/blob/master/src/main/java/com/anzanama/modularity/Registry.java#L10
  19. That's fine, but there's still no reason to screw around with which hotbar slot is selected.
  20. Again, for what reason? You're completely screwing with what the player expects to happen. What if the item is picked up but the hotbar is full? What if the player wants to place more than one block at a time?
  21. What have been the results of your debugging? Do any of your print statements fire? Have you tried using the debugger?
  22. Don't try to limit resources in creative mode.
  23. Not sure, but I do see this: new BlockPos(this.pos.getX(),this.pos.getY(),this.pos.getZ()) Really? this.world.getTileEntity(this.pos) was too hard?

Important Information

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

Account

Navigation

Search

Search

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.