Everything posted by xXJamie_Xx
-
[1.11.2] Block not being textured?
How would you suggest fixing this issue?
-
[1.11.2] Block not being textured?
I've used this code: public void preInit() { ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), 0, new ModelResourceLocation(block.getRegistryName(), "inventory")); } But its giving me an error saying that "block" cannot be resolved.
-
[1.11.2] Block not being textured?
@diesieben07 @Jay Avery Here is my client-proxy file at the moment: package com.xXJamie_Xx.myTweaks.proxy; import init.ModBlocks; import init.ModItems; public class ClientProxy implements CommonProxy{ @Override public void init() { ModItems.registerRenders(); ModBlocks.registerRenders(); } }
-
[1.11.2] Block not being textured?
I actually do see how that would make sense now. A server wouldn't do the rendering, the client would.
-
[1.11.2] Block not being textured?
Oh ok, its just that another user suggested I used it in replace of another piece of code I was using previously. (no offence to that user) BTW, how would I implement that code into the client-proxy and then refer to it in my ModBlocks file.
-
[1.11.2] Block not being textured?
Well I have ModBlocks.java: package init; import com.xXJamie_Xx.myTweaks.blocks.BlocktownCentre; import items.ItemObsidianingot; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraftforge.client.model.ModelLoader; import net.minecraftforge.fml.common.registry.GameRegistry; public class ModBlocks { public static Block townCentre; public static void init() { townCentre = new BlocktownCentre(); } public static void register() { registerBlock(townCentre); } private static void registerBlock(Block block) { GameRegistry.register(townCentre); ItemBlock item = new ItemBlock(block); item.setRegistryName(block.getRegistryName()); GameRegistry.register(item); } public static void registerRenders() { registerRender(townCentre); } private static void registerRender(Block block) { ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), 0, new ModelResourceLocation(block.getRegistryName(), "inventory")); } }
-
[1.11.2] Block not being textured?
{ "parent": "block/cube_all", "textures": { "all": "xmt:blocks/blocktowncentre" } }
-
[1.11.2] Block not being textured?
https://pastebin.com/q3Ui190J
-
[1.11.2] Block not being textured?
I have changed the file names to "blocktowncentre.json", I have noticed that the texture now shows when the block is placed in the world but not in the players inventory. The latest log file or console do not show any errors.
-
[1.11.2] Block not being textured?
I think the issue is that the json files are called towncentre.json instead of blocktowncentre.json.
-
[1.11.2] Block not being textured?
Latest Log: https://pastebin.com/8EpWjU7Z File Structure:
-
[1.11.2] Block not being textured?
I still can't get the texture to load. I assume all the json files need to have "blocktowncentre" as the model/textures?
-
[1.11.2] Block not being textured?
Although I cannot say for definite, I could almost be sure I heard another mod dev say that they had to do this for their mod so I believe this statement could be true.
-
[1.11.2] Block not being textured?
oh sorry, I wasn't thinking properly lol, I can see the difference, the previous piece of code made it so the untextured item was being shown in the middle of the screen and stuff so it was weird. Also, the first point you brought up about which stage I was registering my blocks/items. I already register them at pre-init with the following code: @EventHandler public void preInit(FMLPreInitializationEvent event) { ModItems.init(); ModItems.register(); ModBlocks.init(); ModBlocks.register(); }
-
[1.11.2] Block not being textured?
So if I understand you right, you are referring to this line: Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(block), 0, new ModelResourceLocation(block.getRegistryName(), "inventory")); You are saying just to replace that line with this:? ModelLoader::setCustomModelResourceLocation
-
[1.11.2] Block not being textured?
Hi, I understand the second point you made, the tutorial was made back in January so things have obviously changed but would you be able to elaborate on that first point though?
-
[1.11.2] Block not being textured?
FML Client Latest Log: https://pastebin.com/fv9AyAAF Screenshot of my assets folder structure: (ignore the obsidian ingot)
-
[1.11.2] Block not being textured?
I changed everything to lowercase but the problem still persists.
-
[1.11.2] Block not being textured?
Hi! So, I'm pretty new to modding so bare with me. I've created a block for testing purposes called "Town Centre". I've then created 3 json files: 1 under blockstates, 1 under models/block, and 1 under models/item. When I test it in game, I just see the un-textured block as the black/purple no texture thing. Blockstates: { "variants": { "normal": [ { "model": "xmt:townCentre" } ] } } Models/Block: { "parent": "block/cube_all", "textures": { "all": "xmt:blocks/townCentre" } } Models/Item: { "parent": "block/cube_all", "textures": { "all": "xmt:blocks/townCentre" } } Here is my ModBlocks.java file: https://pastebin.com/mXtaDZX2 Here is my BlocktownCentre.java file: https://pastebin.com/sSqNraRy Here is the full log from the Minecraft test run: https://pastebin.com/8azSBBhP Thanks for the help!
IPS spam blocked by CleanTalk.