Posted September 16, 20178 yr Hello, How can I make a multilayer block model? With that I mean I specify the texture of layer 1 and layer 2 and layer 2 gets rendered on top of layer 1. I've tried: { "parent": "block/cube_all", "textures": { "all": "blocks/stone", "overlay": "dgm:blocks/cheese_ore" }, "elements": [ { "from": [ 0, 0, 0 ], "to": [ 16, 16, 16 ], "faces": { "down": { "texture": "#overlay", "cullface": "down" }, "up": { "texture": "#overlay", "cullface": "up" }, "north": { "texture": "#overlay", "cullface": "north" }, "south": { "texture": "#overlay", "cullface": "south" }, "west": { "texture": "#overlay", "cullface": "west" }, "east": { "texture": "#overlay", "cullface": "east" } } } ] } But that only renders the overlay and the transparency in it white. Then I tried making the block opaque etc. and that ended up making the transparency transparent without the other layer: public class CheeseOre extends Block { public CheeseOre(Material materialIn) { super(materialIn); } @Override @SideOnly(Side.CLIENT) public BlockRenderLayer getBlockLayer() { return BlockRenderLayer.CUTOUT; } @Override public boolean isFullCube(IBlockState state) { return false; } @Override public boolean isOpaqueCube(IBlockState state) { return false; } } So how can I do it? Edited September 16, 20178 yr by Kokkie Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
September 16, 20178 yr Add more elements with a different texture reference. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
September 16, 20178 yr Author That's basically what I did, as you can see I 'extended' block/cube_all and specified the stone texture to it. Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
September 16, 20178 yr No, you overwrote block/cube_all's elements. You didn't add, you replaced. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
September 16, 20178 yr Author Oh sorry, didn't know I did, how can I add instead of replace? Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
September 16, 20178 yr You can't. The "elements" tag is specifically a replacement. Actually all named tags are replacements. Its just that in some cases (like the "display" tag on items*) that things aren't replaced, and it has to do with how the files are deserialized. You MUST add all 6 sides to your model twice, each with a different texture. There is no way around this. *This reason this is true is because "display" is an object. Each subtag present replaces the parent's original. "elements" is a list and there's no way to know that the element list you've supplied should add or replace the parent's list, so the default action is replace (if the default was add there would be no ability to replace). Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
September 16, 20178 yr Author Okay, thanks Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
September 16, 20178 yr Author Now, the purple/black texture appears. My new block model: { "parent": "block/block", "textures": { "block": "blocks/stone", "ore": "dgm:blocks/cheese_ore", "particle": "blocks/stone" }, "elements": [ { "from": [ 0, 0, 0 ], "to": [ 16, 16, 16 ], "faces": { "down": { "texture": "#block", "cullface": "down" }, "up": { "texture": "#block", "cullface": "up" }, "north": { "texture": "#block", "cullface": "north" }, "south": { "texture": "#block", "cullface": "south" }, "west": { "texture": "#block", "cullface": "west" }, "east": { "texture": "#block", "cullface": "east" } } }, { "from": [ 0, 0, 0 ], "to": [ 16, 16, 16 ], "faces": { "down": { "texture": "#overlay", "cullface": "down" }, "up": { "texture": "#overlay", "cullface": "up" }, "north": { "texture": "#overlay", "cullface": "north" }, "south": { "texture": "#overlay", "cullface": "south" }, "west": { "texture": "#overlay", "cullface": "west" }, "east": { "texture": "#overlay", "cullface": "east" } } } ] } The console and client log give no errors. Edited September 16, 20178 yr by Kokkie Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
September 16, 20178 yr Couple things: 1) Your overlay texture is #overlay, you didn't specify a resource location (this is likely the problem). 2) You haven't specified any UV coordinates. You probably don't need them, but it's good form to have them. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
September 16, 20178 yr Author Ah yeah, forgot to change #overlay to #ore. Now it works, thanks! Classes: 94 Lines of code: 12173 Other files: 206 Github repo: https://github.com/KokkieBeer/DeGeweldigeMod
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.