Jump to content

Jay Avery

Members
  • Posts

    884
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by Jay Avery

  1. Think about what you're trying to do with this method. You want to register a model for a block, right? Which block do you want to register the model for? Is it a 'null' block? Or is it one of the blocks you've already created and that doesn't have a model?
  2. Yeah, that's because you create a variable and set it to null, then try to use it. Please learn some general java or you won't be able to make much progress here.
  3. You need to know basic java to be able to make a mod. You can start here.
  4. Can you post a screenshot of your folder/file structure, and also show the code where you register models.
  5. Is this the location of your block model file?
  6. Has this system changed with the forum revamp? I can't find that setting. (Is it okay to post in this thread? It's pinned but has no replies for a year :S)
  7. Interesting! I started off trying to use an iterator but that caused ConcurrentModificationExceptions when I added to the list during iteration - that's why I switched to a Queue. How do you avoid that problem? I haven't noticed any problem with BlockPos duplication but I haven't checked carefully. I'll try printing out the results list before using it and see if it does contain any duplicates. How are you checking for duplicates before adding to the results list? BlockPos uses Vec3i#equals which just compares the three co-ordinates so I can't think of a reason that wouldn't work reliably. Would you care to share your code?
  8. Please post your files on pastebin or somewhere else they can be read online.
  9. So, the player activates your item and then something is added to the player's overlay display that shows their direction, even when they put the item down? (just checking I understand your aim) To make it work consistently, you will need to store the information in the player (using a capability). Otherwise, what happens if one player activates a compass and another doesn't? Currently, you're storing the state in a static field in your item class so it will apply the same thing to all players no matter what.
  10. What? This is a list of all vanilla blocks. You're missing more than just tall grass.
  11. Show the code for your compass item. Here is info about capabilities: https://mcforge.readthedocs.io/en/latest/datastorage/capabilities/
  12. I don't know what you mean. Highlight what yellow?
  13. You have the stack size outside the ItemStack constructor instead of inside.
  14. Wow, this sounds super interesting!
  15. That's because it is always true for generated leaves. Trees are generated with their leaves 'ready to decay', but the leaves stay as long as there is a log nearby - then decay as soon as logs are removed. I haven't found a better way of finding leaves' decay state than to copy the convoluted vanilla code in BlockLeaves#updateTick to do the same check manually.
  16. You can use getValue in the exact way you were, you just need to specify BlockLeaves.CHECK_DECAY instead of CHECK_DECAY without the class.
  17. Come on man, basic java. Accessing a static field from a class: TheClass.STATIC_FIELD. -> BlockLeaves.CHECK_DECAY.
  18. An update for anyone who's interested. I've made a searching algorithm that finds all connected trunk blocks, and connected leaves up to a certain count, starting closest to the trunk. I use it in this method, (and use the search results to make all the tree blocks fall). If anyone has ideas on how to improve the performance I'd be grateful - I know I've used several different collections to keep track of all the checking but I couldn't think of any way to reduce that further.
  19. Your problem on that line is a simple java error, nothing to do with this issue. CHECK_DECAY is a static field in the BlockLeaves class, so unless your code is in a subclass of BlockLeaves, you need to explicitly refer to the class the field is in.
  20. Where do you call that code?
  21. No, capabilities are not created automatically. What exactly are you trying to do?
  22. To help identify the problem, post: Your Block code Your blockstates file Your block and model registration code Your console log I don't understand what I'm seeing in that image?
  23. ModelLoader.setCustomModelResourceLocation needs to be called in preInit rather than init. Also, resource paths (like your json filenames) should be all lowercase. This is incorrect - Item#getRegistryName() already includes the modid.
×
×
  • Create New...

Important Information

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