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.

Choonster

Moderators
  • Joined

  • Last visited

Everything posted by Choonster

  1. If you're just recolouring a greyscale texture with a single colour, you don't need to generate a texture. Simply override Block#getBlockColor , Block#getRenderColor and Block#colorMultiplier . If the colour should be determined at runtime, store it in a field.
  2. You never initialise the myStacks field. You also never read it from or write it to NBT, do this using the INBTSerializable methods implemented by ItemStackHandler . I suggest you remove the ItemStack array field and the IInventory methods.
  3. You never initialise the myStacks field. You also never read it from or write it to NBT, do this using the INBTSerializable methods implemented by ItemStackHandler . I suggest you remove the ItemStack array field and the IInventory methods.
  4. I think this is caused by your getMetaFromState method. Metadata should simply be radius - 1.
  5. I think this is caused by your getMetaFromState method. Metadata should simply be radius - 1.
  6. Don't implement IItemHandler on your TileEntity , create a field storing an implementation of it (e.g. ItemStackHandler ) and expose it as a capability (by overriding the ICapabilityProvider methods inherited by TileEntity ). I do this in [url=https://github.com/Choonster/TestMod3/blob/d326040ffd81cf942de5ddaebc9c5ed866f1dd33/src/main/java/com/choonster/testmod3/tileentity/TileEntityItemHandler.java]TileEntityItemHandler[/url] .
  7. Don't implement IItemHandler on your TileEntity , create a field storing an implementation of it (e.g. ItemStackHandler ) and expose it as a capability (by overriding the ICapabilityProvider methods inherited by TileEntity ). I do this in [url=https://github.com/Choonster/TestMod3/blob/d326040ffd81cf942de5ddaebc9c5ed866f1dd33/src/main/java/com/choonster/testmod3/tileentity/TileEntityItemHandler.java]TileEntityItemHandler[/url] .
  8. Yes, the class I linked does that. IRecipe#getRecipeOutput returns the recipe's output, but each recipe type has a separate way to get the input.
  9. Yes, the class I linked does that. IRecipe#getRecipeOutput returns the recipe's output, but each recipe type has a separate way to get the input.
  10. Override Block#getBlockLayer to return CUTOUT or TRANSPARENT . The Grey Ghost explains each layer here. Block#isOpaqueCube is used by Block#doesSideBlockRendering / Block#shouldSideBeRendered to determine whether the faces of adjacent blocks should be rendered (opaque blocks block rendering, transparent blocks don't).
  11. I have a class that replaces vanilla/Forge recipes here, though it's for 1.7.10. Each recipe class needs to be handled individually and I specifically prevent it from replacing subclasses because they may have their own custom behaviour.
  12. I have a class that replaces vanilla/Forge recipes here, though it's for 1.7.10. Each recipe class needs to be handled individually and I specifically prevent it from replacing subclasses because they may have their own custom behaviour.
  13. I can't see any obvious errors in your code, try stepping through the IInventory methods or the NBT reading/writing methods in a debugger and see if anything goes wrong. Side note: You shouldn't be using IInventory in 1.8.9+, you should be using the IItemHandler capability. I have an example of a chest that uses IItemHandler here (all other classes used are in the same repository). This includes the naming and loot generation features of vanilla chests, but not the animated model. You also shouldn't be using the deprecated GameRegistry.registerBlock or registering your blocks in init. Use GameRegistry.register in preInit to register all IForgeRegistryEntry implementations (e.g. Block , Item , Biome , SoundEvent ). This won't register an ItemBlock for your Block , you need to do that yourself.
  14. I can't see any obvious errors in your code, try stepping through the IInventory methods or the NBT reading/writing methods in a debugger and see if anything goes wrong. Side note: You shouldn't be using IInventory in 1.8.9+, you should be using the IItemHandler capability. I have an example of a chest that uses IItemHandler here (all other classes used are in the same repository). This includes the naming and loot generation features of vanilla chests, but not the animated model. You also shouldn't be using the deprecated GameRegistry.registerBlock or registering your blocks in init. Use GameRegistry.register in preInit to register all IForgeRegistryEntry implementations (e.g. Block , Item , Biome , SoundEvent ). This won't register an ItemBlock for your Block , you need to do that yourself.
  15. EntityLivingBase#getItemStackFromSlot
  16. EntityLivingBase#getItemStackFromSlot
  17. In 1.9, block/block defines the standard display transformations for block models. This is extended by all full cube models (e.g. block/cube and block/cube_all ). Similarly, item/generated extends builtin/generated and defines the standard display transformations for simple item models. You only need to define display transformations yourself when your model has a custom shape or you want it to be displayed differently to normal models.
  18. In 1.9, block/block defines the standard display transformations for block models. This is extended by all full cube models (e.g. block/cube and block/cube_all ). Similarly, item/generated extends builtin/generated and defines the standard display transformations for simple item models. You only need to define display transformations yourself when your model has a custom shape or you want it to be displayed differently to normal models.
  19. As it says in the error message, it's using the JAVA_HOME environment variable; not PATH . Set this to your JDK path.
  20. As it says in the error message, it's using the JAVA_HOME environment variable; not PATH . Set this to your JDK path.
  21. Do you actually understand what your code is doing? You're creating a new ItemStack of MAItems.SoulHarvester and then immediately checking if it's an ItemStack of MAItems.SoulHarvester . This will always be true , so it's completely pointless. You need to get the entity that did the killing from the DamageSource and then check its held item (like diesieben07 told you in the first reply). For random chances, use Random#nextInt to generate a random number, then check if it's in a specific range; e.g. random.nextInt(100) < 10 will be true 10% of the time.
  22. Do you actually understand what your code is doing? You're creating a new ItemStack of MAItems.SoulHarvester and then immediately checking if it's an ItemStack of MAItems.SoulHarvester . This will always be true , so it's completely pointless. You need to get the entity that did the killing from the DamageSource and then check its held item (like diesieben07 told you in the first reply). For random chances, use Random#nextInt to generate a random number, then check if it's in a specific range; e.g. random.nextInt(100) < 10 will be true 10% of the time.
  23. How you add functionality depends on the functionality you're adding. In this case, there's no event for block collisions so you'll need to subscribe to either PlayerTickEvent (fired only for players, make sure you check the event's Phase before running your code) or LivingUpdateEvent (fired for all living entities). In your event handler, iterate through all blocks inside the entity's bounding box (see Entity#doBlockCollisions ) and check if each one is a rose bush before damaging the entity.

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.