Skip to content

Commit

Permalink
Add a method to allow the spawn eggs to render correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander committed Apr 30, 2015
1 parent 30a05eb commit 82f4826
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/mantle/client/ModelVariant.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package mantle.client;

import java.util.ArrayList;
import java.util.Collection;

import mantle.blocks.util.BlockVariant;
Expand All @@ -8,7 +9,9 @@
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.model.ModelBakery;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

Expand Down Expand Up @@ -66,6 +69,16 @@ public void registerItemModelVariants(Item item)
}
}

public void registerItemSubTypesModel(Item item, CreativeTabs tab)
{
ArrayList<ItemStack> list = new ArrayList<ItemStack>();
item.getSubItems(item, tab, list);
for (ItemStack i : list)
{
this.registerItemModel(item, item.getUnlocalizedName().substring(5), i.getItemDamage());
}
}

private ModelResourceLocation getModelResource(String name, String type)
{
return new ModelResourceLocation((this.MOD_ID + ":") + name, type);
Expand Down

0 comments on commit 82f4826

Please sign in to comment.