Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
159 views
in Technique[技术] by (71.8m points)

java - Problem loading texture model in forge 1.8.9 mod

Im pretty new to coding mods, sorry if it is a simple fix. this is the log output: https://pastebin.com/gnFY6Fa3 here's the ModItems.java file

package slimer.mod.init;

import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraftforge.fml.common.registry.GameRegistry;
import slimer.mod.Reference;

public class ModItems {

public static Item copper_ingot; 

public static void init() {
    copper_ingot = new Item().setUnlocalizedName("copper_ingot");
}

public static void register() {
    registerItem(copper_ingot); 
}

public static void registerRenders() {
    registerRender(copper_ingot);   
}

public static void registerItem(Item item) {
    GameRegistry.registerItem(item, item.getUnlocalizedName().substring(5));
    System.out.println("Registered Item: " + item.getUnlocalizedName().substring(5));
}

public static void registerRender(Item item) {
    Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.MODID + ":" + item.getUnlocalizedName().substring(5), "inventory"));
}

}

if any other files need linking please say thanks in advance

Edit: Using Eclipse to edit

question from:https://stackoverflow.com/questions/65943466/problem-loading-texture-model-in-forge-1-8-9-mod

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Changed the MODID from Slimer to slimer and it worked


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...