fix NPE
This commit is contained in:
@@ -19,11 +19,11 @@ public class ItemPattern extends ItemBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack cell, EntityPlayer player, List list, boolean b)
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean b)
|
||||||
{
|
{
|
||||||
if (isValid(player.worldObj, cell))
|
if (isValid(player.worldObj, stack))
|
||||||
{
|
{
|
||||||
list.add(getPatternResult(player.worldObj, cell).getDisplayName());
|
list.add(getPatternResult(player.worldObj, stack).getDisplayName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -96,7 +96,14 @@ public class ClientProxy extends CommonProxy
|
|||||||
@Override
|
@Override
|
||||||
public ModelResourceLocation getModelLocation(ItemStack stack)
|
public ModelResourceLocation getModelLocation(ItemStack stack)
|
||||||
{
|
{
|
||||||
return new ModelResourceLocation("storagecraft:" + (!ItemPattern.hasPattern(stack) ? "blank_" : "") + "pattern", "inventory");
|
if (ItemPattern.hasPattern(stack))
|
||||||
|
{
|
||||||
|
return new ModelResourceLocation("storagecraft:pattern", "inventory");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return new ModelResourceLocation("storagecraft:blank_pattern", "inventory");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -106,6 +113,7 @@ public class ClientProxy extends CommonProxy
|
|||||||
ModelLoader.setCustomModelResourceLocation(StorageCraftItems.CORE, ItemCore.TYPE_DESTRUCTION, new ModelResourceLocation("storagecraft:destruction_core", "inventory"));
|
ModelLoader.setCustomModelResourceLocation(StorageCraftItems.CORE, ItemCore.TYPE_DESTRUCTION, new ModelResourceLocation("storagecraft:destruction_core", "inventory"));
|
||||||
|
|
||||||
ModelLoader.setCustomModelResourceLocation(StorageCraftItems.WIRELESS_GRID_PLATE, 0, new ModelResourceLocation("storagecraft:wireless_grid_plate", "inventory"));
|
ModelLoader.setCustomModelResourceLocation(StorageCraftItems.WIRELESS_GRID_PLATE, 0, new ModelResourceLocation("storagecraft:wireless_grid_plate", "inventory"));
|
||||||
|
|
||||||
ModelLoader.setCustomMeshDefinition(StorageCraftItems.WIRELESS_GRID, new ItemMeshDefinition()
|
ModelLoader.setCustomMeshDefinition(StorageCraftItems.WIRELESS_GRID, new ItemMeshDefinition()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ public class TileGrid extends TileMachine
|
|||||||
{
|
{
|
||||||
ItemStack result = patternCraftingResultInventory.getStackInSlot(0);
|
ItemStack result = patternCraftingResultInventory.getStackInSlot(0);
|
||||||
|
|
||||||
if (result != null && patternInventory.getStackInSlot(0).stackSize > 0 && patternInventory.getStackInSlot(1) == null)
|
if (result != null && patternInventory.getStackInSlot(0) != null && patternInventory.getStackInSlot(0).stackSize > 0 && patternInventory.getStackInSlot(1) == null)
|
||||||
{
|
{
|
||||||
ItemStack pattern = new ItemStack(StorageCraftItems.PATTERN);
|
ItemStack pattern = new ItemStack(StorageCraftItems.PATTERN);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user