-
Posts
884 -
Joined
-
Last visited
-
Days Won
9
Everything posted by Jay Avery
-
It looks like you might need to study some Java fundamentals, because this is fairly basic syntax that you seem to be having trouble with. The correct line is: ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory"));
-
Post the whole log.
-
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model bte:block/limonaric_mud with loader VanillaLoader.INSTANCE, skipping ... Caused by: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated object at line 3 column 6 path There is a syntax error in your bte:block/limonaric_mud file. In future run your json files through a validator like jsonlint or an IDE plugin to catch mistakes like this.
-
[1.12.x/1.11.x] [SOLVED] Block connections (Collision, JSON)
Jay Avery replied to Bektor's topic in Modder Support
Oh, I just realised the problem, your model files are missing important things. "faces": { "down": { "cullface": "down" }, "up": { "cullface": "up" }, "north": { "cullface": "north" }, "south": { "cullface": "south" }, "west": { "cullface": "west" }, "east": { "cullface": "east" } } Each of the faces ("down" etc) needs to contain a "texture" element - a string referring to the texture label (as defined in the "textures" section at the start of your file) and starting with #. You likely also want a "uv" element - an array of four numbers - to define which area of the texture to apply to the face. Here is a random example from a model in my mod: "faces": { "down": { "uv": [ 15, 14, 0, 2 ], "texture": "#cotton1" }, "up": { "uv": [ 1, 4, 16, 16 ], "texture": "#cotton1" }, "north": { "uv": [ 0, 15, 15, 16 ], "texture": "#cotton1" }, "south": { "uv": [ 1, 15, 16, 16 ], "texture": "#cotton1" }, "west": { "uv": [ 2, 15, 14, 16 ], "texture": "#cotton1" }, "east": { "uv": [ 2, 15, 14, 16 ], "texture": "#cotton1" } } -
[1.12.x/1.11.x] [SOLVED] Block connections (Collision, JSON)
Jay Avery replied to Bektor's topic in Modder Support
Post the log again, the errors are probably not identical. -
[1.12.x/1.11.x] [SOLVED] Block connections (Collision, JSON)
Jay Avery replied to Bektor's topic in Modder Support
This block should be "textures" not "texture" - same mistake in cable_base and cable_side. -
[1.12.x/1.11.x] [SOLVED] Block connections (Collision, JSON)
Jay Avery replied to Bektor's topic in Modder Support
Post the full latest log, and your latest blockstates and model files. -
You can use the forge multi-layer model with the forge blockstates format, to render parts of the model in different layers. In your block, override Block#canRenderInLayer to return true for every layer which your block has. Then in the blockstates file, define the model as "forge:multi-layer". Add a "custom" tag, and inside that define each of the layers with the model to be rendered. I have an example which uses both translucent and cutout layers for different parts of the model: blockstates, block code.
-
To make an ItemStack with metadata, use the constructor new ItemStack(item, stackSize, metadata). To get a random number for the metadata you can use the method Random#nextInt(max), which returns an integer between 0 and max-1. World has a rand field which you can use for this.
-
You need to override createBlockState in your block class, and return a new BlockStateContainer constructed with all the properties you want your block to have.
-
Where/when do you send the message?
-
The variant it's looking for: [facing=west,is_on=true] The variant in your blockstates file: "is_on=true,facing=west": { Can you spot the difference? Fully-defined variants are simply strings, they must be an exact match - forge doesn't know that you mean the same thing when you have the variants written in a different order. The correct order to write the variants is with the variant names in alphabetical order, so "facing" comes before "is_on".
-
Any time you find yourself asking this question, the answer is in the vanilla code!
-
If you use an up-to-date version of Forge, there will be an EnumHand parameter passed to the method.
-
Thanks anyway. I just tried to use the verbose approach, but it's giving me a "Not a JSON object" error. Here is the full blockstates file: The variant I'm trying to define as an array is this: "brazil": [ { "model": "geomastery:trees/tree_small", "textures": { "bark": "geomastery:blocks/trees/barksize1brazil", "endgrain": "geomastery:blocks/trees/endgrainbrazil", "all": "geomastery:blocks/trees/leavesbrazil" } }, { "model": "geomastery:trees/tree_small_brazil_alt", "textures": { "bark": "geomastery:blocks/trees/barksize1brazil", "endgrain": "geomastery:blocks/trees/endgrainbrazil", "all": "geomastery:blocks/trees/leavesbrazil" } } ], The whole error from the console: What am I doing wrong?
-
I'm trying to figure out the syntax of a blockstates file. For each variant, I need to define several textures which are always the same, and also define several possible models which will be chosen from randomly. The texture definitions don't need to be different for different models (they have the same texture labels). But the only way I've seen of choosing randomly between models/textures is to make the entire variant definition an array, which would mean having to copy the textures definitions for each model. Is there any way to get around doing that? A way to define the textures once for the variant, and also give an array of possible models to choose from for that variant?
-
How to spawn structures in the nether(screenshots)
Jay Avery replied to TheRPGAdventurer's topic in Modder Support
The getHeight method returns (generally) the topmost solids block. In the nether, that's the bedrock on top of the world. If you want your structure to generate at a different altitude, you need to use a different y co-ordinate. The generate method returns a boolean. If you want to print a BlockPos, then put a BlockPos inside the logger statement. -
[1.12] How to get selected slot index on client side?
Jay Avery replied to WildHeart's topic in Modder Support
Store the size of the list as an integer, then loop through the list and store each string. To read it, create a new list, read the size, and then loop through that number of times to read each string. -
[1.12] How to get selected slot index on client side?
Jay Avery replied to WildHeart's topic in Modder Support
What do you mean? -
Move GameRegistry.register and ModelLoader.setCustomModelResourceLocation to preInit.
-
Your side check is the wrong way round, you should call openGui only when !worldIn.isRemote.
-
[1.12] How to get selected slot index on client side?
Jay Avery replied to WildHeart's topic in Modder Support
Use packets to send information from the server to the client. -
Where do you run this code? What is it supposed to do? What does NBT have to do with commands or right-clicking blocks?