diff options
Diffstat (limited to 'src/main/java/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java')
| -rwxr-xr-x | src/main/java/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java | 101 |
1 files changed, 28 insertions, 73 deletions
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java index 66d54b0..992e111 100755 --- a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java @@ -14,11 +14,10 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World;
public class TileEntityJewelrsCraftingTable extends TileEntity {
- public boolean hasJewelry, hasEndItem, isDirty, hasGem,
- crafting;
- public ItemStack jewelry, endItem, gem;
- public int carving, effect;
- public float angle;
+ public boolean hasJewelry, hasEndItem, isDirty, hasGem, crafting;
+ public ItemStack jewelry, endItem, gem;
+ public int carving, effect;
+ public float angle;
/**
*
@@ -89,8 +88,7 @@ public class TileEntityJewelrsCraftingTable extends TileEntity { public void updateEntity() {
super.updateEntity();
if (isDirty) {
- worldObj.markBlockForUpdate(xCoord, yCoord,
- zCoord);
+ worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
isDirty = false;
}
if (angle < 360F)
@@ -101,81 +99,42 @@ public class TileEntityJewelrsCraftingTable extends TileEntity { if (carving > 0)
carving--;
if (crafting)
- for (int l = 0; l < ConfigHandler.GEM_PLACEMENT_TIME
- / (carving + 2); ++l) {
+ for (int l = 0; l < ConfigHandler.GEM_PLACEMENT_TIME / (carving + 2); ++l) {
if (worldObj.rand.nextInt(10) == 0)
- worldObj.playSoundEffect(
- xCoord,
- yCoord + 0.5F,
- zCoord,
- "random.orb",
- 0.05F, 1F);
+ worldObj.playSoundEffect(xCoord, yCoord + 0.5F, zCoord, "random.orb", 0.05F, 1F);
if (getBlockMetadata() == 0)
- worldObj.spawnParticle(
- "instantSpell",
- xCoord + 0.5F,
- (double) yCoord + 0.8F,
- zCoord + 0.2F,
- 0.0D, 0.0D,
- 0.0D);
+ worldObj.spawnParticle("instantSpell", xCoord + 0.5F, (double) yCoord + 0.8F, zCoord + 0.2F,
+ 0.0D, 0.0D, 0.0D);
if (getBlockMetadata() == 1)
- worldObj.spawnParticle(
- "instantSpell",
- xCoord + 0.8F,
- (double) yCoord + 0.8F,
- zCoord + 0.5F,
- 0.0D, 0.0D,
- 0.0D);
+ worldObj.spawnParticle("instantSpell", xCoord + 0.8F, (double) yCoord + 0.8F, zCoord + 0.5F,
+ 0.0D, 0.0D, 0.0D);
if (getBlockMetadata() == 2)
- worldObj.spawnParticle(
- "instantSpell",
- xCoord + 0.5F,
- (double) yCoord + 0.8F,
- zCoord + 0.8F,
- 0.0D, 0.0D,
- 0.0D);
+ worldObj.spawnParticle("instantSpell", xCoord + 0.5F, (double) yCoord + 0.8F, zCoord + 0.8F,
+ 0.0D, 0.0D, 0.0D);
if (getBlockMetadata() == 3)
- worldObj.spawnParticle(
- "instantSpell",
- xCoord + 0.2F,
- (double) yCoord + 0.8F,
- zCoord + 0.5F,
- 0.0D, 0.0D,
- 0.0D);
+ worldObj.spawnParticle("instantSpell", xCoord + 0.2F, (double) yCoord + 0.8F, zCoord + 0.5F,
+ 0.0D, 0.0D, 0.0D);
}
if (carving == 0) {
hasEndItem = true;
endItem = jewelry.copy();
- if (hasGem && gem != new ItemStack(
- Item.getItemById(0), 0, 0))
- if (!JewelryNBT.hasTag(jewelry,
- "gem")) {
- JewelryNBT.addGem(endItem,
- gem);
+ if (hasGem && gem != new ItemStack(Item.getItemById(0), 0, 0))
+ if (!JewelryNBT.hasTag(jewelry, "gem")) {
+ JewelryNBT.addGem(endItem, gem);
hasGem = false;
- gem = new ItemStack(Item
- .getItemById(0),
- 0, 0);
+ gem = new ItemStack(Item.getItemById(0), 0, 0);
} else {
- ItemStack aux = JewelryNBT
- .gem(jewelry);
- JewelryNBT.addGem(endItem,
- gem);
- if (JewelrycraftUtil.rand
- .nextBoolean())
+ ItemStack aux = JewelryNBT.gem(jewelry);
+ JewelryNBT.addGem(endItem, gem);
+ if (JewelrycraftUtil.rand.nextBoolean())
gem = aux.copy();
else {
hasGem = false;
- gem = new ItemStack(
- Item.getItemById(
- 0),
- 0,
- 0);
+ gem = new ItemStack(Item.getItemById(0), 0, 0);
}
}
hasJewelry = false;
- jewelry = new ItemStack(
- Item.getItemById(0), 0, 0);
+ jewelry = new ItemStack(Item.getItemById(0), 0, 0);
carving = -1;
crafting = false;
isDirty = true;
@@ -235,10 +194,8 @@ public class TileEntityJewelrsCraftingTable extends TileEntity { isDirty = true;
}
- public void dropItem(World world, double x, double y, double z,
- ItemStack stack) {
- EntityItem entityitem = new EntityItem(world, x + 0.5D,
- y + 1D, z + 0.5D, stack);
+ public void dropItem(World world, double x, double y, double z, ItemStack stack) {
+ EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 1D, z + 0.5D, stack);
entityitem.motionX = 0;
entityitem.motionZ = 0;
entityitem.motionY = 0.21000000298023224D;
@@ -252,8 +209,7 @@ public class TileEntityJewelrsCraftingTable extends TileEntity { public Packet getDescriptionPacket() {
NBTTagCompound nbttagcompound = new NBTTagCompound();
writeToNBT(nbttagcompound);
- return new S35PacketUpdateTileEntity(xCoord, yCoord,
- zCoord, 1, nbttagcompound);
+ return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound);
}
/**
@@ -261,8 +217,7 @@ public class TileEntityJewelrsCraftingTable extends TileEntity { * @param packet
*/
@Override
- public void onDataPacket(NetworkManager net,
- S35PacketUpdateTileEntity packet) {
+ public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) {
readFromNBT(packet.func_148857_g());
worldObj.func_147479_m(xCoord, yCoord, zCoord);
}
|
