summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/BlockFurnace.java
diff options
context:
space:
mode:
authorErik Broes <erikbroes@grum.nl>2011-01-29 22:50:29 +0100
committerErik Broes <erikbroes@grum.nl>2011-01-30 13:24:39 +0100
commitdf69047324abc54f5d5b8d069bb69b1061b20cce (patch)
tree76f8d13addf80730deea9285f4bd9a1ffbe45f80 /src/main/java/net/minecraft/server/BlockFurnace.java
parentd0cd8c6cc7d1aaf38934996e7e5d3e03272e4ff1 (diff)
downloadcraftbukkit-df69047324abc54f5d5b8d069bb69b1061b20cce.tar
craftbukkit-df69047324abc54f5d5b8d069bb69b1061b20cce.tar.gz
craftbukkit-df69047324abc54f5d5b8d069bb69b1061b20cce.tar.lz
craftbukkit-df69047324abc54f5d5b8d069bb69b1061b20cce.tar.xz
craftbukkit-df69047324abc54f5d5b8d069bb69b1061b20cce.zip
Port to new mc-dev format.
Diffstat (limited to 'src/main/java/net/minecraft/server/BlockFurnace.java')
-rw-r--r--src/main/java/net/minecraft/server/BlockFurnace.java82
1 files changed, 40 insertions, 42 deletions
diff --git a/src/main/java/net/minecraft/server/BlockFurnace.java b/src/main/java/net/minecraft/server/BlockFurnace.java
index 34a13f81..728548ad 100644
--- a/src/main/java/net/minecraft/server/BlockFurnace.java
+++ b/src/main/java/net/minecraft/server/BlockFurnace.java
@@ -17,58 +17,52 @@ public class BlockFurnace extends BlockContainer {
private final boolean a;
protected BlockFurnace(int i, boolean flag) {
- super(i, Material.d);
- a = flag;
- bh = 45;
+ super(i, Material.STONE);
+ this.a = flag;
+ this.textureId = 45;
}
public int a(int i, Random random) {
- return Block.aB.bi;
+ return Block.FURNACE.id;
}
public void e(World world, int i, int j, int k) {
super.e(world, i, j, k);
- g(world, i, j, k);
+ this.g(world, i, j, k);
}
private void g(World world, int i, int j, int k) {
- int l = world.a(i, j, k - 1);
- int i1 = world.a(i, j, k + 1);
- int j1 = world.a(i - 1, j, k);
- int k1 = world.a(i + 1, j, k);
- byte byte0 = 3;
+ int l = world.getTypeId(i, j, k - 1);
+ int i1 = world.getTypeId(i, j, k + 1);
+ int j1 = world.getTypeId(i - 1, j, k);
+ int k1 = world.getTypeId(i + 1, j, k);
+ byte b0 = 3;
if (Block.o[l] && !Block.o[i1]) {
- byte0 = 3;
+ b0 = 3;
}
+
if (Block.o[i1] && !Block.o[l]) {
- byte0 = 2;
+ b0 = 2;
}
+
if (Block.o[j1] && !Block.o[k1]) {
- byte0 = 5;
+ b0 = 5;
}
+
if (Block.o[k1] && !Block.o[j1]) {
- byte0 = 4;
+ b0 = 4;
}
- world.c(i, j, k, ((int) (byte0)));
+
+ world.c(i, j, k, b0);
}
public int a(int i) {
- if (i == 1) {
- return bh + 17;
- }
- if (i == 0) {
- return bh + 17;
- }
- if (i == 3) {
- return bh - 1;
- } else {
- return bh;
- }
+ return i == 1 ? this.textureId + 17 : (i == 0 ? this.textureId + 17 : (i == 3 ? this.textureId - 1 : this.textureId));
}
- public boolean a(World world, int i, int j, int k, EntityPlayer entityplayer) {
- if (world.z) {
+ public boolean a(World world, int i, int j, int k, EntityHuman entityhuman) {
+ if (world.isStatic) {
return true;
} else {
// CraftBukkit start - Interact Furnace
@@ -76,52 +70,56 @@ public class BlockFurnace extends BlockContainer {
CraftServer server = ((WorldServer) world).getServer();
Type eventType = Type.BLOCK_INTERACT;
CraftBlock block = (CraftBlock) craftWorld.getBlockAt(i, j, k);
- LivingEntity who = (entityplayer == null)?null:(LivingEntity)entityplayer.getBukkitEntity();
-
- BlockInteractEvent bie = new BlockInteractEvent(eventType, block, who);
- server.getPluginManager().callEvent(bie);
+ LivingEntity who = (entityhuman == null) ? null : (LivingEntity) entityhuman.getBukkitEntity();
+
+ BlockInteractEvent event = new BlockInteractEvent(eventType, block, who);
+ server.getPluginManager().callEvent(event);
- if (bie.isCancelled()) {
+ if (event.isCancelled()) {
return true;
}
// CraftBukkit end
- TileEntityFurnace tileentityfurnace = (TileEntityFurnace) world.m(i, j, k);
+ TileEntityFurnace tileentityfurnace = (TileEntityFurnace) world.getTileEntity(i, j, k);
- entityplayer.a(tileentityfurnace);
+ entityhuman.a(tileentityfurnace);
return true;
}
}
public static void a(boolean flag, World world, int i, int j, int k) {
- int l = world.b(i, j, k);
- TileEntity tileentity = world.m(i, j, k);
+ int l = world.getData(i, j, k);
+ TileEntity tileentity = world.getTileEntity(i, j, k);
if (flag) {
- world.e(i, j, k, Block.aC.bi);
+ world.e(i, j, k, Block.BURNING_FURNACE.id);
} else {
- world.e(i, j, k, Block.aB.bi);
+ world.e(i, j, k, Block.FURNACE.id);
}
+
world.c(i, j, k, l);
- world.a(i, j, k, tileentity);
+ world.setTileEntity(i, j, k, tileentity);
}
protected TileEntity a_() {
- return ((TileEntity) (new TileEntityFurnace()));
+ return new TileEntityFurnace();
}
public void a(World world, int i, int j, int k, EntityLiving entityliving) {
- int l = MathHelper.b((double) ((entityliving.v * 4F) / 360F) + 0.5D) & 3;
+ int l = MathHelper.b((double) (entityliving.yaw * 4.0F / 360.0F) + 0.5D) & 3;
if (l == 0) {
world.c(i, j, k, 2);
}
+
if (l == 1) {
world.c(i, j, k, 5);
}
+
if (l == 2) {
world.c(i, j, k, 3);
}
+
if (l == 3) {
world.c(i, j, k, 4);
}