Posted June 6, 20178 yr Well, i have some blocks that don't seem to want to have a texture. IDK what is going wrong Here is my code: ModBlocks.java: Spoiler package com.prisma.block; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.ItemBlock; import net.minecraftforge.fml.common.registry.GameRegistry; public class ModBlocks { public static BlockOre oreCopper; public static BlockBase blockCopper; public static void init() { oreCopper = register(new BlockOre("oreCopper").setCreativeTab(CreativeTabs.MATERIALS)); blockCopper = register(new BlockBase(Material.ROCK, "blockCopper").setCreativeTab(CreativeTabs.MATERIALS)); } private static <T extends Block> T register(T block, ItemBlock itemBlock) { GameRegistry.register(block); GameRegistry.register(itemBlock); if (block instanceof BlockBase) { ((BlockBase)block).registerItemModel(itemBlock); } return block; } private static <T extends Block> T register(T block) { ItemBlock itemBlock = new ItemBlock(block); itemBlock.setRegistryName(block.getRegistryName()); return register(block, itemBlock); } } BlockBase.java: Spoiler package com.prisma.block; import com.prisma.main.ProjectPrisma; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.ItemBlock; public class BlockBase extends Block { protected String name; public BlockBase(Material material, String name){ super(material); this.name = name; setUnlocalizedName(name); setRegistryName(name); } public void registerItemModel(ItemBlock itemBlock){ ProjectPrisma.proxy.registerItemRenderer(itemBlock, 0, name); } @Override public BlockBase setCreativeTab(CreativeTabs tab){ super.setCreativeTab(tab); return this; } } The JSON of the blockCopper: Spoiler { "forge_marker": 1, "defaults": { "textures": { "all": "projectprisma:blocks/blockCopper" } }, "variants": { "normal": { "model": "cube_all" }, "inventory": { "model": "cube_all" } } } And the image is named blockCopper.png i dont know what is going on
June 6, 20178 yr could we see the ProjectPlasma.proxy.registerItemRenderer. Cause I don't see you calling any method along the lines (or event, if you want to go that route) on the client side... ModelLoader.setCustModelResourceLocation(Item.getItemFromBlock(yourBlockInstance), 0, new ModelResourceLocation(yourBlockInstance.getRegistryName().toString()));
June 7, 20178 yr Author Here is my Client Proxy. I know this works because my items are working as well, should i use a separate one for my blocks? package com.prisma.proxy; import com.prisma.main.ProjectPrisma; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.item.Item; import net.minecraftforge.client.model.ModelLoader; public class ClientProxy extends CommonProxy{ @Override public void registerItemRenderer(Item item, int meta, String id) { ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(ProjectPrisma.modId + ":" + id, "inventory")); } }
June 10, 20178 yr Author Sorry i haven't been able to respond, I am very busy right now since school just ended. Here is the latest log: pastebin: https://pastebin.com/MvjBHw7N
June 10, 20178 yr Your asset files should be all lower case. 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.
June 11, 20178 yr Author That's a thing in 1.10? Jee. I guess a lot has changed since the good old days of 1.8
June 11, 20178 yr You might have other problems too, but lower cased asset files have been suggested since 1.7 1.11 enforces it. 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.
June 11, 20178 yr 11 hours ago, xXWitherBossXx said: Sorry i haven't been able to respond, I am very busy right now since school just ended. Here is the latest log: pastebin: https://pastebin.com/MvjBHw7N Caused by: java.io.FileNotFoundException: projectprisma:blockstates/blockCopper.json Do you have a blockstates file at this location? Edited June 11, 20178 yr by Jay Avery
June 11, 20178 yr Author No, I didn't see to add one in the tutorial I was following. Are they required? And does that replace the model file in the assets/models/block/blockName.json
June 11, 20178 yr Yes, it is required. You already made a blockstates file, you must just have it in the wrong place: Quote { "forge_marker": 1, "defaults": { "textures": { "all": "projectprisma:blocks/blockCopper" } }, "variants": { "normal": { "model": "cube_all" }, "inventory": { "model": "cube_all" } } }
June 11, 20178 yr Author Oh, does it go in the block States folder instead? And not in the assets/models/block/ folder?
June 11, 20178 yr Author But I have the blockCopper.json in that folder. What goes in the blockstates folder?
June 11, 20178 yr Author Oh, I think I get it now. The custom models go in the models folder, and the jsons for every block go in the blockstates folder. Thank you, I was thoroughly confused.
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.