summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/EntityFallingBlock.java
diff options
context:
space:
mode:
authorNathan Adams <dinnerbone@dinnerbone.com>2011-11-29 23:17:43 +0000
committerNathan Adams <dinnerbone@dinnerbone.com>2011-11-30 21:46:19 +0000
commit8fbe78a2c3b65f4140c4d0db4bed5a9bcdaf1792 (patch)
treecc229f65097c54cfcd769f686c43efa1dacc8d2f /src/main/java/net/minecraft/server/EntityFallingBlock.java
parent8665161eaa0160467ce33598c13f1aed4b549a4d (diff)
downloadcraftbukkit-8fbe78a2c3b65f4140c4d0db4bed5a9bcdaf1792.tar
craftbukkit-8fbe78a2c3b65f4140c4d0db4bed5a9bcdaf1792.tar.gz
craftbukkit-8fbe78a2c3b65f4140c4d0db4bed5a9bcdaf1792.tar.lz
craftbukkit-8fbe78a2c3b65f4140c4d0db4bed5a9bcdaf1792.tar.xz
craftbukkit-8fbe78a2c3b65f4140c4d0db4bed5a9bcdaf1792.zip
Updated to use mc-dev rename revision 1
Diffstat (limited to 'src/main/java/net/minecraft/server/EntityFallingBlock.java')
-rw-r--r--src/main/java/net/minecraft/server/EntityFallingBlock.java90
1 files changed, 90 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java
new file mode 100644
index 00000000..b95d61ac
--- /dev/null
+++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java
@@ -0,0 +1,90 @@
+package net.minecraft.server;
+
+public class EntityFallingBlock extends Entity {
+
+ public int a;
+ public int data; // CraftBukkit
+ public int b = 0;
+
+ public EntityFallingBlock(World world) {
+ super(world);
+ }
+
+ // CraftBukkit -- changed method signature
+ public EntityFallingBlock(World world, double d0, double d1, double d2, int i, int data) {
+ super(world);
+ this.a = i;
+ this.bc = true;
+ this.data = data; // CraftBukkit
+ this.b(0.98F, 0.98F);
+ this.height = this.length / 2.0F;
+ this.setPosition(d0, d1, d2);
+ this.motX = 0.0D;
+ this.motY = 0.0D;
+ this.motZ = 0.0D;
+ this.lastX = d0;
+ this.lastY = d1;
+ this.lastZ = d2;
+ }
+
+ protected boolean g_() {
+ return false;
+ }
+
+ protected void b() {}
+
+ public boolean e_() {
+ return !this.dead;
+ }
+
+ public void w_() {
+ if (this.a == 0) {
+ this.die();
+ } else {
+ this.lastX = this.locX;
+ this.lastY = this.locY;
+ this.lastZ = this.locZ;
+ ++this.b;
+ this.motY -= 0.03999999910593033D;
+ this.move(this.motX, this.motY, this.motZ);
+ this.motX *= 0.9800000190734863D;
+ this.motY *= 0.9800000190734863D;
+ this.motZ *= 0.9800000190734863D;
+ int i = MathHelper.floor(this.locX);
+ int j = MathHelper.floor(this.locY);
+ int k = MathHelper.floor(this.locZ);
+
+ if (this.b == 1 && this.world.getTypeId(i, j, k) == this.a) {
+ this.world.setTypeId(i, j, k, 0);
+ } else if (!this.world.isStatic && this.b == 1) {
+ this.die();
+ }
+
+ if (this.onGround) {
+ this.motX *= 0.699999988079071D;
+ this.motZ *= 0.699999988079071D;
+ this.motY *= -0.5D;
+ if (this.world.getTypeId(i, j, k) != Block.PISTON_MOVING.id) {
+ this.die();
+ // CraftBukkit -- setTypeId => setTypeIdAndData
+ if ((!this.world.a(this.a, i, j, k, true, 1) || BlockSand.g(this.world, i, j - 1, k) || !this.world.setTypeIdAndData(i, j, k, this.a, this.data)) && !this.world.isStatic) {
+ this.b(this.a, 1);
+ }
+ }
+ } else if (this.b > 100 && !this.world.isStatic) {
+ this.b(this.a, 1);
+ this.die();
+ }
+ }
+ }
+
+ protected void b(NBTTagCompound nbttagcompound) {
+ nbttagcompound.setByte("Tile", (byte) this.a);
+ nbttagcompound.setByte("Data", (byte) this.data); // CraftBukkit
+ }
+
+ protected void a(NBTTagCompound nbttagcompound) {
+ this.a = nbttagcompound.getByte("Tile") & 255;
+ this.data = nbttagcompound.getByte("Data") & 15; // CraftBukkit
+ }
+}