diff --git a/pom.xml b/pom.xml
index 28b90568b3..3a3d2f2c5b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -39,7 +39,7 @@
org.bukkit
minecraft-server
- 1.4
+ 1.4_00_01
jar
compile
@@ -47,36 +47,11 @@
net.sf.jopt-simple
jopt-simple
3.2
- jar
- compile
jline
jline
0.9.94
- jar
- compile
-
-
- org.xerial
- sqlite-jdbc
- 3.7.2
- jar
- compile
-
-
- mysql
- mysql-connector-java
- 5.1.14
- jar
- compile
-
-
- org.avaje
- ebean
- 2.7.3
- jar
- provided
@@ -149,13 +124,6 @@
shade
-
-
-
- junit:junit
-
-
-
diff --git a/src/main/java/net/minecraft/server/BlockBloodStone.java b/src/main/java/net/minecraft/server/BlockBloodStone.java
index 9b2c0bafa7..5148d3f59f 100644
--- a/src/main/java/net/minecraft/server/BlockBloodStone.java
+++ b/src/main/java/net/minecraft/server/BlockBloodStone.java
@@ -13,8 +13,8 @@ public class BlockBloodStone extends Block {
}
// Craftbukkit start
- public void a(World world, int i, int j, int k, int l) {
- if (net.minecraft.server.Block.byId[l] != null && net.minecraft.server.Block.byId[l].c()) {
+ public void doPhysics(World world, int i, int j, int k, int l) {
+ if (net.minecraft.server.Block.byId[l] != null && net.minecraft.server.Block.byId[l].isPowerSource()) {
CraftWorld craftWorld = ((WorldServer) world).getWorld();
CraftServer server = ((WorldServer) world).getServer();
org.bukkit.block.Block block = craftWorld.getBlockAt(i, j, k);
diff --git a/src/main/java/net/minecraft/server/BlockButton.java b/src/main/java/net/minecraft/server/BlockButton.java
index 9ed938e964..3a36bb9d1a 100644
--- a/src/main/java/net/minecraft/server/BlockButton.java
+++ b/src/main/java/net/minecraft/server/BlockButton.java
@@ -28,11 +28,11 @@ public class BlockButton extends Block {
return false;
}
- public boolean a(World world, int i, int j, int k) {
+ public boolean canPlace(World world, int i, int j, int k) {
return world.d(i - 1, j, k) ? true : (world.d(i + 1, j, k) ? true : (world.d(i, j, k - 1) ? true : world.d(i, j, k + 1)));
}
- public void d(World world, int i, int j, int k, int l) {
+ public void postPlace(World world, int i, int j, int k, int l) {
int i1 = world.getData(i, j, k);
int j1 = i1 & 8;
@@ -49,14 +49,14 @@ public class BlockButton extends Block {
i1 = this.g(world, i, j, k);
}
- world.c(i, j, k, i1 + j1);
+ world.setData(i, j, k, i1 + j1);
}
private int g(World world, int i, int j, int k) {
return world.d(i - 1, j, k) ? 1 : (world.d(i + 1, j, k) ? 2 : (world.d(i, j, k - 1) ? 3 : (world.d(i, j, k + 1) ? 4 : 1)));
}
- public void a(World world, int i, int j, int k, int l) {
+ public void doPhysics(World world, int i, int j, int k, int l) {
if (this.h(world, i, j, k)) {
int i1 = world.getData(i, j, k) & 7;
boolean flag = false;
@@ -79,15 +79,15 @@ public class BlockButton extends Block {
if (flag) {
this.a_(world, i, j, k, world.getData(i, j, k));
- world.e(i, j, k, 0);
+ world.setTypeId(i, j, k, 0);
}
}
}
private boolean h(World world, int i, int j, int k) {
- if (!this.a(world, i, j, k)) {
+ if (!this.canPlace(world, i, j, k)) {
this.a_(world, i, j, k, world.getData(i, j, k));
- world.e(i, j, k, 0);
+ world.setTypeId(i, j, k, 0);
return false;
} else {
return true;
@@ -119,10 +119,10 @@ public class BlockButton extends Block {
}
public void b(World world, int i, int j, int k, EntityHuman entityhuman) {
- this.a(world, i, j, k, entityhuman);
+ this.interact(world, i, j, k, entityhuman);
}
- public boolean a(World world, int i, int j, int k, EntityHuman entityhuman) {
+ public boolean interact(World world, int i, int j, int k, EntityHuman entityhuman) {
int l = world.getData(i, j, k);
int i1 = l & 7;
int j1 = 8 - (l & 8);
@@ -144,20 +144,20 @@ public class BlockButton extends Block {
}
// CraftBukkit end
- world.c(i, j, k, i1 + j1);
+ world.setData(i, j, k, i1 + j1);
world.b(i, j, k, i, j, k);
- world.a((double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D, "random.click", 0.3F, 0.6F);
- world.h(i, j, k, this.id);
+ world.makeSound((double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D, "random.click", 0.3F, 0.6F);
+ world.applyPhysics(i, j, k, this.id);
if (i1 == 1) {
- world.h(i - 1, j, k, this.id);
+ world.applyPhysics(i - 1, j, k, this.id);
} else if (i1 == 2) {
- world.h(i + 1, j, k, this.id);
+ world.applyPhysics(i + 1, j, k, this.id);
} else if (i1 == 3) {
- world.h(i, j, k - 1, this.id);
+ world.applyPhysics(i, j, k - 1, this.id);
} else if (i1 == 4) {
- world.h(i, j, k + 1, this.id);
+ world.applyPhysics(i, j, k + 1, this.id);
} else {
- world.h(i, j - 1, k, this.id);
+ world.applyPhysics(i, j - 1, k, this.id);
}
world.c(i, j, k, this.id, this.b());
@@ -165,27 +165,27 @@ public class BlockButton extends Block {
}
}
- public void b(World world, int i, int j, int k) {
+ public void remove(World world, int i, int j, int k) {
int l = world.getData(i, j, k);
if ((l & 8) > 0) {
- world.h(i, j, k, this.id);
+ world.applyPhysics(i, j, k, this.id);
int i1 = l & 7;
if (i1 == 1) {
- world.h(i - 1, j, k, this.id);
+ world.applyPhysics(i - 1, j, k, this.id);
} else if (i1 == 2) {
- world.h(i + 1, j, k, this.id);
+ world.applyPhysics(i + 1, j, k, this.id);
} else if (i1 == 3) {
- world.h(i, j, k - 1, this.id);
+ world.applyPhysics(i, j, k - 1, this.id);
} else if (i1 == 4) {
- world.h(i, j, k + 1, this.id);
+ world.applyPhysics(i, j, k + 1, this.id);
} else {
- world.h(i, j - 1, k, this.id);
+ world.applyPhysics(i, j - 1, k, this.id);
}
}
- super.b(world, i, j, k);
+ super.remove(world, i, j, k);
}
public boolean b(IBlockAccess iblockaccess, int i, int j, int k, int l) {
@@ -204,7 +204,7 @@ public class BlockButton extends Block {
}
}
- public boolean c() {
+ public boolean isPowerSource() {
return true;
}
@@ -217,28 +217,30 @@ public class BlockButton extends Block {
CraftWorld craftWorld = ((WorldServer) world).getWorld();
CraftServer server = ((WorldServer) world).getServer();
CraftBlock block = (CraftBlock) craftWorld.getBlockAt(i, j, k);
+
BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(block, 1, 0);
server.getPluginManager().callEvent(eventRedstone);
+
if (eventRedstone.getNewCurrent() > 0) return;
// CraftBukkit end
- world.c(i, j, k, l & 7);
- world.h(i, j, k, this.id);
+ world.setData(i, j, k, l & 7);
+ world.applyPhysics(i, j, k, this.id);
int i1 = l & 7;
if (i1 == 1) {
- world.h(i - 1, j, k, this.id);
+ world.applyPhysics(i - 1, j, k, this.id);
} else if (i1 == 2) {
- world.h(i + 1, j, k, this.id);
+ world.applyPhysics(i + 1, j, k, this.id);
} else if (i1 == 3) {
- world.h(i, j, k - 1, this.id);
+ world.applyPhysics(i, j, k - 1, this.id);
} else if (i1 == 4) {
- world.h(i, j, k + 1, this.id);
+ world.applyPhysics(i, j, k + 1, this.id);
} else {
- world.h(i, j - 1, k, this.id);
+ world.applyPhysics(i, j - 1, k, this.id);
}
- world.a((double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D, "random.click", 0.3F, 0.5F);
+ world.makeSound((double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D, "random.click", 0.3F, 0.5F);
world.b(i, j, k, i, j, k);
}
}
diff --git a/src/main/java/net/minecraft/server/BlockCactus.java b/src/main/java/net/minecraft/server/BlockCactus.java
index 90aab767fa..c187615e53 100644
--- a/src/main/java/net/minecraft/server/BlockCactus.java
+++ b/src/main/java/net/minecraft/server/BlockCactus.java
@@ -28,10 +28,10 @@ public class BlockCactus extends Block {
int i1 = world.getData(i, j, k);
if (i1 == 15) {
- world.e(i, j + 1, k, this.id);
- world.c(i, j, k, 0);
+ world.setTypeId(i, j + 1, k, this.id);
+ world.setData(i, j, k, 0);
} else {
- world.c(i, j, k, i1 + 1);
+ world.setData(i, j, k, i1 + 1);
}
}
}
@@ -51,14 +51,14 @@ public class BlockCactus extends Block {
return false;
}
- public boolean a(World world, int i, int j, int k) {
- return !super.a(world, i, j, k) ? false : this.f(world, i, j, k);
+ public boolean canPlace(World world, int i, int j, int k) {
+ return !super.canPlace(world, i, j, k) ? false : this.f(world, i, j, k);
}
- public void a(World world, int i, int j, int k, int l) {
+ public void doPhysics(World world, int i, int j, int k, int l) {
if (!this.f(world, i, j, k)) {
this.a_(world, i, j, k, world.getData(i, j, k));
- world.e(i, j, k, 0);
+ world.setTypeId(i, j, k, 0);
}
}
@@ -91,11 +91,11 @@ public class BlockCactus extends Block {
server.getPluginManager().callEvent(event);
if (!event.isCancelled()) {
- entity.a((Entity) null, event.getDamage());
+ entity.damageEntity((Entity) null, event.getDamage());
}
return;
}
// CraftBukkit end
- entity.a((Entity) null, 1);
+ entity.damageEntity((Entity) null, 1);
}
}
diff --git a/src/main/java/net/minecraft/server/BlockDispenser.java b/src/main/java/net/minecraft/server/BlockDispenser.java
index 24abbf9ff4..9adce396aa 100644
--- a/src/main/java/net/minecraft/server/BlockDispenser.java
+++ b/src/main/java/net/minecraft/server/BlockDispenser.java
@@ -45,14 +45,14 @@ public class BlockDispenser extends BlockContainer {
b0 = 4;
}
- world.c(i, j, k, b0);
+ world.setData(i, j, k, b0);
}
public int a(int i) {
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, EntityHuman entityhuman) {
+ public boolean interact(World world, int i, int j, int k, EntityHuman entityhuman) {
if (world.isStatic) {
return true;
} else {
@@ -64,7 +64,7 @@ public class BlockDispenser extends BlockContainer {
}
// CraftBukkit - private->public
- public void b(World world, int i, int j, int k, Random random) {
+ public void dispense(World world, int i, int j, int k, Random random) {
int l = world.getData(i, j, k);
float f = 0.0F;
float f1 = 0.0F;
@@ -86,7 +86,7 @@ public class BlockDispenser extends BlockContainer {
double d2 = (double) k + (double) f1 * 0.5D + 0.5D;
if (itemstack == null) {
- world.a((double) i, (double) j, (double) k, "random.click", 1.0F, 1.2F);
+ world.makeSound((double) i, (double) j, (double) k, "random.click", 1.0F, 1.2F);
} else {
double d3;
@@ -94,20 +94,20 @@ public class BlockDispenser extends BlockContainer {
EntityArrow entityarrow = new EntityArrow(world, d0, d1, d2);
entityarrow.a((double) f, 0.10000000149011612D, (double) f1, 1.1F, 6.0F);
- world.a((Entity) entityarrow);
- world.a((double) i, (double) j, (double) k, "random.bow", 1.0F, 1.2F);
+ world.addEntity(entityarrow);
+ world.makeSound((double) i, (double) j, (double) k, "random.bow", 1.0F, 1.2F);
} else if (itemstack.id == Item.EGG.id) {
EntityEgg entityegg = new EntityEgg(world, d0, d1, d2);
entityegg.a((double) f, 0.10000000149011612D, (double) f1, 1.1F, 6.0F);
- world.a((Entity) entityegg);
- world.a((double) i, (double) j, (double) k, "random.bow", 1.0F, 1.2F);
+ world.addEntity(entityegg);
+ world.makeSound((double) i, (double) j, (double) k, "random.bow", 1.0F, 1.2F);
} else if (itemstack.id == Item.SNOW_BALL.id) {
EntitySnowball entitysnowball = new EntitySnowball(world, d0, d1, d2);
entitysnowball.a((double) f, 0.10000000149011612D, (double) f1, 1.1F, 6.0F);
- world.a((Entity) entitysnowball);
- world.a((double) i, (double) j, (double) k, "random.bow", 1.0F, 1.2F);
+ world.addEntity(entitysnowball);
+ world.makeSound((double) i, (double) j, (double) k, "random.bow", 1.0F, 1.2F);
} else {
EntityItem entityitem = new EntityItem(world, d0, d1 - 0.3D, d2, itemstack);
@@ -118,8 +118,8 @@ public class BlockDispenser extends BlockContainer {
entityitem.motX += random.nextGaussian() * 0.007499999832361937D * 6.0D;
entityitem.motY += random.nextGaussian() * 0.007499999832361937D * 6.0D;
entityitem.motZ += random.nextGaussian() * 0.007499999832361937D * 6.0D;
- world.a((Entity) entityitem);
- world.a((double) i, (double) j, (double) k, "random.click", 1.0F, 1.0F);
+ world.addEntity(entityitem);
+ world.makeSound((double) i, (double) j, (double) k, "random.click", 1.0F, 1.0F);
}
for (int i1 = 0; i1 < 10; ++i1) {
@@ -136,9 +136,9 @@ public class BlockDispenser extends BlockContainer {
}
}
- public void a(World world, int i, int j, int k, int l) {
- if (l > 0 && Block.byId[l].c()) {
- boolean flag = world.p(i, j, k) || world.p(i, j + 1, k);
+ public void doPhysics(World world, int i, int j, int k, int l) {
+ if (l > 0 && Block.byId[l].isPowerSource()) {
+ boolean flag = world.isBlockIndirectlyPowered(i, j, k) || world.isBlockIndirectlyPowered(i, j + 1, k);
if (flag) {
world.c(i, j, k, this.id, this.b());
@@ -147,8 +147,8 @@ public class BlockDispenser extends BlockContainer {
}
public void a(World world, int i, int j, int k, Random random) {
- if (world.p(i, j, k) || world.p(i, j + 1, k)) {
- this.b(world, i, j, k, random);
+ if (world.isBlockIndirectlyPowered(i, j, k) || world.isBlockIndirectlyPowered(i, j + 1, k)) {
+ this.dispense(world, i, j, k, random);
}
}
@@ -156,23 +156,23 @@ public class BlockDispenser extends BlockContainer {
return new TileEntityDispenser();
}
- public void a(World world, int i, int j, int k, EntityLiving entityliving) {
- int l = MathHelper.b((double) (entityliving.yaw * 4.0F / 360.0F) + 0.5D) & 3;
+ public void postPlace(World world, int i, int j, int k, EntityLiving entityliving) {
+ int l = MathHelper.floor((double) (entityliving.yaw * 4.0F / 360.0F) + 0.5D) & 3;
if (l == 0) {
- world.c(i, j, k, 2);
+ world.setData(i, j, k, 2);
}
if (l == 1) {
- world.c(i, j, k, 5);
+ world.setData(i, j, k, 5);
}
if (l == 2) {
- world.c(i, j, k, 3);
+ world.setData(i, j, k, 3);
}
if (l == 3) {
- world.c(i, j, k, 4);
+ world.setData(i, j, k, 4);
}
}
}
diff --git a/src/main/java/net/minecraft/server/BlockDoor.java b/src/main/java/net/minecraft/server/BlockDoor.java
index fea5066040..6a1f8342be 100644
--- a/src/main/java/net/minecraft/server/BlockDoor.java
+++ b/src/main/java/net/minecraft/server/BlockDoor.java
@@ -51,7 +51,7 @@ public class BlockDoor extends Block {
}
public AxisAlignedBB d(World world, int i, int j, int k) {
- this.a((IBlockAccess) world, i, j, k);
+ this.a(world, i, j, k);
return super.d(world, i, j, k);
}
@@ -81,10 +81,10 @@ public class BlockDoor extends Block {
}
public void b(World world, int i, int j, int k, EntityHuman entityhuman) {
- this.a(world, i, j, k, entityhuman);
+ this.interact(world, i, j, k, entityhuman);
}
- public boolean a(World world, int i, int j, int k, EntityHuman entityhuman) {
+ public boolean interact(World world, int i, int j, int k, EntityHuman entityhuman) {
if (this.material == Material.ORE) {
return true;
} else {
@@ -92,21 +92,21 @@ public class BlockDoor extends Block {
if ((l & 8) != 0) {
if (world.getTypeId(i, j - 1, k) == this.id) {
- this.a(world, i, j - 1, k, entityhuman);
+ this.interact(world, i, j - 1, k, entityhuman);
}
return true;
} else {
if (world.getTypeId(i, j + 1, k) == this.id) {
- world.c(i, j + 1, k, (l ^ 4) + 8);
+ world.setData(i, j + 1, k, (l ^ 4) + 8);
}
- world.c(i, j, k, l ^ 4);
+ world.setData(i, j, k, l ^ 4);
world.b(i, j - 1, k, i, j, k);
if (Math.random() < 0.5D) {
- world.a((double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D, "random.door_open", 1.0F, world.k.nextFloat() * 0.1F + 0.9F);
+ world.makeSound((double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D, "random.door_open", 1.0F, world.random.nextFloat() * 0.1F + 0.9F);
} else {
- world.a((double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D, "random.door_close", 1.0F, world.k.nextFloat() * 0.1F + 0.9F);
+ world.makeSound((double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D, "random.door_close", 1.0F, world.random.nextFloat() * 0.1F + 0.9F);
}
return true;
@@ -114,56 +114,56 @@ public class BlockDoor extends Block {
}
}
- public void a(World world, int i, int j, int k, boolean flag) {
+ public void setDoor(World world, int i, int j, int k, boolean flag) {
int l = world.getData(i, j, k);
if ((l & 8) != 0) {
if (world.getTypeId(i, j - 1, k) == this.id) {
- this.a(world, i, j - 1, k, flag);
+ this.setDoor(world, i, j - 1, k, flag);
}
} else {
boolean flag1 = (world.getData(i, j, k) & 4) > 0;
if (flag1 != flag) {
if (world.getTypeId(i, j + 1, k) == this.id) {
- world.c(i, j + 1, k, (l ^ 4) + 8);
+ world.setData(i, j + 1, k, (l ^ 4) + 8);
}
- world.c(i, j, k, l ^ 4);
+ world.setData(i, j, k, l ^ 4);
world.b(i, j - 1, k, i, j, k);
if (Math.random() < 0.5D) {
- world.a((double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D, "random.door_open", 1.0F, world.k.nextFloat() * 0.1F + 0.9F);
+ world.makeSound((double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D, "random.door_open", 1.0F, world.random.nextFloat() * 0.1F + 0.9F);
} else {
- world.a((double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D, "random.door_close", 1.0F, world.k.nextFloat() * 0.1F + 0.9F);
+ world.makeSound((double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D, "random.door_close", 1.0F, world.random.nextFloat() * 0.1F + 0.9F);
}
}
}
}
- public void a(World world, int i, int j, int k, int l) {
+ public void doPhysics(World world, int i, int j, int k, int l) {
int i1 = world.getData(i, j, k);
if ((i1 & 8) != 0) {
if (world.getTypeId(i, j - 1, k) != this.id) {
- world.e(i, j, k, 0);
+ world.setTypeId(i, j, k, 0);
}
- if (l > 0 && Block.byId[l].c()) {
- this.a(world, i, j - 1, k, l);
+ if (l > 0 && Block.byId[l].isPowerSource()) {
+ this.doPhysics(world, i, j - 1, k, l);
}
} else {
boolean flag = false;
if (world.getTypeId(i, j + 1, k) != this.id) {
- world.e(i, j, k, 0);
+ world.setTypeId(i, j, k, 0);
flag = true;
}
if (!world.d(i, j - 1, k)) {
- world.e(i, j, k, 0);
+ world.setTypeId(i, j, k, 0);
flag = true;
if (world.getTypeId(i, j + 1, k) == this.id) {
- world.e(i, j + 1, k, 0);
+ world.setTypeId(i, j + 1, k, 0);
}
}
@@ -171,8 +171,8 @@ public class BlockDoor extends Block {
if (!world.isStatic) {
this.a_(world, i, j, k, i1);
}
- } else if (l > 0 && Block.byId[l].c()) {
- boolean flag1 = world.p(i, j, k) || world.p(i, j + 1, k);
+ } else if (l > 0 && Block.byId[l].isPowerSource()) {
+ boolean flag1 = world.isBlockIndirectlyPowered(i, j, k) || world.isBlockIndirectlyPowered(i, j + 1, k);
// Craftbukkit start
CraftWorld craftWorld = ((WorldServer) world).getWorld();
@@ -185,8 +185,11 @@ public class BlockDoor extends Block {
BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(block, (world.getData(i, j, k) & 4) > 0 ? 15: 0, power);
server.getPluginManager().callEvent(eventRedstone);
- this.a(world, i, j, k, eventRedstone.getNewCurrent() > 0);
+
+ flag1 = eventRedstone.getNewCurrent() > 0;
// Craftbukkit end
+
+ this.setDoor(world, i, j, k, flag1);
}
}
}
@@ -196,7 +199,7 @@ public class BlockDoor extends Block {
}
public MovingObjectPosition a(World world, int i, int j, int k, Vec3D vec3d, Vec3D vec3d1) {
- this.a((IBlockAccess) world, i, j, k);
+ this.a(world, i, j, k);
return super.a(world, i, j, k, vec3d, vec3d1);
}
@@ -204,7 +207,7 @@ public class BlockDoor extends Block {
return (i & 4) == 0 ? i - 1 & 3 : i & 3;
}
- public boolean a(World world, int i, int j, int k) {
- return j >= 127 ? false : world.d(i, j - 1, k) && super.a(world, i, j, k) && super.a(world, i, j + 1, k);
+ public boolean canPlace(World world, int i, int j, int k) {
+ return j >= 127 ? false : world.d(i, j - 1, k) && super.canPlace(world, i, j, k) && super.canPlace(world, i, j + 1, k);
}
}
diff --git a/src/main/java/net/minecraft/server/BlockFire.java b/src/main/java/net/minecraft/server/BlockFire.java
index b3cfc9e8ba..aed5742272 100644
--- a/src/main/java/net/minecraft/server/BlockFire.java
+++ b/src/main/java/net/minecraft/server/BlockFire.java
@@ -53,17 +53,16 @@ public class BlockFire extends Block {
int l = world.getData(i, j, k);
if (l < 15) {
- world.c(i, j, k, l + 1);
+ world.setData(i, j, k, l + 1);
world.c(i, j, k, this.id, this.b());
}
if (!flag && !this.g(world, i, j, k)) {
if (!world.d(i, j - 1, k) || l > 3) {
- world.e(i, j, k, 0);
+ world.setTypeId(i, j, k, 0);
}
- // CraftBukkit - Cast to IBlockAccess
- } else if (!flag && !this.b((IBlockAccess) world, i, j - 1, k) && l == 15 && random.nextInt(4) == 0) {
- world.e(i, j, k, 0);
+ } else if (!flag && !this.b(world, i, j - 1, k) && l == 15 && random.nextInt(4) == 0) {
+ world.setTypeId(i, j, k, 0);
} else {
if (l % 2 == 0 && l > 2) {
this.a(world, i + 1, j, k, 300, random);
@@ -106,7 +105,7 @@ public class BlockFire extends Block {
}
// CraftBukkit end
- world.e(i1, k1, j1, this.id);
+ world.setTypeId(i1, k1, j1, this.id);
}
}
}
@@ -142,21 +141,18 @@ public class BlockFire extends Block {
// CraftBukkit end
if (random.nextInt(2) == 0) {
- world.e(i, j, k, this.id);
+ world.setTypeId(i, j, k, this.id);
} else {
- world.e(i, j, k, 0);
+ world.setTypeId(i, j, k, 0);
}
if (flag) {
- Block.TNT.b(world, i, j, k, 0);
+ Block.TNT.postBreak(world, i, j, k, 0);
}
}
}
- // CraftBukkit start -- fix cast to IBlockAccess
- private boolean g(World world1, int i, int j, int k) {
- IBlockAccess world = (IBlockAccess) world1;
- // CraftBukkit end
+ private boolean g(World world, int i, int j, int k) {
return this.b(world, i + 1, j, k) ? true : (this.b(world, i - 1, j, k) ? true : (this.b(world, i, j - 1, k) ? true : (this.b(world, i, j + 1, k) ? true : (this.b(world, i, j, k - 1) ? true : this.b(world, i, j, k + 1)))));
}
@@ -191,20 +187,20 @@ public class BlockFire extends Block {
return i1 > l ? i1 : l;
}
- public boolean a(World world, int i, int j, int k) {
+ public boolean canPlace(World world, int i, int j, int k) {
return world.d(i, j - 1, k) || this.g(world, i, j, k);
}
- public void a(World world, int i, int j, int k, int l) {
+ public void doPhysics(World world, int i, int j, int k, int l) {
if (!world.d(i, j - 1, k) && !this.g(world, i, j, k)) {
- world.e(i, j, k, 0);
+ world.setTypeId(i, j, k, 0);
}
}
public void e(World world, int i, int j, int k) {
if (world.getTypeId(i, j - 1, k) != Block.OBSIDIAN.id || !Block.PORTAL.a_(world, i, j, k)) {
if (!world.d(i, j - 1, k) && !this.g(world, i, j, k)) {
- world.e(i, j, k, 0);
+ world.setTypeId(i, j, k, 0);
} else {
world.c(i, j, k, this.id, this.b());
}
diff --git a/src/main/java/net/minecraft/server/BlockFlowing.java b/src/main/java/net/minecraft/server/BlockFlowing.java
index c7d78b9b11..9848abad23 100644
--- a/src/main/java/net/minecraft/server/BlockFlowing.java
+++ b/src/main/java/net/minecraft/server/BlockFlowing.java
@@ -23,9 +23,9 @@ public class BlockFlowing extends BlockFluids {
private void i(World world, int i, int j, int k) {
int l = world.getData(i, j, k);
- world.setTypeIdAndData(i, j, k, this.id + 1, l);
+ world.setRawTypeIdAndData(i, j, k, this.id + 1, l);
world.b(i, j, k, i, j, k);
- world.g(i, j, k);
+ world.notify(i, j, k);
}
public void a(World world, int i, int j, int k, Random random) {
@@ -38,7 +38,7 @@ public class BlockFlowing extends BlockFluids {
int l = this.g(world, i, j, k);
byte b0 = 1;
- if (this.material == Material.LAVA && !world.m.d) {
+ if (this.material == Material.LAVA && !world.worldProvider.d) {
b0 = 2;
}
@@ -85,11 +85,11 @@ public class BlockFlowing extends BlockFluids {
if (i1 != l) {
l = i1;
if (i1 < 0) {
- world.e(i, j, k, 0);
+ world.setTypeId(i, j, k, 0);
} else {
- world.c(i, j, k, i1);
+ world.setData(i, j, k, i1);
world.c(i, j, k, this.id, this.b());
- world.h(i, j, k, this.id);
+ world.applyPhysics(i, j, k, this.id);
}
} else if (flag) {
this.i(world, i, j, k);
@@ -107,9 +107,9 @@ public class BlockFlowing extends BlockFluids {
if (!event.isCancelled()) {
if (l >= 8) {
- world.b(i, j - 1, k, this.id, l);
+ world.setTypeIdAndData(i, j - 1, k, this.id, l);
} else {
- world.b(i, j - 1, k, this.id, l + 8);
+ world.setTypeIdAndData(i, j - 1, k, this.id, l + 8);
}
}
// CraftBukkit end
@@ -137,7 +137,7 @@ public class BlockFlowing extends BlockFluids {
}
if (!event.isCancelled()) {
- this.f(world, i + currentFace.getModX(), j, k + currentFace.getModZ(), i1);
+ this.flow(world, i + currentFace.getModX(), j, k + currentFace.getModZ(), i1);
}
}
index++;
@@ -146,7 +146,7 @@ public class BlockFlowing extends BlockFluids {
}
}
- private void f(World world, int i, int j, int k, int l) {
+ private void flow(World world, int i, int j, int k, int l) {
if (this.l(world, i, j, k)) {
int i1 = world.getTypeId(i, j, k);
@@ -158,7 +158,7 @@ public class BlockFlowing extends BlockFluids {
}
}
- world.b(i, j, k, this.id, l);
+ world.setTypeIdAndData(i, j, k, this.id, l);
}
}
diff --git a/src/main/java/net/minecraft/server/BlockLeaves.java b/src/main/java/net/minecraft/server/BlockLeaves.java
index bd1a330d5b..05a45eb3a4 100644
--- a/src/main/java/net/minecraft/server/BlockLeaves.java
+++ b/src/main/java/net/minecraft/server/BlockLeaves.java
@@ -19,7 +19,7 @@ public class BlockLeaves extends BlockLeavesBase {
this.a(true);
}
- public void b(World world, int i, int j, int k) {
+ public void remove(World world, int i, int j, int k) {
byte b0 = 1;
int l = b0 + 1;
@@ -32,7 +32,7 @@ public class BlockLeaves extends BlockLeavesBase {
if (l1 == Block.LEAVES.id) {
int i2 = world.getData(i + i1, j + j1, k + k1);
- world.d(i + i1, j + j1, k + k1, i2 | 4);
+ world.setRawData(i + i1, j + j1, k + k1, i2 | 4);
}
}
}
@@ -114,7 +114,7 @@ public class BlockLeaves extends BlockLeavesBase {
l1 = this.a[k1 * j1 + k1 * b1 + k1];
if (l1 >= 0) {
- world.c(i, j, k, l & -5);
+ world.setData(i, j, k, l & -5);
} else {
this.g(world, i, j, k);
}
@@ -133,7 +133,7 @@ public class BlockLeaves extends BlockLeavesBase {
// CraftBukkit end
this.a_(world, i, j, k, world.getData(i, j, k));
- world.e(i, j, k, 0);
+ world.setTypeId(i, j, k, 0);
}
public int a(Random random) {
diff --git a/src/main/java/net/minecraft/server/BlockLever.java b/src/main/java/net/minecraft/server/BlockLever.java
index 71b8def732..aee41afa01 100644
--- a/src/main/java/net/minecraft/server/BlockLever.java
+++ b/src/main/java/net/minecraft/server/BlockLever.java
@@ -21,17 +21,17 @@ public class BlockLever extends Block {
return false;
}
- public boolean a(World world, int i, int j, int k) {
+ public boolean canPlace(World world, int i, int j, int k) {
return world.d(i - 1, j, k) ? true : (world.d(i + 1, j, k) ? true : (world.d(i, j, k - 1) ? true : (world.d(i, j, k + 1) ? true : world.d(i, j - 1, k))));
}
- public void d(World world, int i, int j, int k, int l) {
+ public void postPlace(World world, int i, int j, int k, int l) {
int i1 = world.getData(i, j, k);
int j1 = i1 & 8;
i1 &= 7;
if (l == 1 && world.d(i, j - 1, k)) {
- i1 = 5 + world.k.nextInt(2);
+ i1 = 5 + world.random.nextInt(2);
}
if (l == 2 && world.d(i, j, k + 1)) {
@@ -50,10 +50,10 @@ public class BlockLever extends Block {
i1 = 1;
}
- world.c(i, j, k, i1 + j1);
+ world.setData(i, j, k, i1 + j1);
}
- public void a(World world, int i, int j, int k, int l) {
+ public void doPhysics(World world, int i, int j, int k, int l) {
if (this.g(world, i, j, k)) {
int i1 = world.getData(i, j, k) & 7;
boolean flag = false;
@@ -80,15 +80,15 @@ public class BlockLever extends Block {
if (flag) {
this.a_(world, i, j, k, world.getData(i, j, k));
- world.e(i, j, k, 0);
+ world.setTypeId(i, j, k, 0);
}
}
}
private boolean g(World world, int i, int j, int k) {
- if (!this.a(world, i, j, k)) {
+ if (!this.canPlace(world, i, j, k)) {
this.a_(world, i, j, k, world.getData(i, j, k));
- world.e(i, j, k, 0);
+ world.setTypeId(i, j, k, 0);
return false;
} else {
return true;
@@ -114,10 +114,10 @@ public class BlockLever extends Block {
}
public void b(World world, int i, int j, int k, EntityHuman entityhuman) {
- this.a(world, i, j, k, entityhuman);
+ this.interact(world, i, j, k, entityhuman);
}
- public boolean a(World world, int i, int j, int k, EntityHuman entityhuman) {
+ public boolean interact(World world, int i, int j, int k, EntityHuman entityhuman) {
if (world.isStatic) {
return true;
} else {
@@ -140,47 +140,47 @@ public class BlockLever extends Block {
}
// CraftBukkit end
- world.c(i, j, k, i1 + j1);
+ world.setData(i, j, k, i1 + j1);
world.b(i, j, k, i, j, k);
- world.a((double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D, "random.click", 0.3F, j1 > 0 ? 0.6F : 0.5F);
- world.h(i, j, k, this.id);
+ world.makeSound((double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D, "random.click", 0.3F, j1 > 0 ? 0.6F : 0.5F);
+ world.applyPhysics(i, j, k, this.id);
if (i1 == 1) {
- world.h(i - 1, j, k, this.id);
+ world.applyPhysics(i - 1, j, k, this.id);
} else if (i1 == 2) {
- world.h(i + 1, j, k, this.id);
+ world.applyPhysics(i + 1, j, k, this.id);
} else if (i1 == 3) {
- world.h(i, j, k - 1, this.id);
+ world.applyPhysics(i, j, k - 1, this.id);
} else if (i1 == 4) {
- world.h(i, j, k + 1, this.id);
+ world.applyPhysics(i, j, k + 1, this.id);
} else {
- world.h(i, j - 1, k, this.id);
+ world.applyPhysics(i, j - 1, k, this.id);
}
return true;
}
}
- public void b(World world, int i, int j, int k) {
+ public void remove(World world, int i, int j, int k) {
int l = world.getData(i, j, k);
if ((l & 8) > 0) {
- world.h(i, j, k, this.id);
+ world.applyPhysics(i, j, k, this.id);
int i1 = l & 7;
if (i1 == 1) {
- world.h(i - 1, j, k, this.id);
+ world.applyPhysics(i - 1, j, k, this.id);
} else if (i1 == 2) {
- world.h(i + 1, j, k, this.id);
+ world.applyPhysics(i + 1, j, k, this.id);
} else if (i1 == 3) {
- world.h(i, j, k - 1, this.id);
+ world.applyPhysics(i, j, k - 1, this.id);
} else if (i1 == 4) {
- world.h(i, j, k + 1, this.id);
+ world.applyPhysics(i, j, k + 1, this.id);
} else {
- world.h(i, j - 1, k, this.id);
+ world.applyPhysics(i, j - 1, k, this.id);
}
}
- super.b(world, i, j, k);
+ super.remove(world, i, j, k);
}
public boolean b(IBlockAccess iblockaccess, int i, int j, int k, int l) {
@@ -199,7 +199,7 @@ public class BlockLever extends Block {
}
}
- public boolean c() {
+ public boolean isPowerSource() {
return true;
}
}
diff --git a/src/main/java/net/minecraft/server/BlockPressurePlate.java b/src/main/java/net/minecraft/server/BlockPressurePlate.java
index b48bb22bfe..44efad96f8 100644
--- a/src/main/java/net/minecraft/server/BlockPressurePlate.java
+++ b/src/main/java/net/minecraft/server/BlockPressurePlate.java
@@ -40,13 +40,13 @@ public class BlockPressurePlate extends Block {
return false;
}
- public boolean a(World world, int i, int j, int k) {
+ public boolean canPlace(World world, int i, int j, int k) {
return world.d(i, j - 1, k);
}
public void e(World world, int i, int j, int k) {}
- public void a(World world, int i, int j, int k, int l) {
+ public void doPhysics(World world, int i, int j, int k, int l) {
boolean flag = false;
if (!world.d(i, j - 1, k)) {
@@ -55,7 +55,7 @@ public class BlockPressurePlate extends Block {
if (flag) {
this.a_(world, i, j, k, world.getData(i, j, k));
- world.e(i, j, k, 0);
+ world.setTypeId(i, j, k, 0);
}
}
@@ -129,19 +129,19 @@ public class BlockPressurePlate extends Block {
// CraftBukkit end
if (flag1 && !flag) {
- world.c(i, j, k, 1);
- world.h(i, j, k, this.id);
- world.h(i, j - 1, k, this.id);
+ world.setData(i, j, k, 1);
+ world.applyPhysics(i, j, k, this.id);
+ world.applyPhysics(i, j - 1, k, this.id);
world.b(i, j, k, i, j, k);
- world.a((double) i + 0.5D, (double) j + 0.1D, (double) k + 0.5D, "random.click", 0.3F, 0.6F);
+ world.makeSound((double) i + 0.5D, (double) j + 0.1D, (double) k + 0.5D, "random.click", 0.3F, 0.6F);
}
if (!flag1 && flag) {
- world.c(i, j, k, 0);
- world.h(i, j, k, this.id);
- world.h(i, j - 1, k, this.id);
+ world.setData(i, j, k, 0);
+ world.applyPhysics(i, j, k, this.id);
+ world.applyPhysics(i, j - 1, k, this.id);
world.b(i, j, k, i, j, k);
- world.a((double) i + 0.5D, (double) j + 0.1D, (double) k + 0.5D, "random.click", 0.3F, 0.5F);
+ world.makeSound((double) i + 0.5D, (double) j + 0.1D, (double) k + 0.5D, "random.click", 0.3F, 0.5F);
}
if (flag1) {
@@ -149,15 +149,15 @@ public class BlockPressurePlate extends Block {
}
}
- public void b(World world, int i, int j, int k) {
+ public void remove(World world, int i, int j, int k) {
int l = world.getData(i, j, k);
if (l > 0) {
- world.h(i, j, k, this.id);
- world.h(i, j - 1, k, this.id);
+ world.applyPhysics(i, j, k, this.id);
+ world.applyPhysics(i, j - 1, k, this.id);
}
- super.b(world, i, j, k);
+ super.remove(world, i, j, k);
}
public void a(IBlockAccess iblockaccess, int i, int j, int k) {
@@ -179,7 +179,7 @@ public class BlockPressurePlate extends Block {
return world.getData(i, j, k) == 0 ? false : l == 1;
}
- public boolean c() {
+ public boolean isPowerSource() {
return true;
}
}
diff --git a/src/main/java/net/minecraft/server/BlockPumpkin.java b/src/main/java/net/minecraft/server/BlockPumpkin.java
index 0de996b4c5..ccec76bab8 100644
--- a/src/main/java/net/minecraft/server/BlockPumpkin.java
+++ b/src/main/java/net/minecraft/server/BlockPumpkin.java
@@ -1,10 +1,8 @@
package net.minecraft.server;
-// CraftBukkit start
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.event.block.BlockRedstoneEvent;
-// CraftBukkit end
public class BlockPumpkin extends Block {
@@ -41,21 +39,21 @@ public class BlockPumpkin extends Block {
super.e(world, i, j, k);
}
- public boolean a(World world, int i, int j, int k) {
+ public boolean canPlace(World world, int i, int j, int k) {
int l = world.getTypeId(i, j, k);
return (l == 0 || Block.byId[l].material.isLiquid()) && world.d(i, j - 1, k);
}
- public void a(World world, int i, int j, int k, EntityLiving entityliving) {
- int l = MathHelper.b((double) (entityliving.yaw * 4.0F / 360.0F) + 0.5D) & 3;
+ public void postPlace(World world, int i, int j, int k, EntityLiving entityliving) {
+ int l = MathHelper.floor((double) (entityliving.yaw * 4.0F / 360.0F) + 0.5D) & 3;
- world.c(i, j, k, l);
+ world.setData(i, j, k, l);
}
// Craftbukkit start
- public void a(World world, int i, int j, int k, int l) {
- if (net.minecraft.server.Block.byId[l] != null && net.minecraft.server.Block.byId[l].c()) {
+ public void doPhysics(World world, int i, int j, int k, int l) {
+ if (net.minecraft.server.Block.byId[l] != null && net.minecraft.server.Block.byId[l].isPowerSource()) {
CraftWorld craftWorld = ((WorldServer) world).getWorld();
CraftServer server = ((WorldServer) world).getServer();
org.bukkit.block.Block block = craftWorld.getBlockAt(i, j, k);
diff --git a/src/main/java/net/minecraft/server/BlockRedstoneTorch.java b/src/main/java/net/minecraft/server/BlockRedstoneTorch.java
index 35b458410d..dadad29386 100644
--- a/src/main/java/net/minecraft/server/BlockRedstoneTorch.java
+++ b/src/main/java/net/minecraft/server/BlockRedstoneTorch.java
@@ -12,7 +12,7 @@ import org.bukkit.plugin.PluginManager;
public class BlockRedstoneTorch extends BlockTorch {
- private boolean a = false;
+ private boolean isOn = false;
private static List b = new ArrayList();
public int a(int i, int j) {
@@ -21,7 +21,7 @@ public class BlockRedstoneTorch extends BlockTorch {
private boolean a(World world, int i, int j, int k, boolean flag) {
if (flag) {
- b.add(new RedstoneUpdateInfo(i, j, k, world.l()));
+ b.add(new RedstoneUpdateInfo(i, j, k, world.getTime()));
}
int l = 0;
@@ -42,7 +42,7 @@ public class BlockRedstoneTorch extends BlockTorch {
protected BlockRedstoneTorch(int i, int j, boolean flag) {
super(i, j);
- this.a = flag;
+ this.isOn = flag;
this.a(true);
}
@@ -55,29 +55,29 @@ public class BlockRedstoneTorch extends BlockTorch {
super.e(world, i, j, k);
}
- if (this.a) {
- world.h(i, j - 1, k, this.id);
- world.h(i, j + 1, k, this.id);
- world.h(i - 1, j, k, this.id);
- world.h(i + 1, j, k, this.id);
- world.h(i, j, k - 1, this.id);
- world.h(i, j, k + 1, this.id);
+ if (this.isOn) {
+ world.applyPhysics(i, j - 1, k, this.id);
+ world.applyPhysics(i, j + 1, k, this.id);
+ world.applyPhysics(i - 1, j, k, this.id);
+ world.applyPhysics(i + 1, j, k, this.id);
+ world.applyPhysics(i, j, k - 1, this.id);
+ world.applyPhysics(i, j, k + 1, this.id);
}
}
- public void b(World world, int i, int j, int k) {
- if (this.a) {
- world.h(i, j - 1, k, this.id);
- world.h(i, j + 1, k, this.id);
- world.h(i - 1, j, k, this.id);
- world.h(i + 1, j, k, this.id);
- world.h(i, j, k - 1, this.id);
- world.h(i, j, k + 1, this.id);
+ public void remove(World world, int i, int j, int k) {
+ if (this.isOn) {
+ world.applyPhysics(i, j - 1, k, this.id);
+ world.applyPhysics(i, j + 1, k, this.id);
+ world.applyPhysics(i - 1, j, k, this.id);
+ world.applyPhysics(i + 1, j, k, this.id);
+ world.applyPhysics(i, j, k - 1, this.id);
+ world.applyPhysics(i, j, k + 1, this.id);
}
}
public boolean b(IBlockAccess iblockaccess, int i, int j, int k, int l) {
- if (!this.a) {
+ if (!this.isOn) {
return false;
} else {
int i1 = iblockaccess.getData(i, j, k);
@@ -89,24 +89,24 @@ public class BlockRedstoneTorch extends BlockTorch {
private boolean g(World world, int i, int j, int k) {
int l = world.getData(i, j, k);
- return l == 5 && world.j(i, j - 1, k, 0) ? true : (l == 3 && world.j(i, j, k - 1, 2) ? true : (l == 4 && world.j(i, j, k + 1, 3) ? true : (l == 1 && world.j(i - 1, j, k, 4) ? true : l == 2 && world.j(i + 1, j, k, 5))));
+ return l == 5 && world.isBlockFaceIndirectlyPowered(i, j - 1, k, 0) ? true : (l == 3 && world.isBlockFaceIndirectlyPowered(i, j, k - 1, 2) ? true : (l == 4 && world.isBlockFaceIndirectlyPowered(i, j, k + 1, 3) ? true : (l == 1 && world.isBlockFaceIndirectlyPowered(i - 1, j, k, 4) ? true : l == 2 && world.isBlockFaceIndirectlyPowered(i + 1, j, k, 5))));
}
public void a(World world, int i, int j, int k, Random random) {
boolean flag = this.g(world, i, j, k);
- while (b.size() > 0 && world.l() - ((RedstoneUpdateInfo) b.get(0)).d > 100L) {
+ while (b.size() > 0 && world.getTime() - ((RedstoneUpdateInfo) b.get(0)).d > 100L) {
b.remove(0);
}
// CraftBukkit start
CraftBlock block = (CraftBlock) ((WorldServer) world).getWorld().getBlockAt(i, j, k);
PluginManager man = ((WorldServer) world).getServer().getPluginManager();
- int oldCurrent = this.a ? 15 : 0;
+ int oldCurrent = this.isOn ? 15 : 0;
BlockRedstoneEvent event = new BlockRedstoneEvent(block, oldCurrent, oldCurrent);
// CraftBukkit end
- if (this.a) {
+ if (this.isOn) {
if (flag) {
// CraftBukkit start
if (oldCurrent != 0) {
@@ -117,9 +117,9 @@ public class BlockRedstoneTorch extends BlockTorch {
}
}
// CraftBukkit end
- world.b(i, j, k, Block.REDSTONE_TORCH_OFF.id, world.getData(i, j, k));
+ world.setTypeIdAndData(i, j, k, Block.REDSTONE_TORCH_OFF.id, world.getData(i, j, k));
if (this.a(world, i, j, k, true)) {
- world.a((double) ((float) i + 0.5F), (double) ((float) j + 0.5F), (double) ((float) k + 0.5F), "random.fizz", 0.5F, 2.6F + (world.k.nextFloat() - world.k.nextFloat()) * 0.8F);
+ world.makeSound((double) ((float) i + 0.5F), (double) ((float) j + 0.5F), (double) ((float) k + 0.5F), "random.fizz", 0.5F, 2.6F + (world.random.nextFloat() - world.random.nextFloat()) * 0.8F);
for (int l = 0; l < 5; ++l) {
double d0 = (double) i + random.nextDouble() * 0.6D + 0.2D;
@@ -140,25 +140,24 @@ public class BlockRedstoneTorch extends BlockTorch {
}
}
// CraftBukkit end
- world.b(i, j, k, Block.REDSTONE_TORCH_ON.id, world.getData(i, j, k));
+ world.setTypeIdAndData(i, j, k, Block.REDSTONE_TORCH_ON.id, world.getData(i, j, k));
}
}
- public void a(World world, int i, int j, int k, int l) {
- super.a(world, i, j, k, l);
+ public void doPhysics(World world, int i, int j, int k, int l) {
+ super.doPhysics(world, i, j, k, l);
world.c(i, j, k, this.id, this.b());
}
public boolean c(World world, int i, int j, int k, int l) {
- // CraftBukkit -- cast to IBlockAccess
- return l == 0 ? this.b((IBlockAccess) world, i, j, k, l) : false;
+ return l == 0 ? this.b(world, i, j, k, l) : false;
}
public int a(int i, Random random) {
return Block.REDSTONE_TORCH_ON.id;
}
- public boolean c() {
+ public boolean isPowerSource() {
return true;
}
}
diff --git a/src/main/java/net/minecraft/server/BlockRedstoneWire.java b/src/main/java/net/minecraft/server/BlockRedstoneWire.java
index 254399fa67..d9d473fbed 100644
--- a/src/main/java/net/minecraft/server/BlockRedstoneWire.java
+++ b/src/main/java/net/minecraft/server/BlockRedstoneWire.java
@@ -32,7 +32,7 @@ public class BlockRedstoneWire extends Block {
return false;
}
- public boolean a(World world, int i, int j, int k) {
+ public boolean canPlace(World world, int i, int j, int k) {
return world.d(i, j - 1, k);
}
@@ -45,7 +45,7 @@ public class BlockRedstoneWire extends Block {
for (int l = 0; l < arraylist.size(); ++l) {
ChunkPosition chunkposition = (ChunkPosition) arraylist.get(l);
- world.h(chunkposition.a, chunkposition.b, chunkposition.c, this.id);
+ world.applyPhysics(chunkposition.x, chunkposition.y, chunkposition.z, this.id);
}
}
@@ -54,7 +54,7 @@ public class BlockRedstoneWire extends Block {
int l1 = 0;
this.a = false;
- boolean flag = world.p(i, j, k);
+ boolean flag = world.isBlockIndirectlyPowered(i, j, k);
this.a = true;
int i2;
@@ -84,15 +84,15 @@ public class BlockRedstoneWire extends Block {
}
if (j2 != l || j != i1 || k2 != j1) {
- l1 = this.f(world, j2, j, k2, l1);
+ l1 = this.getPower(world, j2, j, k2, l1);
}
if (world.d(j2, j, k2) && !world.d(i, j + 1, k)) {
if (j2 != l || j + 1 != i1 || k2 != j1) {
- l1 = this.f(world, j2, j + 1, k2, l1);
+ l1 = this.getPower(world, j2, j + 1, k2, l1);
}
} else if (!world.d(j2, j, k2) && (j2 != l || j - 1 != i1 || k2 != j1)) {
- l1 = this.f(world, j2, j - 1, k2, l1);
+ l1 = this.getPower(world, j2, j - 1, k2, l1);
}
}
@@ -114,7 +114,7 @@ public class BlockRedstoneWire extends Block {
if (k1 != l1) {
world.h = true;
- world.c(i, j, k, l1);
+ world.setData(i, j, k, l1);
world.b(i, j, k, i, j, k);
world.h = false;
@@ -144,7 +144,7 @@ public class BlockRedstoneWire extends Block {
}
boolean flag1 = false;
- int i3 = this.f(world, j2, j, k2, -1);
+ int i3 = this.getPower(world, j2, j, k2, -1);
l1 = world.getData(i, j, k);
if (l1 > 0) {
@@ -155,7 +155,7 @@ public class BlockRedstoneWire extends Block {
this.a(world, j2, j, k2, i, j, k);
}
- i3 = this.f(world, j2, l2, k2, -1);
+ i3 = this.getPower(world, j2, l2, k2, -1);
l1 = world.getData(i, j, k);
if (l1 > 0) {
--l1;
@@ -180,13 +180,13 @@ public class BlockRedstoneWire extends Block {
private void h(World world, int i, int j, int k) {
if (world.getTypeId(i, j, k) == this.id) {
- world.h(i, j, k, this.id);
- world.h(i - 1, j, k, this.id);
- world.h(i + 1, j, k, this.id);
- world.h(i, j, k - 1, this.id);
- world.h(i, j, k + 1, this.id);
- world.h(i, j - 1, k, this.id);
- world.h(i, j + 1, k, this.id);
+ world.applyPhysics(i, j, k, this.id);
+ world.applyPhysics(i - 1, j, k, this.id);
+ world.applyPhysics(i + 1, j, k, this.id);
+ world.applyPhysics(i, j, k - 1, this.id);
+ world.applyPhysics(i, j, k + 1, this.id);
+ world.applyPhysics(i, j - 1, k, this.id);
+ world.applyPhysics(i, j + 1, k, this.id);
}
}
@@ -194,8 +194,8 @@ public class BlockRedstoneWire extends Block {
super.e(world, i, j, k);
if (!world.isStatic) {
this.g(world, i, j, k);
- world.h(i, j + 1, k, this.id);
- world.h(i, j - 1, k, this.id);
+ world.applyPhysics(i, j + 1, k, this.id);
+ world.applyPhysics(i, j - 1, k, this.id);
this.h(world, i - 1, j, k);
this.h(world, i + 1, j, k);
this.h(world, i, j, k - 1);
@@ -226,11 +226,11 @@ public class BlockRedstoneWire extends Block {
}
}
- public void b(World world, int i, int j, int k) {
- super.b(world, i, j, k);
+ public void remove(World world, int i, int j, int k) {
+ super.remove(world, i, j, k);
if (!world.isStatic) {
- world.h(i, j + 1, k, this.id);
- world.h(i, j - 1, k, this.id);
+ world.applyPhysics(i, j + 1, k, this.id);
+ world.applyPhysics(i, j - 1, k, this.id);
this.g(world, i, j, k);
this.h(world, i - 1, j, k);
this.h(world, i + 1, j, k);
@@ -262,8 +262,8 @@ public class BlockRedstoneWire extends Block {
}
}
- // Craftbukkit private-> public
- public int f(World world, int i, int j, int k, int l) {
+ // Craftbukkit private->public
+ public int getPower(World world, int i, int j, int k, int l) {
if (world.getTypeId(i, j, k) != this.id) {
return l;
} else {
@@ -273,21 +273,21 @@ public class BlockRedstoneWire extends Block {
}
}
- public void a(World world, int i, int j, int k, int l) {
+ public void doPhysics(World world, int i, int j, int k, int l) {
if (!world.isStatic) {
int i1 = world.getData(i, j, k);
- boolean flag = this.a(world, i, j, k);
+ boolean flag = this.canPlace(world, i, j, k);
if (!flag) {
this.a_(world, i, j, k, i1);
- world.e(i, j, k, 0);
- } else
- // Craftbukkit
- if ((Block.byId[l] != null && Block.byId[l].c()) || Block.DIODE_OFF.id == l || Block.DIODE_ON.id == l) {
+ world.setTypeId(i, j, k, 0);
+ } else {
+ // Craftbukkit
+ if ((Block.byId[l] != null && Block.byId[l].isPowerSource()) || Block.DIODE_OFF.id == l || Block.DIODE_ON.id == l)
this.g(world, i, j, k);
}
- super.a(world, i, j, k, l);
+ super.doPhysics(world, i, j, k, l);
}
}
@@ -296,8 +296,7 @@ public class BlockRedstoneWire extends Block {
}
public boolean c(World world, int i, int j, int k, int l) {
- // CraftBukkit -- cast to IBlockAccess
- return !this.a ? false : this.b((IBlockAccess) world, i, j, k, l);
+ return !this.a ? false : this.b(world, i, j, k, l);
}
public boolean b(IBlockAccess iblockaccess, int i, int j, int k, int l) {
@@ -335,13 +334,13 @@ public class BlockRedstoneWire extends Block {
}
}
- public boolean c() {
+ public boolean isPowerSource() {
return this.a;
}
public static boolean b(IBlockAccess iblockaccess, int i, int j, int k) {
int l = iblockaccess.getTypeId(i, j, k);
- return l == Block.REDSTONE_WIRE.id ? true : (l == 0 ? false : Block.byId[l].c());
+ return l == Block.REDSTONE_WIRE.id ? true : (l == 0 ? false : Block.byId[l].isPowerSource());
}
}
diff --git a/src/main/java/net/minecraft/server/BlockSign.java b/src/main/java/net/minecraft/server/BlockSign.java
index f185c62a44..c9dd407fe6 100644
--- a/src/main/java/net/minecraft/server/BlockSign.java
+++ b/src/main/java/net/minecraft/server/BlockSign.java
@@ -73,7 +73,7 @@ public class BlockSign extends BlockContainer {
return Item.SIGN.id;
}
- public void a(World world, int i, int j, int k, int l) {
+ public void doPhysics(World world, int i, int j, int k, int l) {
boolean flag = false;
if (this.b) {
@@ -103,17 +103,18 @@ public class BlockSign extends BlockContainer {
if (flag) {
this.a_(world, i, j, k, world.getData(i, j, k));
- world.e(i, j, k, 0);
+ world.setTypeId(i, j, k, 0);
}
- super.a(world, i, j, k, l);
+ super.doPhysics(world, i, j, k, l);
// CraftBukkit start
- if (net.minecraft.server.Block.byId[l] != null && net.minecraft.server.Block.byId[l].c()) {
+ if (net.minecraft.server.Block.byId[l] != null && net.minecraft.server.Block.byId[l].isPowerSource()) {
CraftWorld craftWorld = ((WorldServer) world).getWorld();
CraftServer server = ((WorldServer) world).getServer();
Block block = craftWorld.getBlockAt(i, j, k);
int power = block.getBlockPower();
+
BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(block, power, power);
server.getPluginManager().callEvent(eventRedstone);
}
diff --git a/src/main/java/net/minecraft/server/BlockSoil.java b/src/main/java/net/minecraft/server/BlockSoil.java
index f88f760955..5e2c42203f 100644
--- a/src/main/java/net/minecraft/server/BlockSoil.java
+++ b/src/main/java/net/minecraft/server/BlockSoil.java
@@ -1,10 +1,14 @@
package net.minecraft.server;
import java.util.Random;
+
+// CraftBukkit start
+import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.event.Cancellable;
import org.bukkit.event.block.Action;
import org.bukkit.event.entity.EntityInteractEvent;
+// CraftBukkit end
public class BlockSoil extends Block {
@@ -31,34 +35,36 @@ public class BlockSoil extends Block {
public void a(World world, int i, int j, int k, Random random) {
if (random.nextInt(5) == 0) {
if (this.h(world, i, j, k)) {
- world.c(i, j, k, 7);
+ world.setData(i, j, k, 7);
} else {
int l = world.getData(i, j, k);
if (l > 0) {
- world.c(i, j, k, l - 1);
+ world.setData(i, j, k, l - 1);
} else if (!this.g(world, i, j, k)) {
- world.e(i, j, k, Block.DIRT.id);
+ world.setTypeId(i, j, k, Block.DIRT.id);
}
}
}
}
public void b(World world, int i, int j, int k, Entity entity) {
- // CraftBukkit start - Interact Soil
- Cancellable cancellable;
- if (entity instanceof EntityHuman) {
- cancellable = CraftEventFactory.callPlayerInteractEvent((EntityHuman) entity, Action.PHYSICAL, i, j, k, -1, null);
- }
- else {
- cancellable = new EntityInteractEvent(entity.getBukkitEntity(), ((WorldServer)world).getWorld().getBlockAt(i, j, k));
- }
- if (!cancellable.isCancelled()) {
- if (world.k.nextInt(4) == 0) {
- world.e(i, j, k, Block.DIRT.id);
+ if (world.random.nextInt(4) == 0) {
+ // CraftBukkit start - Interact Soil
+ Cancellable cancellable;
+ if (entity instanceof EntityHuman) {
+ cancellable = CraftEventFactory.callPlayerInteractEvent((EntityHuman) entity, Action.PHYSICAL, i, j, k, -1, null);
+ } else {
+ cancellable = new EntityInteractEvent(entity.getBukkitEntity(), ((WorldServer) world).getWorld().getBlockAt(i, j, k));
+ Bukkit.getServer().getPluginManager().callEvent((EntityInteractEvent) cancellable);
}
+ if (cancellable.isCancelled()) {
+ return;
+ }
+ // Craftbukkit end
+
+ world.setTypeId(i, j, k, Block.DIRT.id);
}
- // Craftbukkit end
}
private boolean g(World world, int i, int j, int k) {
@@ -89,12 +95,12 @@ public class BlockSoil extends Block {
return false;
}
- public void a(World world, int i, int j, int k, int l) {
- super.a(world, i, j, k, l);
+ public void doPhysics(World world, int i, int j, int k, int l) {
+ super.doPhysics(world, i, j, k, l);
Material material = world.getMaterial(i, j + 1, k);
if (material.isBuildable()) {
- world.e(i, j, k, Block.DIRT.id);
+ world.setTypeId(i, j, k, Block.DIRT.id);
}
}
diff --git a/src/main/java/net/minecraft/server/BlockStationary.java b/src/main/java/net/minecraft/server/BlockStationary.java
index 0d38b6fd13..133b32b681 100644
--- a/src/main/java/net/minecraft/server/BlockStationary.java
+++ b/src/main/java/net/minecraft/server/BlockStationary.java
@@ -20,8 +20,8 @@ public class BlockStationary extends BlockFluids {
}
}
- public void a(World world, int i, int j, int k, int l) {
- super.a(world, i, j, k, l);
+ public void doPhysics(World world, int i, int j, int k, int l) {
+ super.doPhysics(world, i, j, k, l);
if (world.getTypeId(i, j, k) == this.id) {
this.i(world, i, j, k);
}
@@ -31,7 +31,7 @@ public class BlockStationary extends BlockFluids {
int l = world.getData(i, j, k);
world.h = true;
- world.setTypeIdAndData(i, j, k, this.id - 1, l);
+ world.setRawTypeIdAndData(i, j, k, this.id - 1, l);
world.b(i, j, k, i, j, k);
world.c(i, j, k, this.id - 1, this.b());
world.h = false;
@@ -69,7 +69,7 @@ public class BlockStationary extends BlockFluids {
}
// CraftBukkit end
- world.e(i, j, k, Block.FIRE.id);
+ world.setTypeId(i, j, k, Block.FIRE.id);
return;
}
} else if (Block.byId[j1].material.isSolid()) {
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 8b44d873e2..a36b330fd4 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -17,36 +17,36 @@ public class Chunk {
public static boolean a;
public byte[] b;
public boolean c;
- public World d;
+ public World world;
public NibbleArray e;
public NibbleArray f;
public NibbleArray g;
public byte[] h;
public int i;
- public final int j;
- public final int k;
- public Map l;
- public List[] m;
- public boolean n;
+ public final int x;
+ public final int z;
+ public Map tileEntities;
+ public List[] entitySlices;
+ public boolean done;
public boolean o;
public boolean p;
public boolean q;
public long r;
public Chunk(World world, int i, int j) {
- this.l = new HashMap();
- this.m = new List[8];
- this.n = false;
+ this.tileEntities = new HashMap();
+ this.entitySlices = new List[8];
+ this.done = false;
this.o = false;
this.q = false;
this.r = 0L;
- this.d = world;
- this.j = i;
- this.k = j;
+ this.world = world;
+ this.x = i;
+ this.z = j;
this.h = new byte[256];
- for (int k = 0; k < this.m.length; ++k) {
- this.m[k] = new ArrayList();
+ for (int k = 0; k < this.entitySlices.length; ++k) {
+ this.entitySlices[k] = new ArrayList();
}
// CraftBukkit start
@@ -69,7 +69,7 @@ public class Chunk {
}
public boolean a(int i, int j) {
- return i == this.j && j == this.k;
+ return i == this.x && j == this.z;
}
public int b(int i, int j) {
@@ -99,7 +99,7 @@ public class Chunk {
i = l;
}
- if (!this.d.m.e) {
+ if (!this.world.worldProvider.e) {
int j1 = 15;
int k1 = 127;
@@ -126,12 +126,12 @@ public class Chunk {
this.o = true;
}
- public void c() {}
+ public void loadNOP() {}
private void c(int i, int j) {
int k = this.b(i, j);
- int l = this.j * 16 + i;
- int i1 = this.k * 16 + j;
+ int l = this.x * 16 + i;
+ int i1 = this.z * 16 + j;
this.f(l - 1, i1, k);
this.f(l + 1, i1, k);
@@ -140,13 +140,13 @@ public class Chunk {
}
private void f(int i, int j, int k) {
- int l = this.d.d(i, j);
+ int l = this.world.getHighestBlockYAt(i, j);
if (l > k) {
- this.d.a(EnumSkyBlock.SKY, i, k, j, i, l, j);
+ this.world.a(EnumSkyBlock.SKY, i, k, j, i, l, j);
this.o = true;
} else if (l < k) {
- this.d.a(EnumSkyBlock.SKY, i, l, j, i, k, j);
+ this.world.a(EnumSkyBlock.SKY, i, l, j, i, k, j);
this.o = true;
}
}
@@ -164,7 +164,7 @@ public class Chunk {
}
if (i1 != l) {
- this.d.g(i, k, i1, l);
+ this.world.g(i, k, i1, l);
this.h[k << 4 | i] = (byte) i1;
int k1;
int l1;
@@ -186,14 +186,14 @@ public class Chunk {
this.i = k1;
}
- k1 = this.j * 16 + i;
- l1 = this.k * 16 + k;
+ k1 = this.x * 16 + i;
+ l1 = this.z * 16 + k;
if (i1 < l) {
for (i2 = i1; i2 < l; ++i2) {
this.f.a(i, i2, k, 15);
}
} else {
- this.d.a(EnumSkyBlock.SKY, k1, l, l1, k1, i1, l1);
+ this.world.a(EnumSkyBlock.SKY, k1, l, l1, k1, i1, l1);
for (i2 = l; i2 < i1; ++i2) {
this.f.a(i, i2, k, 0);
@@ -206,7 +206,7 @@ public class Chunk {
for (j2 = i1; i1 > 0 && i2 > 0; this.f.a(i, i1, k, i2)) {
--i1;
- int k2 = Block.q[this.a(i, i1, k)];
+ int k2 = Block.q[this.getTypeId(i, i1, k)];
if (k2 == 0) {
k2 = 1;
@@ -218,19 +218,19 @@ public class Chunk {
}
}
- while (i1 > 0 && Block.q[this.a(i, i1 - 1, k)] == 0) {
+ while (i1 > 0 && Block.q[this.getTypeId(i, i1 - 1, k)] == 0) {
--i1;
}
if (i1 != j2) {
- this.d.a(EnumSkyBlock.SKY, k1 - 1, i1, l1 - 1, k1 + 1, j2, l1 + 1);
+ this.world.a(EnumSkyBlock.SKY, k1 - 1, i1, l1 - 1, k1 + 1, j2, l1 + 1);
}
this.o = true;
}
}
- public int a(int i, int j, int k) {
+ public int getTypeId(int i, int j, int k) {
return this.b[i << 11 | k << 7 | j] & 255;
}
@@ -242,16 +242,16 @@ public class Chunk {
if (k1 == l && this.e.a(i, j, k) == i1) {
return false;
} else {
- int l1 = this.j * 16 + i;
- int i2 = this.k * 16 + k;
+ int l1 = this.x * 16 + i;
+ int i2 = this.z * 16 + k;
this.b[i << 11 | k << 7 | j] = (byte) (b0 & 255);
- if (k1 != 0 && !this.d.isStatic) {
- Block.byId[k1].b(this.d, l1, j, i2);
+ if (k1 != 0 && !this.world.isStatic) {
+ Block.byId[k1].remove(this.world, l1, j, i2);
}
this.e.a(i, j, k, i1);
- if (!this.d.m.e) {
+ if (!this.world.worldProvider.e) {
if (Block.q[b0 & 255] != 0) {
if (j >= j1) {
this.g(i, j + 1, k);
@@ -260,14 +260,14 @@ public class Chunk {
this.g(i, j, k);
}
- this.d.a(EnumSkyBlock.SKY, l1, j, i2, l1, j, i2);
+ this.world.a(EnumSkyBlock.SKY, l1, j, i2, l1, j, i2);
}
- this.d.a(EnumSkyBlock.BLOCK, l1, j, i2, l1, j, i2);
+ this.world.a(EnumSkyBlock.BLOCK, l1, j, i2, l1, j, i2);
this.c(i, k);
this.e.a(i, j, k, i1);
if (l != 0) {
- Block.byId[l].e(this.d, l1, j, i2);
+ Block.byId[l].e(this.world, l1, j, i2);
}
this.o = true;
@@ -283,12 +283,12 @@ public class Chunk {
if (j1 == l) {
return false;
} else {
- int k1 = this.j * 16 + i;
- int l1 = this.k * 16 + k;
+ int k1 = this.x * 16 + i;
+ int l1 = this.z * 16 + k;
this.b[i << 11 | k << 7 | j] = (byte) (b0 & 255);
if (j1 != 0) {
- Block.byId[j1].b(this.d, k1, j, l1);
+ Block.byId[j1].remove(this.world, k1, j, l1);
}
this.e.a(i, j, k, 0);
@@ -300,11 +300,11 @@ public class Chunk {
this.g(i, j, k);
}
- this.d.a(EnumSkyBlock.SKY, k1, j, l1, k1, j, l1);
- this.d.a(EnumSkyBlock.BLOCK, k1, j, l1, k1, j, l1);
+ this.world.a(EnumSkyBlock.SKY, k1, j, l1, k1, j, l1);
+ this.world.a(EnumSkyBlock.BLOCK, k1, j, l1, k1, j, l1);
this.c(i, k);
- if (l != 0 && !this.d.isStatic) {
- Block.byId[l].e(this.d, k1, j, l1);
+ if (l != 0 && !this.world.isStatic) {
+ Block.byId[l].e(this.world, k1, j, l1);
}
this.o = true;
@@ -312,7 +312,7 @@ public class Chunk {
}
}
- public int b(int i, int j, int k) {
+ public int getData(int i, int j, int k) {
return this.e.a(i, j, k);
}
@@ -357,31 +357,31 @@ public class Chunk {
public void a(Entity entity) {
this.q = true;
- int i = MathHelper.b(entity.locX / 16.0D);
- int j = MathHelper.b(entity.locZ / 16.0D);
+ int i = MathHelper.floor(entity.locX / 16.0D);
+ int j = MathHelper.floor(entity.locZ / 16.0D);
- if (i != this.j || j != this.k) {
+ if (i != this.x || j != this.z) {
System.out.println("Wrong location! " + entity);
// CraftBukkit
- System.out.println("" + entity.locX + "," + entity.locZ + "(" + i + "," + j + ") vs " + this.j + "," + this.k);
+ System.out.println("" + entity.locX + "," + entity.locZ + "(" + i + "," + j + ") vs " + this.x + "," + this.z);
Thread.dumpStack();
}
- int k = MathHelper.b(entity.locY / 16.0D);
+ int k = MathHelper.floor(entity.locY / 16.0D);
if (k < 0) {
k = 0;
}
- if (k >= this.m.length) {
- k = this.m.length - 1;
+ if (k >= this.entitySlices.length) {
+ k = this.entitySlices.length - 1;
}
entity.bA = true;
- entity.chunkX = this.j;
+ entity.chunkX = this.x;
entity.bC = k;
- entity.chunkZ = this.k;
- this.m[k].add(entity);
+ entity.chunkZ = this.z;
+ this.entitySlices[k].add(entity);
}
public void b(Entity entity) {
@@ -393,11 +393,11 @@ public class Chunk {
i = 0;
}
- if (i >= this.m.length) {
- i = this.m.length - 1;
+ if (i >= this.entitySlices.length) {
+ i = this.entitySlices.length - 1;
}
- this.m[i].remove(entity);
+ this.entitySlices[i].remove(entity);
}
public boolean c(int i, int j, int k) {
@@ -406,28 +406,28 @@ public class Chunk {
public TileEntity d(int i, int j, int k) {
ChunkPosition chunkposition = new ChunkPosition(i, j, k);
- TileEntity tileentity = (TileEntity) this.l.get(chunkposition);
+ TileEntity tileentity = (TileEntity) this.tileEntities.get(chunkposition);
if (tileentity == null) {
- int l = this.a(i, j, k);
+ int l = this.getTypeId(i, j, k);
- if (!Block.p[l]) {
+ if (!Block.isTileEntity[l]) {
return null;
}
BlockContainer blockcontainer = (BlockContainer) Block.byId[l];
- blockcontainer.e(this.d, this.j * 16 + i, j, this.k * 16 + k);
- tileentity = (TileEntity) this.l.get(chunkposition);
+ blockcontainer.e(this.world, this.x * 16 + i, j, this.z * 16 + k);
+ tileentity = (TileEntity) this.tileEntities.get(chunkposition);
}
return tileentity;
}
public void a(TileEntity tileentity) {
- int i = tileentity.e - this.j * 16;
+ int i = tileentity.e - this.x * 16;
int j = tileentity.f;
- int k = tileentity.g - this.k * 16;
+ int k = tileentity.g - this.z * 16;
this.a(i, j, k, tileentity);
}
@@ -435,20 +435,20 @@ public class Chunk {
public void a(int i, int j, int k, TileEntity tileentity) {
ChunkPosition chunkposition = new ChunkPosition(i, j, k);
- tileentity.d = this.d;
- tileentity.e = this.j * 16 + i;
+ tileentity.world = this.world;
+ tileentity.e = this.x * 16 + i;
tileentity.f = j;
- tileentity.g = this.k * 16 + k;
- if (this.a(i, j, k) != 0 && Block.byId[this.a(i, j, k)] instanceof BlockContainer) {
+ tileentity.g = this.z * 16 + k;
+ if (this.getTypeId(i, j, k) != 0 && Block.byId[this.getTypeId(i, j, k)] instanceof BlockContainer) {
if (this.c) {
- if (this.l.get(chunkposition) != null) {
- this.d.c.remove(this.l.get(chunkposition));
+ if (this.tileEntities.get(chunkposition) != null) {
+ this.world.c.remove(this.tileEntities.get(chunkposition));
}
- this.d.c.add(tileentity);
+ this.world.c.add(tileentity);
}
- this.l.put(chunkposition, tileentity);
+ this.tileEntities.put(chunkposition, tileentity);
} else {
System.out.println("Attempted to place a tile entity where there was no entity tile!");
}
@@ -458,41 +458,40 @@ public class Chunk {
ChunkPosition chunkposition = new ChunkPosition(i, j, k);
if (this.c) {
- this.d.c.remove(this.l.remove(chunkposition));
+ this.world.c.remove(this.tileEntities.remove(chunkposition));
}
}
- public void d() {
+ public void addEntities() {
this.c = true;
- this.d.c.addAll(this.l.values());
+ this.world.c.addAll(this.tileEntities.values());
- for (int i = 0; i < this.m.length; ++i) {
- this.d.a(this.m[i]);
+ for (int i = 0; i < this.entitySlices.length; ++i) {
+ this.world.a(this.entitySlices[i]);
}
}
- public void e() {
+ public void removeEntities() {
this.c = false;
- this.d.c.removeAll(this.l.values());
-
- for (int i = 0; i < this.m.length; ++i) {
- Iterator