diff options
author | mbax <matt@phozop.net> | 2013-11-04 07:07:38 -0600 |
---|---|---|
committer | Wesley Wolfe <weswolf@aol.com> | 2013-11-30 19:26:12 -0600 |
commit | 2726696652179a5ead7dc07dd39edf7dfda687f7 (patch) | |
tree | ff78e22fdd4fc01889a5f6cc482b599f965cd93a /src/main/java/net/minecraft/server/BlockOre.java | |
parent | ff8b70fbb7a96b9d2ff078afcf3b3ff90f200981 (diff) | |
download | craftbukkit-2726696652179a5ead7dc07dd39edf7dfda687f7.tar craftbukkit-2726696652179a5ead7dc07dd39edf7dfda687f7.tar.gz craftbukkit-2726696652179a5ead7dc07dd39edf7dfda687f7.tar.lz craftbukkit-2726696652179a5ead7dc07dd39edf7dfda687f7.tar.xz craftbukkit-2726696652179a5ead7dc07dd39edf7dfda687f7.zip |
Update CraftBukkit to Minecraft 1.7.2
Diffstat (limited to 'src/main/java/net/minecraft/server/BlockOre.java')
-rw-r--r-- | src/main/java/net/minecraft/server/BlockOre.java | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/src/main/java/net/minecraft/server/BlockOre.java b/src/main/java/net/minecraft/server/BlockOre.java index 2f406ba6..42f44006 100644 --- a/src/main/java/net/minecraft/server/BlockOre.java +++ b/src/main/java/net/minecraft/server/BlockOre.java @@ -4,21 +4,21 @@ import java.util.Random; public class BlockOre extends Block { - public BlockOre(int i) { - super(i, Material.STONE); + public BlockOre() { + super(Material.STONE); this.a(CreativeModeTab.b); } - public int getDropType(int i, Random random, int j) { - return this.id == Block.COAL_ORE.id ? Item.COAL.id : (this.id == Block.DIAMOND_ORE.id ? Item.DIAMOND.id : (this.id == Block.LAPIS_ORE.id ? Item.INK_SACK.id : (this.id == Block.EMERALD_ORE.id ? Item.EMERALD.id : (this.id == Block.QUARTZ_ORE.id ? Item.QUARTZ.id : this.id)))); + public Item getDropType(int i, Random random, int j) { + return this == Blocks.COAL_ORE ? Items.COAL : (this == Blocks.DIAMOND_ORE ? Items.DIAMOND : (this == Blocks.LAPIS_ORE ? Items.INK_SACK : (this == Blocks.EMERALD_ORE ? Items.EMERALD : (this == Blocks.QUARTZ_ORE ? Items.QUARTZ : Item.getItemOf(this))))); } public int a(Random random) { - return this.id == Block.LAPIS_ORE.id ? 4 + random.nextInt(5) : 1; + return this == Blocks.LAPIS_ORE ? 4 + random.nextInt(5) : 1; } public int getDropCount(int i, Random random) { - if (i > 0 && this.id != this.getDropType(0, random, i)) { + if (i > 0 && Item.getItemOf(this) != this.getDropType(0, random, i)) { int j = random.nextInt(i + 2) - 1; if (j < 0) { @@ -34,38 +34,39 @@ public class BlockOre extends Block { public void dropNaturally(World world, int i, int j, int k, int l, float f, int i1) { super.dropNaturally(world, i, j, k, l, f, i1); /* CraftBukkit start - Delegated to getExpDrop - if (this.getDropType(l, world.random, i1) != this.id) { + if (this.getDropType(l, world.random, i1) != Item.getItemOf(this)) { int j1 = 0; - if (this.id == Block.COAL_ORE.id) { + if (this == Blocks.COAL_ORE) { j1 = MathHelper.nextInt(world.random, 0, 2); - } else if (this.id == Block.DIAMOND_ORE.id) { + } else if (this == Blocks.DIAMOND_ORE) { j1 = MathHelper.nextInt(world.random, 3, 7); - } else if (this.id == Block.EMERALD_ORE.id) { + } else if (this == Blocks.EMERALD_ORE) { j1 = MathHelper.nextInt(world.random, 3, 7); - } else if (this.id == Block.LAPIS_ORE.id) { + } else if (this == Blocks.LAPIS_ORE) { j1 = MathHelper.nextInt(world.random, 2, 5); - } else if (this.id == Block.QUARTZ_ORE.id) { + } else if (this == Blocks.QUARTZ_ORE) { j1 = MathHelper.nextInt(world.random, 2, 5); } - this.j(world, i, j, k, j1); - } */ + this.dropExperience(world, i, j, k, j1); + } + // */ } public int getExpDrop(World world, int l, int i1) { - if (this.getDropType(l, world.random, i1) != this.id) { + if (this.getDropType(l, world.random, i1) != Item.getItemOf(this)) { int j1 = 0; - if (this.id == Block.COAL_ORE.id) { + if (this == Blocks.COAL_ORE) { j1 = MathHelper.nextInt(world.random, 0, 2); - } else if (this.id == Block.DIAMOND_ORE.id) { + } else if (this == Blocks.DIAMOND_ORE) { j1 = MathHelper.nextInt(world.random, 3, 7); - } else if (this.id == Block.EMERALD_ORE.id) { + } else if (this == Blocks.EMERALD_ORE) { j1 = MathHelper.nextInt(world.random, 3, 7); - } else if (this.id == Block.LAPIS_ORE.id) { + } else if (this == Blocks.LAPIS_ORE) { j1 = MathHelper.nextInt(world.random, 2, 5); - } else if (this.id == Block.QUARTZ_ORE.id) { + } else if (this == Blocks.QUARTZ_ORE) { j1 = MathHelper.nextInt(world.random, 2, 5); } @@ -77,6 +78,6 @@ public class BlockOre extends Block { } public int getDropData(int i) { - return this.id == Block.LAPIS_ORE.id ? 4 : 0; + return this == Blocks.LAPIS_ORE ? 4 : 0; } } |