-
Posts
884 -
Joined
-
Last visited
-
Days Won
9
Everything posted by Jay Avery
-
[1.9]Textures not showing up in inventory but are when placed
Jay Avery replied to ScytherHQ's topic in Modder Support
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? -
[1.9]Textures not showing up in inventory but are when placed
Jay Avery replied to ScytherHQ's topic in Modder Support
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. -
[1.9]Textures not showing up in inventory but are when placed
Jay Avery replied to ScytherHQ's topic in Modder Support
You need to know basic java to be able to make a mod. You can start here. -
[1.9]Textures not showing up in inventory but are when placed
Jay Avery replied to ScytherHQ's topic in Modder Support
Can you post a screenshot of your folder/file structure, and also show the code where you register models. -
[1.9]Textures not showing up in inventory but are when placed
Jay Avery replied to ScytherHQ's topic in Modder Support
Is this the location of your block model file? -
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)
-
Finding blocks connected to a start position
Jay Avery replied to Jay Avery's topic in Modder Support
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? -
Please post your files on pastebin or somewhere else they can be read online.
-
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.
-
Yep!
-
What? This is a list of all vanilla blocks. You're missing more than just tall grass.
-
Show the code for your compass item. Here is info about capabilities: https://mcforge.readthedocs.io/en/latest/datastorage/capabilities/
-
I don't know what you mean. Highlight what yellow?
-
You have the stack size outside the ItemStack constructor instead of inside.
-
Wow, this sounds super interesting!
-
Scanning trees always return CHECK_DECAY = true
Jay Avery replied to clowcadia's topic in Modder Support
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. -
Finding blocks connected to a start position
Jay Avery replied to Jay Avery's topic in Modder Support
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. -
Finding blocks connected to a start position
Jay Avery replied to Jay Avery's topic in Modder Support
Come on man, basic java. Accessing a static field from a class: TheClass.STATIC_FIELD. -> BlockLeaves.CHECK_DECAY. -
Finding blocks connected to a start position
Jay Avery replied to Jay Avery's topic in Modder Support
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. -
Finding blocks connected to a start position
Jay Avery replied to Jay Avery's topic in Modder Support
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. -
Where do you call that code?
-
No, capabilities are not created automatically. What exactly are you trying to do?
-
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?
-
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.