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.

Draco18s

Members
  • Joined

  • Last visited

Everything posted by Draco18s

  1. I will point out that if your seasons change and thereby the color changes, the game won't rerender everything unless the chunk is already set to be rerendered (e.g. a block changes). Block colors aren't meant to be dynamic over time.
  2. You need to send packets. You send a packet on the click that tells the server "hey, this button was clicked." The server then makes sure you're looking at a chest, where it is, etc. etc. and then stores the information (which does not go into chunk NBT, because chunk NBT only exists during the save/load process).
  3. Give a man a fish and he eats for a day. Teach a man to fish and he eats for a lifetime.
  4. The NBT constructor is for capability NBT, it is not the same as the ItemStack's stackTagCompound field.
  5. Do not PM me to alert me to a post in your thread. It only makes me want to ignore you.
  6. If you need your own custom slot class, extend SlotItemHandler. It already extends Slot for you and does 99% of what you need to interact with the ItemHandlerCapability in a GUI. Anywhere you are doing world.getTileEntity() and casting to IInventory. You instead call .getCapability() on the TE (instead of casting), passing in CapabilityItemHandler.ITEM_HANDLER_CAPABILITY object as the Capability to get. That capability is then the ItemStackHandler object that is your inventory (magic!). You would also pass in a side, but for GUI stuff, null is appropriate (represents "self" or similar, if you don't actually care about sided inventories, then it doesn't matter at all).
  7. Your TE's slots only. The Player's inventory is still an IInventory.
  8. Instead of using Slot you use SlotItemHandler and instead of casting to IInventory you use getCapability().
  9. You don't need to check for a result every tick. You only need to do it when the inventory changes.
  10. Two changes would make it really performant. 1) Declare the list once and save it to a field 2) Sort the list. If the list is sorted, you can use Arrays.binarySearch to get the index of the item (or a value less than zero, which indicates its not in the array). This form of searching the array is extra fast because it can take any sorted array and treat it as a binary tree, making fewer total operations. That said, I am not sure you can do a binary search on arbitrary types, but it might work.
  11. If you're not cooking it over time, then you don't need ITickable.
  12. At the top of your class add "implements ITickable" Let your IDE underline it in red. Pick the only suggested solution that makes any sense "implement the interface") One of the methods added automatically will be one called Update
  13. This is because you're extending ItemBlock and not overriding getMetadata(), which is set to return 0 by default
  14. Thanks for that. Checking my code I had 1 instance of "expand" that was improper.
  15. You need to set a breakpoint, then run in debug mode. And that breakpoint should be inside getItemAttributeModifiers() in ItemHoe
  16. You know how to use the debugger, right? It has nothing to do with the console...
  17. Use the debugger, figure out why (when getItemAttributeModifiers() is called) that the speed value you want isn't being used.
  18. The attack damage field isn't used by hoes: public Multimap<String, AttributeModifier> getItemAttributeModifiers(EntityEquipmentSlot equipmentSlot) { Multimap<String, AttributeModifier> multimap = super.getItemAttributeModifiers(equipmentSlot); if (equipmentSlot == EntityEquipmentSlot.MAINHAND) { multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", 0.0D, 0)); multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", (double)(this.speed - 4.0F), 0)); } return multimap; }
  19. It does. 1.7.10 is no longer supported here. Also there's probably a better way you can do what you want to do.
  20. Your inventory is size 3. this.addSlotToContainer(new Slot(tileentity, 0, 31, 24)); this.addSlotToContainer(new Slot(tileentity, 1, 66, 43)); this.addSlotToContainer(new SlotPestleOutput(player.player, tileentity, 3, 119, 30)); 0, 1, 3. Yes. That is how we count.
  21. Or rather, show the TileEntity class
  22. You need an item model that has a parent of the block model's json
  23. How do you expect to display the item in the inventory? By registering an item model. And where do you think it goes to go find that model? At the resource location you give it. So what does it expect to find there? A JSON file.

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.