Jump to content

Jay Avery

Members
  • Posts

    884
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by Jay Avery

  1. Ah, I've just noticed here: stackHandlerCapability.insertItem(occupiedSlots++, burningItems.get(i).getEntityItem(), true); The boolean argument in IItemHandler#insertItem is simulate. When it's set to true, the stack isn't actually added.
  2. It's a list of ItemStacks. If you want to get an ItemStack from it, you pick an index and take it from the list. This is again pretty fundamental Java stuff. You mean it doesn't reach the breakpoint? That shows that the code isn't being run at all. Where do you register your event handler?
  3. This is the issue to focus on, because that constructor should work fine. Can you post the full log of this error?
  4. Now you're getting the tag and then not doing anything with it. You need to pass the tag to ItemStackHandler#deserializeNBT.
  5. Your read and write NBT methods aren't inverses. You write stackHandler to a tag compound of its own with the key "burnedItems", but then try to read it from the compound itself instead of getting the tag by the same key.
  6. https://www.jetbrains.com/help/idea/2017.1/creating-line-breakpoints.html
  7. Where do you call your ModBlocks#init and ModBlocks#registerRenders methods? You need to create an ItemBlock from your block, and register that too. You should use block#getRegistryName instead of block.getUnlocalizedName().substring(5) - the registry name also contains the modid by default so don't provide that as a separate argument.
  8. 1.7.10 isn't supported on this forum anymore, your thread will be closed by a mod.
  9. The Forge docs have a summary of how to get started and structure things. https://mcforge.readthedocs.io/en/latest/gettingstarted/
  10. Is this the exact name and location of your model file?
  11. Post the console log, model file(s), and a screenshot of your assets folder structure.
  12. What version are you using? In 1.11+ all asset names (models, textures) must be entirely lower case. If that doesn't solve the problem, post the entire console output too. (Also please use the code tags - <> icon - to make code blocks easier to read)
  13. What is the context? When and how do you want this to happen, in gameplay terms (not code terms)?
  14. https://www.jetbrains.com/help/idea/2017.1/debugging.html
  15. Ignoring the mess of the code to spawn drops, there is no reason this line shouldn't be doing what you want. Step through the code with the debugger or use print statements to see whether the code is reaching this point and acting on the block you expect it to, to find out where it goes wrong.
  16. 1.7.10 is no longer supported by Forge, your thread will be closed. You're also in the wrong forum, this is modder support for people who are making mods, not using them.
  17. You need to put them in an EventHandler method with FMLPreInitializationEvent as a parameter, instead of one with FMLInitializationEvent as they are now.
  18. Does it break ordinary breakable blocks? Does the game crash? Does the event get called?
  19. You're still doing this pointless check. And now you do nothing with the drop variable after you create it anyway. When you say the code doesn't work, please be more specific. Exactly what does and doesn't happen, and what are you expecting to happen? At this point I've lost track of the problem.
  20. I can't tell exactly what that crash means, but it's most likely another form of the same problem - something to do with bad slot indexes getting noticed when being written to NBT. Why did you change those slot indexes? I'd still recommend stepping through the container construction with the debugger and carefully watch the slots being added to see if they are indexed as you expect.
  21. Can you post the entire log? (code tags and a spoiler will make it easier to read too)
  22. Okay, what is the console log now?
  23. And that change alone has resulted in your GUI not opening?
  24. Now you are comparing a List<ItemStack> to an ItemStack, so the result will always be false. Why are you making this comparison anyway? What result are you actually trying to get? You still keep using ==, which only checks for the exact same object, rather than for meaningfully equivalent objects. Two different ItemStacks made of the same Item and stacksize will not be equal with the == operator. How could drop possibly be null here after you have set it to a new ArrayList? (Hint: it couldn't). You seem to be having trouble with some fairly fundamental Java/OOP concepts, you might be better off learning some general programming first.
  25. What have you changed?
×
×
  • Create New...

Important Information

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