diff options
Diffstat (limited to 'src/main/java/net/minecraft/server/BlockDragonEgg.java')
-rw-r--r-- | src/main/java/net/minecraft/server/BlockDragonEgg.java | 121 |
1 files changed, 0 insertions, 121 deletions
diff --git a/src/main/java/net/minecraft/server/BlockDragonEgg.java b/src/main/java/net/minecraft/server/BlockDragonEgg.java deleted file mode 100644 index b1c3f10e..00000000 --- a/src/main/java/net/minecraft/server/BlockDragonEgg.java +++ /dev/null @@ -1,121 +0,0 @@ -package net.minecraft.server; - -import java.util.Random; - -import org.bukkit.event.block.BlockFromToEvent; // CraftBukkit - -public class BlockDragonEgg extends Block { - - public BlockDragonEgg() { - super(Material.DRAGON_EGG); - this.a(0.0625F, 0.0F, 0.0625F, 0.9375F, 1.0F, 0.9375F); - } - - public void onPlace(World world, int i, int j, int k) { - world.a(i, j, k, this, this.a(world)); - } - - public void doPhysics(World world, int i, int j, int k, Block block) { - world.a(i, j, k, this, this.a(world)); - } - - public void a(World world, int i, int j, int k, Random random) { - this.e(world, i, j, k); - } - - private void e(World world, int i, int j, int k) { - if (BlockFalling.canFall(world, i, j - 1, k) && j >= 0) { - byte b0 = 32; - - if (!BlockFalling.instaFall && world.b(i - b0, j - b0, k - b0, i + b0, j + b0, k + b0)) { - // CraftBukkit - added data - EntityFallingBlock entityfallingblock = new EntityFallingBlock(world, (double) ((float) i + 0.5F), (double) ((float) j + 0.5F), (double) ((float) k + 0.5F), this, world.getData(i, j, k)); - - world.addEntity(entityfallingblock); - } else { - world.setAir(i, j, k); - - while (BlockFalling.canFall(world, i, j - 1, k) && j > 0) { - --j; - } - - if (j > 0) { - world.setTypeAndData(i, j, k, this, 0, 2); - } - } - } - } - - public boolean interact(World world, int i, int j, int k, EntityHuman entityhuman, int l, float f, float f1, float f2) { - this.m(world, i, j, k); - return true; - } - - public void attack(World world, int i, int j, int k, EntityHuman entityhuman) { - this.m(world, i, j, k); - } - - private void m(World world, int i, int j, int k) { - if (world.getType(i, j, k) == this) { - for (int l = 0; l < 1000; ++l) { - int i1 = i + world.random.nextInt(16) - world.random.nextInt(16); - int j1 = j + world.random.nextInt(8) - world.random.nextInt(8); - int k1 = k + world.random.nextInt(16) - world.random.nextInt(16); - - if (world.getType(i1, j1, k1).material == Material.AIR) { - // CraftBukkit start - org.bukkit.block.Block from = world.getWorld().getBlockAt(i, j, k); - org.bukkit.block.Block to = world.getWorld().getBlockAt(i1, j1, k1); - BlockFromToEvent event = new BlockFromToEvent(from, to); - org.bukkit.Bukkit.getPluginManager().callEvent(event); - - if (event.isCancelled()) { - return; - } - - i1 = event.getToBlock().getX(); - j1 = event.getToBlock().getY(); - k1 = event.getToBlock().getZ(); - // CraftBukkit end - - if (!world.isStatic) { - world.setTypeAndData(i1, j1, k1, this, world.getData(i, j, k), 2); - world.setAir(i, j, k); - } else { - short short1 = 128; - - for (int l1 = 0; l1 < short1; ++l1) { - double d0 = world.random.nextDouble(); - float f = (world.random.nextFloat() - 0.5F) * 0.2F; - float f1 = (world.random.nextFloat() - 0.5F) * 0.2F; - float f2 = (world.random.nextFloat() - 0.5F) * 0.2F; - double d1 = (double) i1 + (double) (i - i1) * d0 + (world.random.nextDouble() - 0.5D) * 1.0D + 0.5D; - double d2 = (double) j1 + (double) (j - j1) * d0 + world.random.nextDouble() * 1.0D - 0.5D; - double d3 = (double) k1 + (double) (k - k1) * d0 + (world.random.nextDouble() - 0.5D) * 1.0D + 0.5D; - - world.addParticle("portal", d1, d2, d3, (double) f, (double) f1, (double) f2); - } - } - - return; - } - } - } - } - - public int a(World world) { - return 5; - } - - public boolean c() { - return false; - } - - public boolean d() { - return false; - } - - public int b() { - return 27; - } -} |