summaryrefslogtreecommitdiff
path: root/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java')
-rwxr-xr-xsrc/main/java/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java96
1 files changed, 65 insertions, 31 deletions
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java
index 1b0ec8a..66d54b0 100755
--- a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java
+++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java
@@ -14,9 +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 boolean hasJewelry, hasEndItem, isDirty, hasGem,
+ crafting;
public ItemStack jewelry, endItem, gem;
- public int carving, effect;
+ public int carving, effect;
public float angle;
/**
@@ -88,7 +89,8 @@ 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)
@@ -102,46 +104,78 @@ public class TileEntityJewelrsCraftingTable extends TileEntity {
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;
@@ -203,8 +237,8 @@ public class TileEntityJewelrsCraftingTable extends TileEntity {
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 entityitem = new EntityItem(world, x + 0.5D,
+ y + 1D, z + 0.5D, stack);
entityitem.motionX = 0;
entityitem.motionZ = 0;
entityitem.motionY = 0.21000000298023224D;
@@ -218,8 +252,8 @@ 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);
}
/**