Skip to content

Instantly share code, notes, and snippets.

@colejagdtiger
Created June 1, 2017 23:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save colejagdtiger/f15c0fcd3cfb4c69c1c8e4f8201619cd to your computer and use it in GitHub Desktop.
Save colejagdtiger/f15c0fcd3cfb4c69c1c8e4f8201619cd to your computer and use it in GitHub Desktop.
ItemRenderingTroubles
package com.colejagdtiger.testing.item;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class DarkIngot extends Item {
public DarkIngot() {
super();
setRegistryName("darkIngot");
setUnlocalizedName("darkIngot");
}
@SideOnly(Side.CLIENT)
public void initModel() {
ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(getRegistryName(), "inventory"));
}
}
{
"parent": "item/generated",
"textures": {
"layer0": "testing:items/dark_ingot"
}
}
package com.colejagdtiger.testing;
import com.colejagdtiger.testing.item.DarkIngot;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class ModItems {
public static DarkIngot darkIngot;
public static void init() {
GameRegistry.register(darkIngot = new DarkIngot());
}
@SideOnly(Side.CLIENT)
public static void initModels() {
((DarkIngot) darkIngot).initModel();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment