summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorT00thpick1 <t00thpick1dirko@gmail.com>2013-07-19 16:25:16 -0400
committerNate Mortensen <nate.richard.mortensen@gmail.com>2013-08-15 11:59:46 -0600
commit3fb4ccb62c1f355a0b26240dd2be4260dde3aa43 (patch)
tree83ff2b864b29abae316558337195b8adef7b1c49 /src
parentf481c9ee07220e30a3c016ba06782807be7a9200 (diff)
downloadcraftbukkit-3fb4ccb62c1f355a0b26240dd2be4260dde3aa43.tar
craftbukkit-3fb4ccb62c1f355a0b26240dd2be4260dde3aa43.tar.gz
craftbukkit-3fb4ccb62c1f355a0b26240dd2be4260dde3aa43.tar.lz
craftbukkit-3fb4ccb62c1f355a0b26240dd2be4260dde3aa43.tar.xz
craftbukkit-3fb4ccb62c1f355a0b26240dd2be4260dde3aa43.zip
Add BlockCake for diff visibility.
Diffstat (limited to 'src')
-rw-r--r--src/main/java/net/minecraft/server/BlockCake.java88
1 files changed, 88 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/BlockCake.java b/src/main/java/net/minecraft/server/BlockCake.java
new file mode 100644
index 00000000..65cc2865
--- /dev/null
+++ b/src/main/java/net/minecraft/server/BlockCake.java
@@ -0,0 +1,88 @@
+package net.minecraft.server;
+
+import java.util.Random;
+
+public class BlockCake extends Block {
+
+ protected BlockCake(int i) {
+ super(i, Material.CAKE);
+ this.b(true);
+ }
+
+ public void updateShape(IBlockAccess iblockaccess, int i, int j, int k) {
+ int l = iblockaccess.getData(i, j, k);
+ float f = 0.0625F;
+ float f1 = (float) (1 + l * 2) / 16.0F;
+ float f2 = 0.5F;
+
+ this.a(f1, 0.0F, f, 1.0F - f, f2, 1.0F - f);
+ }
+
+ public void g() {
+ float f = 0.0625F;
+ float f1 = 0.5F;
+
+ this.a(f, 0.0F, f, 1.0F - f, f1, 1.0F - f);
+ }
+
+ public AxisAlignedBB b(World world, int i, int j, int k) {
+ int l = world.getData(i, j, k);
+ float f = 0.0625F;
+ float f1 = (float) (1 + l * 2) / 16.0F;
+ float f2 = 0.5F;
+
+ return AxisAlignedBB.a().a((double) ((float) i + f1), (double) j, (double) ((float) k + f), (double) ((float) (i + 1) - f), (double) ((float) j + f2 - f), (double) ((float) (k + 1) - f));
+ }
+
+ public boolean b() {
+ return false;
+ }
+
+ public boolean c() {
+ return false;
+ }
+
+ public boolean interact(World world, int i, int j, int k, EntityHuman entityhuman, int l, float f, float f1, float f2) {
+ this.b(world, i, j, k, entityhuman);
+ return true;
+ }
+
+ public void attack(World world, int i, int j, int k, EntityHuman entityhuman) {
+ this.b(world, i, j, k, entityhuman);
+ }
+
+ private void b(World world, int i, int j, int k, EntityHuman entityhuman) {
+ if (entityhuman.g(false)) {
+ entityhuman.getFoodData().eat(2, 0.1F);
+ int l = world.getData(i, j, k) + 1;
+
+ if (l >= 6) {
+ world.setAir(i, j, k);
+ } else {
+ world.setData(i, j, k, l, 2);
+ }
+ }
+ }
+
+ 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 doPhysics(World world, int i, int j, int k, int l) {
+ if (!this.f(world, i, j, k)) {
+ world.setAir(i, j, k);
+ }
+ }
+
+ public boolean f(World world, int i, int j, int k) {
+ return world.getMaterial(i, j - 1, k).isBuildable();
+ }
+
+ public int a(Random random) {
+ return 0;
+ }
+
+ public int getDropType(int i, Random random, int j) {
+ return 0;
+ }
+}