[Bleeding] Added BlockGrowEvent. Addresses BUKKIT-104

This commit is contained in:
Feildmaster
2012-02-11 23:32:24 -06:00
committed by EvilSeph
parent 847e1c62c5
commit 7792156fb2
7 changed files with 29 additions and 15 deletions

View File

@@ -26,7 +26,7 @@ public class BlockCactus extends Block {
int i1 = world.getData(i, j, k);
if (i1 == 15) {
world.setTypeId(i, j + 1, k, this.id);
org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(world, i, j + 1, k, this.id, 0); // CraftBukkit
world.setData(i, j, k, 0);
} else {
world.setData(i, j, k, i1 + 1);

View File

@@ -26,8 +26,7 @@ public class BlockCrops extends BlockFlower {
float f = this.i(world, i, j, k);
if (random.nextInt((int) (25.0F / f) + 1) == 0) {
++l;
world.setData(i, j, k, l);
org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(world, i, j, k, this.id, ++l); // CraftBukkit
}
}
}

View File

@@ -26,8 +26,7 @@ public class BlockNetherWart extends BlockFlower {
BiomeBase biomebase = worldchunkmanager.getBiome(i, k);
if (biomebase instanceof BiomeHell && random.nextInt(15) == 0) {
++l;
world.setData(i, j, k, l);
org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(world, i, j, k, this.id, ++l); // CraftBukkit
}
}
}

View File

@@ -25,7 +25,7 @@ public class BlockReed extends Block {
int i1 = world.getData(i, j, k);
if (i1 == 15) {
world.setTypeId(i, j + 1, k, this.id);
org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(world, i, j + 1, k, this.id, 0); // CraftBukkit
world.setData(i, j, k, 0);
} else {
world.setData(i, j, k, i1 + 1);

View File

@@ -28,8 +28,7 @@ public class BlockStem extends BlockFlower {
int l = world.getData(i, j, k);
if (l < 7) {
++l;
world.setData(i, j, k, l);
org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(world, i, j, k, this.id, ++l); // CraftBukkit
} else {
if (world.getTypeId(i - 1, j, k) == this.a.id) {
return;
@@ -70,7 +69,7 @@ public class BlockStem extends BlockFlower {
int l1 = world.getTypeId(j1, j - 1, k1);
if (world.getTypeId(j1, j, k1) == 0 && (l1 == Block.SOIL.id || l1 == Block.DIRT.id || l1 == Block.GRASS.id)) {
world.setTypeId(j1, j, k1, this.a.id);
org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(world, j1, j, k1, this.a.id, 0); // CraftBukkit
}
}
}