Jump to content

Animefan8888

Forge Modder
  • Posts

    6157
  • Joined

  • Last visited

  • Days Won

    59

Everything posted by Animefan8888

  1. You also need to override another method that has a similar name to sendProgressBarUpdate.
  2. You need to sync it to the client, if it can be converted to a number then look at ContainerFurnace. Other wise you need to use packets.
  3. You override getActualState in your Block class. This will return the default state with 6 values; boolean values. Each one will represent if there is a block that is not air. If there is a block that is not air it will add to the model using forges submodel system. Meaning you will use a forge style BlockState. You will also have to override getMetaFromState, getStateFromMeta, createBlockState. What do you mean? I know Blockstates would probably be better but I find it a pain setting up the blockstates and all... I think I found it! I just had to set a cullface for the elements! But now the planes of the block below and my block are z-fighting (I think that's the right word). How do I fix that? You will have to make one face slightly closer to the middle of the block or slightly farther from the block.
  4. There would be a way... "north": { "texture": "#all", "uv": [ 0.0, 0.0, 0.0, 16.0 ] }, You specify the face in the model. But the BlockState part is definitely the correct way to go.
  5. You need a container for the players inventory.
  6. You need to edit your model and add planes for the inside.
  7. To use the instanceof check do stack.getItem() instanceof bagClassName
  8. 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.
  9. Just in case he wants to make more Bags than just one. This way you can't put any bag inside a bag.
  10. Ok just asking, you know what an ItemStack is, right? And do you know what an instanceof check is?
  11. 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?
  12. 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.
  13. 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.
  14. You do not need to do anything capability related.
  15. NBTTagCompound NBTBase = new NBTTagCompound(); And @Override public ICapabilityProvider initCapabilities(ItemStack stack, NBTTagCompound nbt) { return new CustomCapabilityProvider... } Please use your IDE.
  16. 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.
  17. 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.
  18. 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.
  19. Not quite you need to do ((NBTTagCompound)nbt).setTag("inputSlot", inputSlot.serialize());
  20. No your serialize needs to write to the NBTBase not read from it.
  21. 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.
  22. 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
×
×
  • Create New...

Important Information

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