Jump to content

Jantek

Members
  • Posts

    4
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Location
    Warsaw, Poland
  • Personal Text
    It's all good as long as we make progress.

Recent Profile Visitors

680 profile views

Jantek's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Fixed. As SatyPardus said, the problem happened to be so simple and stupid in fact. I was using Eclipse for coding and Notepad++ for json files. But Eclipse doesn't always sync well with changes in the OS file system without manually refreshing. The strange behaviour was caused by the cache of Eclipse. I once thought I fixed the problem using ModelLoader.setCustomModelResourceLocation() but the point is, it forced me to copy the model also to the item folder and I did copying within Eclipse so it forced the Eclipse to reload the file and BAM! it works. A really big pain in the ass if one is aware of this behaviour. Man, I was hard trying like everything for few days just because I didn't press F5...
  2. I made a test by changing the size of the boxes of both layers to 10 pixels. Nothing changed. That made me think the game still uses some default model like block/block. This also makes sense explaining why changing the textures.#all variable in blockstate file actually changed the texture while changing other (custom) texture variables and also the #all variable in the model file changed nothing. So I also checked for some spelling mistakes in the reference to the model file. Like misspelling the modid or adding additional '/models/' to the path but I found none.
  3. Thanks! But after more tries I discovered that the game just ignores the model json. I don't know why. A shame it took me so long to discover that. So, why the game ignores it? As far as I know I don't have to register a custom model for a block, the model is just referenced in the blockstate json. Assuming I am wrong, I tried to call ModelLoader#registerCustomResourceLocation along with ModelBakery#registerItemVariants but still no change. Nor an exception thrown. What am I doing wrong?
  4. Hey. I'm trying to create a universal block for easier ore block creation making it a bit like the item spawn eggs. I made two different textures, one the ore without the core substance (just plain rock) and one the core substance (without the rock) coloured to white so it can be easily coloured procedurally. The rest of each texture is transparent. The problem I have encountered is that I cannot make the model use both of the layers of the texture. Also, I see some strange behaviour so that both the blockstate json and the model json ignore completely the texture variables and use only the #all field (currently marked as a comment) in the blockstate file. Funny and also weird thing is, the game remembers what this field was when I cut it out. So it uses a texture even if nowhere in the code is any reference to the texture itself. Creepy. I can't upload a picture (dunno why, it says "200" as an explanation) but the block is properly coloured but there is only one texture (one layer) of the block visible. The rest of the texture (which should be filled with the second texture) is transparent. [Oh, look, I can now!] The yellow item in the first slot is an Item with the "core" texture (coloured to yellow). Both of the json files get loaded. I don't get any exceptions logged. Both of the textures are visible to the game (I mean I already use them during troubleshooting with this and they got loaded normally). Thanks in advance for any help. The code of sulphur_ore.json (the blockstate file): { "forge_marker": 1, "defaults": { "textures": { //"all": "diversitymod:blocks/ore_core", "layer0": "diversitymod:blocks/ore_core", "layer1": "diversitymod:blocks/ore_rock" } }, "variants": { "normal": { "model": "diversitymod:multi_ore" }, "inventory": { "model": "diversitymod:multi_ore" } } } The code of multi_ore.json (the model file): { "forge_marker": 1, "parent": "block/block", "textures": { "particle": "diversitymod:blocks/ore_rock", "layer0": "diversitymod:blocks/ore_core", "layer1": "diversitymod:blocks/ore_rock" }, "elements": [ { "from": [ 0, 0, 0 ], "to": [ 16, 16, 16 ], "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#layer0", "tintindex": 0, "cullface": "down" }, "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#layer0", "tintindex": 0, "cullface": "up" }, "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#layer0", "tintindex": 0, "cullface": "north" }, "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#layer0", "tintindex": 0, "cullface": "south" }, "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#layer0", "tintindex": 0, "cullface": "west" }, "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#layer0", "tintindex": 0, "cullface": "east" } } }, { "from": [ 0, 0, 0 ], "to": [ 16, 16, 16 ], "faces": { "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#layer1", "tintindex": 1, "cullface": "down" }, "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#layer1", "tintindex": 1, "cullface": "up" }, "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#layer1", "tintindex": 1, "cullface": "north" }, "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#layer1", "tintindex": 1, "cullface": "south" }, "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#layer1", "tintindex": 1, "cullface": "west" }, "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#layer1", "tintindex": 1, "cullface": "east" } } } ] } The code of the block: package com.jantek.diversity.blocks; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.util.BlockRenderLayer; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class BlockMultiOre extends BlockDiverse{ public static int COLOR; public BlockMultiOre(String name, int color) { super(Material.ROCK, name); COLOR=color; setHardness(3f); setResistance(5f); } @Override public BlockMultiOre setCreativeTab(CreativeTabs tab) { super.setCreativeTab(tab); return this; } @Override public boolean isOpaqueCube(IBlockState state) { return false; } @Override public boolean isFullCube(IBlockState state) { return false; } @SideOnly(Side.CLIENT) public BlockRenderLayer getBlockLayer(){ return BlockRenderLayer.CUTOUT; } }
×
×
  • Create New...

Important Information

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