Everything posted by Flutterish
-
[1.12.2] [SOLVED] A problem with assigning textures to more than 1 item
Fixed it! The problem was, I dont really know what, but I used the Minecraft method and it worked. Had to also move it to Init. Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Items.Bs[0], 0, new ModelResourceLocation(Permafrost.RESOURCE_PREFIX + Names.item_B[0], "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Items.Bs[1], 0, new ModelResourceLocation(Permafrost.RESOURCE_PREFIX + Names.item_B[1], "inventory"));
-
[1.12.2] [SOLVED] A problem with assigning textures to more than 1 item
Thats because there were no exceptions. I printed out the name, it was exacly as I set it. I did the checking earlier, I said it works when either one is commented out, but not when both are called. ok, also there are two methods: public static void init() { Items.idcounter = 0; setProperties(69, Permafrost.MOD_ID + ":B_tab", 0); setProperties(16, CreativeTab.B_tab[0]); //CreativeTab.makeTab(Permafrost.MOD_ID + ":B_tab", new ItemStack(Bs[0])); GameRegistry.addShapedRecipe(new ResourceLocation(Permafrost.MOD_ID, Names.item_B[0]), null, new ItemStack(Bs[0], 1), "AAA", "AAA", "AAA", 'A', Blocks.DIAMOND_BLOCK); GameRegistry.addShapedRecipe(new ResourceLocation(Permafrost.MOD_ID, Names.item_B[0]+"b"), null, new ItemStack(Blocks.DIAMOND_BLOCK, 9), "A", 'A', Bs[0]); } @SideOnly(Side.CLIENT) public static void initClient() { ModelLoader.setCustomModelResourceLocation(Items.Bs[0], 0, new ModelResourceLocation(Permafrost.RESOURCE_PREFIX + Names.item_B[0], "inventory")); ModelLoader.setCustomModelResourceLocation(Items.Bs[1], 0, new ModelResourceLocation(Permafrost.RESOURCE_PREFIX + Names.item_B[1], "inventory")); } the top one is called first. Both in preInit. Maybe that helps. Dont worry about the setProperties with what seems to be invalid arguments, this is just another method used to autocreate a creative tab with initiated item as its icon.
-
[1.12.2] [SOLVED] A problem with assigning textures to more than 1 item
They do match the json file, how else would they load? Did you look at the pictures I provided?
-
[1.12.2] [SOLVED] A problem with assigning textures to more than 1 item
Why would I want to get what model is loading tho? All models work correctly alone, its just that they dont work together. Let me show you: only first item loaded: second item loaded: both loaded: Also, yes I did try to set the names to be the same, nothing changed.
-
[1.12.2] [SOLVED] A problem with assigning textures to more than 1 item
So I managed to add a texture to one item, but then I added a second item and its texture isnt displayed while the first items texture changed. The trouble code is this: @SideOnly(Side.CLIENT) public static void initClient() { ModelLoader.setCustomModelResourceLocation(Items.Bs[0], 0, new ModelResourceLocation(Permafrost.RESOURCE_PREFIX + Names.item_B[0], "inventory")); ModelLoader.setCustomModelResourceLocation(Items.Bs[1], 0, new ModelResourceLocation(Permafrost.RESOURCE_PREFIX + Names.item_B[1], "inventory")); } All the lines work as intended if I comment out the other line, but together they just do not. To clarify: if I have first line on, my first item has a correct texture [second, obviously, has none (the purple/black one)] If I have the second one on, the second item has a correct texture while the first has none. If I have both lines on, the first item has the second items texture. Items.Bs[] is a list of custom Items with an overriden line for toolTips. Items class is not Minecraft.init.items, its a custom class I create my items in this function: public static void setProperties(int stacksize, CreativeTabs ct) { permafrost_mod_item B = new permafrost_mod_item(); B.setUnlocalizedName(Names.item_B[Items.idcounter]); B.setMaxStackSize(stacksize); B.setCreativeTab(ct); B.setRegistryName(new ResourceLocation(Permafrost.MOD_ID, Names.item_B[Items.idcounter])); B.id = Items.idcounter; Items.Bs[Items.idcounter] = B; Items.idcounter++; } The method is invoked in preInit at ClientProxy. Please help, I just do not see anything that could be wrong... Fixed! Problem still unknown, but using another method works: Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Items.Bs[0], 0, new ModelResourceLocation(Permafrost.RESOURCE_PREFIX + Names.item_B[0], "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Items.Bs[1], 0, new ModelResourceLocation(Permafrost.RESOURCE_PREFIX + Names.item_B[1], "inventory"));
IPS spam blocked by CleanTalk.