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.

Animefan8888

Forge Modder
  • Joined

  • Last visited

Everything posted by Animefan8888

  1. You need to edit your model and add planes for the inside.
  2. To use the instanceof check do stack.getItem() instanceof bagClassName
  3. What can/should/do I use here then? (I was just experimenting with instanceof and no good, so that's why I ask) How did you use instanceof and you could also use stack.getItem() != bagItemField.
  4. Just in case he wants to make more Bags than just one. This way you can't put any bag inside a bag.
  5. Ok just asking, you know what an ItemStack is, right? And do you know what an instanceof check is?
  6. What would I be overriding here? canTakeStack? or what else? EDIT: NEVERMIND I found isItemValid. Now, how do I say "test_bag is a no-no"? if(__ = test_bag) return false? Quick question, how much Java do you know, how much Minecraft/Forge do you know?
  7. I'm not quite sure, but maybe return new ActionResult(EnumActionResult.PASS, ItemStack.EMPTY); If not then you need to set the players current hand to ItemStack.EMPTY during the process. Also for the boolean you need to save it to the stack and not store it in the Item class.
  8. You dont read and write it in your TE.
  9. You do not need to do anything capability related. Well, the Forge energy system stuff uses capabilities, so I want to use them, too. I'm just wondering when I'm creating my own EnergyStorage class which is actually a slightly modified version (so it's using IEnergyStorage, but offers also more methods) of EnergyStorage (but does not extend it, it implements the same interface however), if I have to create in that case a new capability and a new interface or not........... If you are using the forge capability system and that Capability is already registered you do not need to do any capability registering stuff. You can create new implementations whenever you want and use them as long as it ultimately implements IEnergyStorage.
  10. You do not need to do anything capability related.
  11. NBTTagCompound NBTBase = new NBTTagCompound(); And @Override public ICapabilityProvider initCapabilities(ItemStack stack, NBTTagCompound nbt) { return new CustomCapabilityProvider... } Please use your IDE.
  12. Global is a field created in the class, while local field is a field created in {} which can only be used inside of those "{}". public void initCapabilities() { } Not the correct method; we told you to override the method called initCapabilities.
  13. Alright, so I do that, but it says I then need to add unimplemented methods, and that method is the same thing. serialize nbt. I added @Override, but it then says remove it. I updated github: https://github.com/EscapeMC/ThingsMod-1.10.2 Remove the parameter in serializeNBT and create a local field of NBTBase and use that one and set it equal to a new NBTTagCompound. Ok, it took some figuring out, (and some sleep) but I think I've got the NBT part of this: https://github.com/EscapeMC/ThingsMod-1.10.2/blob/master/src/main/java/com/github/escapemc/thingsmod/items/TestBagCapabilities.java#L35 Then also, on that link, look up slightly. Would that be correct for both the hasCapability and getCapability? getCapability and hasCapability are indeed correct, but your serializeNBT is not you need a local field not a global field for your NBTBase.
  14. Alright, so I do that, but it says I then need to add unimplemented methods, and that method is the same thing. serialize nbt. I added @Override, but it then says remove it. I updated github: https://github.com/EscapeMC/ThingsMod-1.10.2 Remove the parameter in serializeNBT and create a local field of NBTBase and use that one and set it equal to a new NBTTagCompound.
  15. Not quite you need to do ((NBTTagCompound)nbt).setTag("inputSlot", inputSlot.serialize());
  16. No your serialize needs to write to the NBTBase not read from it.
  17. Yes. Deserialize and Serialize are your read and write. So you load and save your ItemStackHandler with those. The hasCapability you had before works. The getCapability needs to check if the capability parameter is CapabilityItemHandler.ITEM_HANDLER_CAPABILITY and then return your ItemStackHandler.
  18. Remove public NBTTagCompound serializeNBT(NBTBase nbt) { super.serializeNBT(); compound.setTag("inputSlot", inputSlot.serializeNBT()); return compound; } @Override public void deserializeNBT(NBTBase nbt) { inputSlot.deserializeNBT(nbt.getCompoundTag("inputSlot")); } From your item_bag. Move protected ItemStackHandler inputSlot; from your item_bag to your TestBagCapabilities
  19. Wait can you write out exactly what each thing needs to change to because ti still does not work and I have a feeling that I am just doing 1-2 thing(s) wrong. How should I do this? What should I make this class? (What type?) I don't think I can get anymore specific than what I said... And just a class that implements ICapabilitySerializable And in your ItemBag make a method called initCapabilities() Alright. So I've made this class. I called it "TestBagCapabilities" Now I created initCapabilities in test_bag. Now what? And the read/write NBT still isn't working.. Two things... Post your code or if you have a github put it on there and provide a link and every time your code changes update github.
  20. Wait can you write out exactly what each thing needs to change to because ti still does not work and I have a feeling that I am just doing 1-2 thing(s) wrong. How should I do this? What should I make this class? (What type?) I don't think I can get anymore specific than what I said... And just a class that implements ICapabilitySerializable And in your ItemBag make a method called initCapabilities()
  21. Change readFromNBT to deserializeNBT(NBTBase nbt) Change writeToNBT to serializeNBT() Don't make you Item implement ICapabilitySerializable make a new class that does, then override initCapabilities in your Item class.
  22. For what? My bag? (and that was an accidental thank you, but have it anyway ) OK, and yes.
  23. Then you should be good... could you post all of the code?
  24. Deserialize and Serialize mean to read and to write. Did you use IInventory for your Chest?

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.