#2493 Coord Selector NBT can be missing causing crashes

This commit is contained in:
tterrag1098 committed 2015-05-22 16:47:29 -04:00
1 parent bb6b84d255
commit 979f0727c2
2 files changed
+3 -7

No files matched your search

@@ -11,6 +11,7 @@ import crazypants.enderio.material.Alloy;
import crazypants.enderio.material.BlockFusedQuartz;
import crazypants.enderio.material.Material;
import crazypants.enderio.power.Capacitors;
import crazypants.enderio.teleport.telepad.ItemCoordSelector;
public class TeleportRecipes {
@@ -45,6 +46,7 @@ public class TeleportRecipes {
}
ItemStack coordSelector = new ItemStack(EnderIO.itemCoordSelector);
ItemCoordSelector.init(coordSelector);
GameRegistry.addRecipe(new ShapedOreRecipe(coordSelector, "sps", " cs", " s", 's', "ingotElectricalSteel", 'p', Items.ender_pearl, 'c', Items.compass));
}
}
@@ -51,13 +51,7 @@ public class ItemCoordSelector extends Item implements IResourceTooltipProvider
list.add(stack);
}
@Override
public void onCreated(ItemStack stack, World world, EntityPlayer player) {
super.onCreated(stack, world, player);
init(stack);
}
private void init(ItemStack stack) {
public static void init(ItemStack stack) {
stack.stackTagCompound = new NBTTagCompound();
new BlockCoord().writeToNBT(stack.stackTagCompound);
stack.stackTagCompound.setBoolean("default", true);