diff options
author | Tahg <tahgtahv@gmail.com> | 2011-09-21 01:40:18 -0400 |
---|---|---|
committer | Tahg <tahgtahv@gmail.com> | 2011-09-21 01:40:18 -0400 |
commit | d06d111b94ec0041bed667d0a7b34e227759959b (patch) | |
tree | 267f20911d253d74e79ed0f08a6374d1ca4439b1 /src/main | |
parent | 905b9776702d2abbfc7975b7cecf0fccf73d3428 (diff) | |
download | craftbukkit-d06d111b94ec0041bed667d0a7b34e227759959b.tar craftbukkit-d06d111b94ec0041bed667d0a7b34e227759959b.tar.gz craftbukkit-d06d111b94ec0041bed667d0a7b34e227759959b.tar.lz craftbukkit-d06d111b94ec0041bed667d0a7b34e227759959b.tar.xz craftbukkit-d06d111b94ec0041bed667d0a7b34e227759959b.zip |
fix for stair data
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/net/minecraft/server/BlockStairs.java | 159 |
1 files changed, 159 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/BlockStairs.java b/src/main/java/net/minecraft/server/BlockStairs.java new file mode 100644 index 00000000..f3830cb1 --- /dev/null +++ b/src/main/java/net/minecraft/server/BlockStairs.java @@ -0,0 +1,159 @@ +package net.minecraft.server; + +import java.util.ArrayList; +import java.util.Random; + +public class BlockStairs extends Block { + + private Block a; + + protected BlockStairs(int i, Block block) { + super(i, block.textureId, block.material); + this.a = block; + this.c(block.strength); + this.b(block.durability / 3.0F); + this.a(block.stepSound); + this.f(255); + } + + public void a(IBlockAccess iblockaccess, int i, int j, int k) { + this.a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + public AxisAlignedBB e(World world, int i, int j, int k) { + return super.e(world, i, j, k); + } + + public boolean a() { + return false; + } + + public boolean b() { + return false; + } + + public void a(World world, int i, int j, int k, AxisAlignedBB axisalignedbb, ArrayList arraylist) { + int l = world.getData(i, j, k); + + if (l == 0) { + this.a(0.0F, 0.0F, 0.0F, 0.5F, 0.5F, 1.0F); + super.a(world, i, j, k, axisalignedbb, arraylist); + this.a(0.5F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + super.a(world, i, j, k, axisalignedbb, arraylist); + } else if (l == 1) { + this.a(0.0F, 0.0F, 0.0F, 0.5F, 1.0F, 1.0F); + super.a(world, i, j, k, axisalignedbb, arraylist); + this.a(0.5F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); + super.a(world, i, j, k, axisalignedbb, arraylist); + } else if (l == 2) { + this.a(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 0.5F); + super.a(world, i, j, k, axisalignedbb, arraylist); + this.a(0.0F, 0.0F, 0.5F, 1.0F, 1.0F, 1.0F); + super.a(world, i, j, k, axisalignedbb, arraylist); + } else if (l == 3) { + this.a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.5F); + super.a(world, i, j, k, axisalignedbb, arraylist); + this.a(0.0F, 0.0F, 0.5F, 1.0F, 0.5F, 1.0F); + super.a(world, i, j, k, axisalignedbb, arraylist); + } + + this.a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + public void b(World world, int i, int j, int k, EntityHuman entityhuman) { + this.a.b(world, i, j, k, entityhuman); + } + + public void postBreak(World world, int i, int j, int k, int l) { + this.a.postBreak(world, i, j, k, l); + } + + public float a(Entity entity) { + return this.a.a(entity); + } + + public int a(int i, Random random) { + return this.a.a(i, random); + } + + public int a(Random random) { + return this.a.a(random); + } + + public int a(int i, int j) { + return this.a.a(i, 0); + } + + public int a(int i) { + return this.a.a(i, 0); + } + + public int c() { + return this.a.c(); + } + + public void a(World world, int i, int j, int k, Entity entity, Vec3D vec3d) { + this.a.a(world, i, j, k, entity, vec3d); + } + + public boolean q_() { + return this.a.q_(); + } + + public boolean a(int i, boolean flag) { + return this.a.a(i, flag); + } + + public boolean canPlace(World world, int i, int j, int k) { + return this.a.canPlace(world, i, j, k); + } + + public void a(World world, int i, int j, int k) { + this.doPhysics(world, i, j, k, 0); + this.a.a(world, i, j, k); + } + + public void remove(World world, int i, int j, int k) { + this.a.remove(world, i, j, k); + } + + public void dropNaturally(World world, int i, int j, int k, int l, float f) { + this.a.dropNaturally(world, i, j, k, 0, f); // CraftBukkit - don't propagate stair direction + } + + public void b(World world, int i, int j, int k, Entity entity) { + this.a.b(world, i, j, k, entity); + } + + public void a(World world, int i, int j, int k, Random random) { + this.a.a(world, i, j, k, random); + } + + public boolean interact(World world, int i, int j, int k, EntityHuman entityhuman) { + return this.a.interact(world, i, j, k, entityhuman); + } + + public void a_(World world, int i, int j, int k) { + this.a.a_(world, i, j, k); + } + + 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.setData(i, j, k, 2); + } + + if (l == 1) { + world.setData(i, j, k, 1); + } + + if (l == 2) { + world.setData(i, j, k, 3); + } + + if (l == 3) { + world.setData(i, j, k, 0); + } + } +} |