Posted July 8, 20178 yr Description of the issue: Textures, registration and item localisation all work correctly, but I am currently stuck on getting tiles to localise. Here's a visual example of the issue... Spoiler As you can see from the pictures, my copper ingot works perfectly, but the tile (Copper ore) doesn't. Here is the code stuff: Spoiler public class CopperOre extends Block { public CopperOre() { super(Material.ROCK); setRegistryName(new ResourceLocation(Ref.MOD_ID, Ref.COPPER_ORE)); setUnlocalizedName(getRegistryName().getResourcePath()); } @SideOnly(Side.CLIENT) public void initModel() { ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), 0, new ModelResourceLocation(getRegistryName(), "inventory")); } } public class CopperIngot extends Item { public CopperIngot() { setRegistryName(new ResourceLocation(Ref.MOD_ID, Ref.COPPER_INGOT)); setUnlocalizedName(getRegistryName().getResourcePath()); } @SideOnly(Side.CLIENT) public void initModel() { ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(getRegistryName(), "inventory")); } } public class ModBlocks { @GameRegistry.ObjectHolder(Ref.RESOURCE_PREFIX + Ref.COPPER_ORE) public static CopperOre copperOre; @SideOnly(Side.CLIENT) public static void initModels() { copperOre.initModel(); } } public class ModItems { @GameRegistry.ObjectHolder(Ref.RESOURCE_PREFIX + Ref.COPPER_INGOT) public static CopperIngot copperIngot; @SideOnly(Side.CLIENT) public static void initModels() { copperIngot.initModel(); } } public class Ref { public static final String MOD_ID = "tau"; public static final String RESOURCE_PREFIX = Ref.MOD_ID + ":"; public static final String NAME = "Tau mod"; public static final String CLIENT_PROXY = "com.taunetwork.dev.tau.proxy.ClientProxy"; public static final String SERVER_PROXY = "com.taunetwork.dev.tau.proxy.ServerProxy"; public static final String COPPER_ORE = "copper_ore"; public static final String COPPER_INGOT = "copper_ingot"; } @Mod.EventBusSubscriber public class CommonProxy { // Config instance public static Configuration config; public void preInit(FMLPreInitializationEvent event) { File directory = event.getModConfigurationDirectory(); config = new Configuration(new File(directory.getPath(), "tau.cfg")); Config.readConfig(); } public void init(FMLInitializationEvent event) { } public void postInit(FMLPostInitializationEvent event) { if (config.hasChanged()) { config.save(); } } @SubscribeEvent public static void registerBlocks(RegistryEvent.Register<Block> event) { event.getRegistry().register(new CopperOre()); } @SubscribeEvent public static void registerItems(RegistryEvent.Register<Item> event) { event.getRegistry().register(new ItemBlock(ModBlocks.copperOre) .setRegistryName(ModBlocks.copperOre.getRegistryName()) .setUnlocalizedName(ModBlocks.copperOre.getRegistryName().getResourcePath())); event.getRegistry().register(new CopperIngot()); } } @Mod.EventBusSubscriber(Side.CLIENT) public class ClientProxy extends CommonProxy { @Override public void preInit(FMLPreInitializationEvent e) { super.preInit(e); } @SubscribeEvent public static void registerModels(ModelRegistryEvent event) { ModBlocks.initModels(); ModItems.initModels(); } } public class ServerProxy extends CommonProxy { } Here is the directory in the IntelliJ IDE Spoiler And finally the main attraction... en_us.lang # Blocks tile:copper_ore.name=Copper Ore item:copper_ore.name=Copper Ore block:copper_ore.name=Copper Ore # Items item.copper_ingot.name=Copper Ingot I was testing with numerous ways of trying to get the localisation file to recognise the block but to no avail. Note: I do not use the mod id of the mod in my localisation files because I pass in the registry path string, I would doubt blocks and items have different unlocalised names based on the same parameters inputted... But feel free to explain if they do. [17:43:57] [main/INFO] [tau/tau]: Copper Ore unlocalised name: tile.copper_ore [17:43:57] [main/INFO] [tau/tau]: Copper Ore registry name: tau:copper_ore [17:43:57] [main/INFO] [tau/tau]: Copper Ore Item unlocalised name: tile.copper_ore [17:43:57] [main/INFO] [tau/tau]: Copper Ore Item registry name: tau:copper_ore [17:43:57] [main/INFO] [tau/tau]: Copper Ingot unlocalised name: item.copper_ingot [17:43:57] [main/INFO] [tau/tau]: Copper Ingot registry name: tau:copper_ingot Finally the registry names and unlocalised names of the blocks/items in question, outputted using the logger during post initialisation, for my own verification that I haven't missed anything when registering the objects. On the same context as the post itself, is the technique I am using to register blocks better or the same as doing: public CopperOre() { super(Material.ROCK); setRegistryName(new ResourceLocation(Ref.MOD_ID, Ref.COPPER_ORE)); setUnlocalizedName(getRegistryName().toString()); } Or does it not exactly matter for Forge conventions? fml-client-latest.log Edited July 8, 20178 yr by Nayrisian Issue solved
July 8, 20178 yr tile:copper_ore != tile.copper_ore VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
July 8, 20178 yr Author Just now, Animefan8888 said: tile:copper_ore != tile.copper_ore Omg... I cannot believe I missed that. Thank you for that quick evaluation...
July 8, 20178 yr Just now, Nayrisian said: Omg... I cannot believe I missed that. Thank you for that quick evaluation... No problem. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
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.