summaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorOnyxDarkKnight <sor1n.iliutza16@gmail.com>2015-04-30 01:25:36 +0100
committerOnyxDarkKnight <sor1n.iliutza16@gmail.com>2015-04-30 01:25:36 +0100
commitc19aeae6ae51ca9019f8051f83ab7eb52f4a1608 (patch)
tree352b2eb480eb811adbc49893d126725c0c24a416 /src/main/java
parentb9ca797621e116f65aff916f5d4d485a93be1abf (diff)
- Hand Pedestals no longer close the palm when you put something in
- Fixed the ritual crashing - Fixed the Liquids Tab from crashing
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/darkknight/jewelrycraft/block/BlockHandPedestal.java2
-rw-r--r--src/main/java/darkknight/jewelrycraft/item/ItemBaseJewelry.java1
-rw-r--r--src/main/java/darkknight/jewelrycraft/item/ItemMoltenMetal.java9
-rw-r--r--src/main/java/darkknight/jewelrycraft/tileentity/TileEntityShadowEye.java26
-rw-r--r--src/main/java/darkknight/jewelrycraft/util/Variables.java2
5 files changed, 23 insertions, 17 deletions
diff --git a/src/main/java/darkknight/jewelrycraft/block/BlockHandPedestal.java b/src/main/java/darkknight/jewelrycraft/block/BlockHandPedestal.java
index 6fe5b7f..f88048e 100644
--- a/src/main/java/darkknight/jewelrycraft/block/BlockHandPedestal.java
+++ b/src/main/java/darkknight/jewelrycraft/block/BlockHandPedestal.java
@@ -98,12 +98,10 @@ public class BlockHandPedestal extends BlockContainer
if (te != null){
if (!world.isRemote && te.getHeldItemStack() == null && item != null){
te.setHeldItemStack(item.copy());
- te.closeHand();
if (!entityPlayer.capabilities.isCreativeMode) item.stackSize--;
te.markDirty();
}else if (entityPlayer.isSneaking()) if (entityPlayer.inventory.addItemStackToInventory(te.getHeldItemStack())){
te.removeHeldItemStack();
- te.openHand();
}
te.markDirty();
}
diff --git a/src/main/java/darkknight/jewelrycraft/item/ItemBaseJewelry.java b/src/main/java/darkknight/jewelrycraft/item/ItemBaseJewelry.java
index 0d97e22..f5c7848 100644
--- a/src/main/java/darkknight/jewelrycraft/item/ItemBaseJewelry.java
+++ b/src/main/java/darkknight/jewelrycraft/item/ItemBaseJewelry.java
@@ -17,6 +17,7 @@ import net.minecraft.client.resources.IResourceManager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
diff --git a/src/main/java/darkknight/jewelrycraft/item/ItemMoltenMetal.java b/src/main/java/darkknight/jewelrycraft/item/ItemMoltenMetal.java
index 29e678f..09054db 100644
--- a/src/main/java/darkknight/jewelrycraft/item/ItemMoltenMetal.java
+++ b/src/main/java/darkknight/jewelrycraft/item/ItemMoltenMetal.java
@@ -22,7 +22,6 @@ import darkknight.jewelrycraft.util.Variables;
public class ItemMoltenMetal extends Item
{
-
/**
*
*/
@@ -68,9 +67,15 @@ public class ItemMoltenMetal extends Item
public static int color(ItemStack stack, int pass) throws IOException
{
IResourceManager rm = Minecraft.getMinecraft().getResourceManager();
+ ResourceLocation ingot;
BufferedImage icon;
if (stack != null && JewelryNBT.ingot(stack) != null && Item.getIdFromItem(JewelryNBT.ingot(stack).getItem()) > 0 && JewelryNBT.ingot(stack).getIconIndex() != null && JewelryNBT.ingotColor(stack) == 16777215){
- ResourceLocation ingot = ItemBaseJewelry.getLocation(JewelryNBT.ingot(stack), stack, false);
+ try{
+ ingot = ItemBaseJewelry.getLocation(JewelryNBT.ingot(stack), stack, false);
+ }
+ catch(Exception e){
+ ingot = new ResourceLocation("textures/items/apple.png");
+ }
icon = ImageIO.read(rm.getResource(ingot).getInputStream());
int height = icon.getHeight();
int width = icon.getWidth();
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityShadowEye.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityShadowEye.java
index 1f7371c..1e56431 100644
--- a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityShadowEye.java
+++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityShadowEye.java
@@ -77,9 +77,8 @@ public class TileEntityShadowEye extends TileEntity
boolean canStartRitual = valid && ((TileEntityHandPedestal)worldObj.getTileEntity(xCoord, yCoord - 3, zCoord)).heldItemStack != null && getNumberOfItems(worldObj, xCoord, yCoord, zCoord) > 0;
if (active){
timer--;
- if(canStartRitual && canChangePedestals(worldObj, xCoord, yCoord, zCoord) && opening == 4) changePedestals(worldObj, xCoord, yCoord, zCoord);
+ if (canStartRitual && canChangePedestals(worldObj, xCoord, yCoord, zCoord) && opening == 4) changePedestals(worldObj, xCoord, yCoord, zCoord);
}
-
if (active && target != null && this.getDistanceFrom(target.posX, target.posY, target.posZ) > 30D){
active = false;
timer = -1;
@@ -303,11 +302,13 @@ public class TileEntityShadowEye extends TileEntity
int l = world.getBlockMetadata(x, y, z);
world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(world.getBlock(x, y, z)));
TileEntityShadowHand tile = new TileEntityShadowHand();
- if(((TileEntityHandPedestal)world.getTileEntity(x, y, z)).heldItemStack != null) tile.setHeldItemStack(((TileEntityHandPedestal)world.getTileEntity(x, y, z)).heldItemStack.copy());
- if(tile.heldItemStack != null) tile.closeHand();
- ((TileEntityHandPedestal)world.getTileEntity(x, y, z)).removeHeldItemStack();
- world.setBlock(x, y, z, BlockList.shadowHand, l, 2);
- world.setTileEntity(x, y, z, tile);
+ if (world.getTileEntity(x, y, z) instanceof TileEntityHandPedestal){
+ if (((TileEntityHandPedestal)world.getTileEntity(x, y, z)).heldItemStack != null) tile.setHeldItemStack(((TileEntityHandPedestal)world.getTileEntity(x, y, z)).heldItemStack.copy());
+ if (tile.heldItemStack != null) tile.closeHand();
+ ((TileEntityHandPedestal)world.getTileEntity(x, y, z)).removeHeldItemStack();
+ world.setBlock(x, y, z, BlockList.shadowHand, l, 2);
+ world.setTileEntity(x, y, z, tile);
+ }
}
public void revertPedestals(World world, int x, int y, int z)
@@ -333,11 +334,12 @@ public class TileEntityShadowEye extends TileEntity
world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(BlockList.handPedestal));
world.playSoundEffect(x, y + 0.5F, z, "step.wood", 1F, 1F);
TileEntityHandPedestal tile = new TileEntityHandPedestal();
- if(((TileEntityShadowHand)world.getTileEntity(x, y, z)).heldItemStack != null) tile.setHeldItemStack(((TileEntityShadowHand)world.getTileEntity(x, y, z)).heldItemStack.copy());
- if(tile.heldItemStack != null) tile.closeHand();
- ((TileEntityShadowHand)world.getTileEntity(x, y, z)).removeHeldItemStack();
- world.setBlock(x, y, z, BlockList.handPedestal, l, 2);
- world.setTileEntity(x, y, z, tile);
+ if (world.getTileEntity(x, y, z) instanceof TileEntityShadowHand){
+ if (((TileEntityShadowHand)world.getTileEntity(x, y, z)).heldItemStack != null) tile.setHeldItemStack(((TileEntityShadowHand)world.getTileEntity(x, y, z)).heldItemStack.copy());
+ ((TileEntityShadowHand)world.getTileEntity(x, y, z)).removeHeldItemStack();
+ world.setBlock(x, y, z, BlockList.handPedestal, l, 2);
+ world.setTileEntity(x, y, z, tile);
+ }
}
/**
diff --git a/src/main/java/darkknight/jewelrycraft/util/Variables.java b/src/main/java/darkknight/jewelrycraft/util/Variables.java
index 14d1795..7e915de 100644
--- a/src/main/java/darkknight/jewelrycraft/util/Variables.java
+++ b/src/main/java/darkknight/jewelrycraft/util/Variables.java
@@ -6,7 +6,7 @@ public class Variables
{
public static final String MODID = "jewelrycraft2";
public static final String MODNAME = "Jewelrycraft 2";
- public static final String VERSION = "1.0.3";
+ public static final String VERSION = "1.0.4";
public static final String PACKET_CHANNEL = "jewelrycraft2";
public static final String CONFIG_GUI = "darkknight.jewelrycraft.config.ConfigGuiFactory";