我希望有人可以提供帮助。
无法设置纹理,我尝试了很多次,每次都得到紫黑色纹理。 (对不起我的英文)
代码(主类):
package com.ilshk.justamod;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
@Mod(modid = "JustAMod", name = "Just A Mod", version = "0.1")
public class JustAMod {
public static Item itemWeirdDust;
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
// ITEM AND BLOCK REGEIEIEIESTERING
itemWeirdDust = new itemWeirdDust().setUnlocalizedName("dustweird").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("JustAMod:dustweird");
GameRegistry.registerItem(itemWeirdDust, itemWeirdDust.getUnlocalizedName().substring(5));
}
@EventHandler
public void init(FMLInitializationEvent event) {
// Proxy, Tile Entity, GUI, Packet Registering
}
@EventHandler
public void postInit(FMLPostInitializationEvent event) {
}
}
代码(项目类别);
package com.ilshk.justamod;
import net.minecraft.item.Item;
public class itemWeirdDust extends Item {
}
纹理路径:Screenshot
答案 0 :(得分:0)
您的纹理名称必须与您在源文件夹中为纹理添加的图像名称相匹配。
这就是我的设置方式,它对我有用。
YourItemName = new Item().setUnlocalizedName("YourItemName").setTextureName("YourFolderName:YourExactTextureName").setCreativeTab(YourCreativeTabYouWantitoGoIn);