summaryrefslogtreecommitdiff
path: root/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityHandPedestal.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/darkknight/jewelrycraft/tileentity/TileEntityHandPedestal.java')
-rwxr-xr-x[-rw-r--r--]src/main/java/darkknight/jewelrycraft/tileentity/TileEntityHandPedestal.java53
1 files changed, 31 insertions, 22 deletions
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityHandPedestal.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityHandPedestal.java
index e4a8602..c44cd88 100644..100755
--- a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityHandPedestal.java
+++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityHandPedestal.java
@@ -24,8 +24,8 @@ public class TileEntityHandPedestal extends TileEntity {
private boolean isHandOpen;
/**
- *
- */
+ *
+ */
public TileEntityHandPedestal() {
isDirty = false;
heldItemStack = null;
@@ -55,14 +55,17 @@ public class TileEntityHandPedestal extends TileEntity {
@Override
public void readFromNBT(NBTTagCompound tagCompound) {
super.readFromNBT(tagCompound);
- if (tagCompound.hasKey("object", 10)) setHeldItemStack(ItemStack.loadItemStackFromNBT(tagCompound.getCompoundTag("object")));
- else removeHeldItemStack();
+ if (tagCompound.hasKey("object", 10))
+ setHeldItemStack(ItemStack.loadItemStackFromNBT(
+ tagCompound.getCompoundTag("object")));
+ else
+ removeHeldItemStack();
isHandOpen = tagCompound.getBoolean("isHandOpen");
}
/**
- *
- */
+ *
+ */
@Override
public void updateEntity() {
super.updateEntity();
@@ -74,12 +77,14 @@ public class TileEntityHandPedestal extends TileEntity {
}
/**
- *
- */
+ *
+ */
private void updateGrip() {
prevGrip = grip;
- if (grip > 0 && isHandOpen) grip -= 1 / gripScale;
- else if (grip < gripMax && !isHandOpen) grip += 1 / gripScale;
+ if (grip > 0 && isHandOpen)
+ grip -= 1 / gripScale;
+ else if (grip < gripMax && !isHandOpen)
+ grip += 1 / gripScale;
}
/**
@@ -89,7 +94,8 @@ public class TileEntityHandPedestal extends TileEntity {
public Packet getDescriptionPacket() {
NBTTagCompound nbttagcompound = new NBTTagCompound();
writeToNBT(nbttagcompound);
- return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 0, nbttagcompound);
+ return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 0,
+ nbttagcompound);
}
/**
@@ -97,14 +103,15 @@ public class TileEntityHandPedestal extends TileEntity {
* @param packet
*/
@Override
- public void onDataPacket(NetworkManager networkManager, S35PacketUpdateTileEntity packet) {
+ public void onDataPacket(NetworkManager networkManager,
+ S35PacketUpdateTileEntity packet) {
readFromNBT(packet.func_148857_g());
worldObj.func_147479_m(xCoord, yCoord, zCoord);
}
/**
- *
- */
+ *
+ */
@Override
public void markDirty() {
super.markDirty();
@@ -125,28 +132,30 @@ public class TileEntityHandPedestal extends TileEntity {
if (heldItemStack != null && heldItemStack.getItem() != null) {
heldItemStack.stackSize = 1;
this.heldItemStack = heldItemStack;
- if (heldItemStack.getItem() instanceof ItemBlock) gripScale = 0.5f;
- else gripScale = 1;
+ if (heldItemStack.getItem() instanceof ItemBlock)
+ gripScale = 0.5f;
+ else
+ gripScale = 1;
}
}
/**
- *
- */
+ *
+ */
public void removeHeldItemStack() {
heldItemStack = null;
}
/**
- *
- */
+ *
+ */
public void openHand() {
isHandOpen = true;
}
/**
- *
- */
+ *
+ */
public void closeHand() {
isHandOpen = false;
}