Fixed getCartClassForItem and getCartTypeForItem

This commit is contained in:
LexManos 2012-01-17 16:48:09 +00:00
parent 3b5b9c5d1e
commit 2319eec68b

View file

@ -699,7 +699,15 @@ public class MinecraftForge {
*/
public static Class<? extends EntityMinecart> getCartClassForItem(ItemStack item)
{
MinecartKey k = minecartForItem.get(item);
MinecartKey k = null;
for (ItemStack key : minecartForItem.keySet())
{
if (key.isItemEqual(item))
{
k = minecartForItem.get(k);
break;
}
}
if(k != null)
{
return k.minecart;
@ -716,7 +724,15 @@ public class MinecraftForge {
*/
public static int getCartTypeForItem(ItemStack item)
{
MinecartKey k = minecartForItem.get(item);
MinecartKey k = null;
for (ItemStack key : minecartForItem.keySet())
{
if (key.isItemEqual(item))
{
k = minecartForItem.get(k);
break;
}
}
if(k != null)
{
return k.type;