@@ -8,47 +8,39 @@
|
||||
+
|
||||
public class BlockChorusFlower extends Block {
|
||||
|
||||
public static final BlockStateInteger AGE = BlockProperties.ab;
|
||||
@@ -58,8 +60,12 @@
|
||||
}
|
||||
public static final BlockStateInteger AGE = BlockProperties.ah;
|
||||
@@ -68,8 +70,12 @@
|
||||
}
|
||||
|
||||
if (flag && b((IWorldReader) worldserver, blockposition1, (EnumDirection) null) && worldserver.isEmpty(blockposition.up(2))) {
|
||||
- worldserver.setTypeAndData(blockposition, this.b.a((IBlockAccess) worldserver, blockposition), 2);
|
||||
- this.b(worldserver, blockposition1, i);
|
||||
+ // CraftBukkit start - add event
|
||||
+ if (CraftEventFactory.handleBlockSpreadEvent(worldserver, blockposition, blockposition1, this.getBlockData().set(BlockChorusFlower.AGE, Integer.valueOf(i)), 2)) {
|
||||
+ worldserver.setTypeAndData(blockposition, this.b.a((IBlockAccess) worldserver, blockposition), 2);
|
||||
+ this.b(worldserver, blockposition1, i);
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
} else if (i < 4) {
|
||||
j = random.nextInt(4);
|
||||
if (flag1) {
|
||||
@@ -73,18 +79,30 @@
|
||||
BlockPosition blockposition2 = blockposition.shift(enumdirection);
|
||||
if (flag && b((IWorldReader) worldserver, blockposition1, (EnumDirection) null) && worldserver.isEmpty(blockposition.up(2))) {
|
||||
- worldserver.setTypeAndData(blockposition, this.b.a((IBlockAccess) worldserver, blockposition), 2);
|
||||
- this.b(worldserver, blockposition1, i);
|
||||
+ // CraftBukkit start - add event
|
||||
+ if (CraftEventFactory.handleBlockSpreadEvent(worldserver, blockposition, blockposition1, this.getBlockData().set(BlockChorusFlower.AGE, Integer.valueOf(i)), 2)) {
|
||||
+ worldserver.setTypeAndData(blockposition, this.b.a((IBlockAccess) worldserver, blockposition), 2);
|
||||
+ this.b(worldserver, blockposition1, i);
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
} else if (i < 4) {
|
||||
j = random.nextInt(4);
|
||||
if (flag1) {
|
||||
@@ -83,18 +89,30 @@
|
||||
BlockPosition blockposition2 = blockposition.shift(enumdirection);
|
||||
|
||||
if (worldserver.isEmpty(blockposition2) && worldserver.isEmpty(blockposition2.down()) && b((IWorldReader) worldserver, blockposition2, enumdirection.opposite())) {
|
||||
- this.b(worldserver, blockposition2, i + 1);
|
||||
- flag2 = true;
|
||||
+ // CraftBukkit start - add event
|
||||
+ if (CraftEventFactory.handleBlockSpreadEvent(worldserver, blockposition, blockposition2, this.getBlockData().set(BlockChorusFlower.AGE, Integer.valueOf(i + 1)), 2)) {
|
||||
+ this.b(worldserver, blockposition2, i + 1);
|
||||
+ flag2 = true;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
}
|
||||
|
||||
if (flag2) {
|
||||
worldserver.setTypeAndData(blockposition, this.b.a((IBlockAccess) worldserver, blockposition), 2);
|
||||
} else {
|
||||
- this.a((World) worldserver, blockposition);
|
||||
+ // CraftBukkit - add event
|
||||
+ if (CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition, this.getBlockData().set(BlockChorusFlower.AGE, Integer.valueOf(5)), 2)) {
|
||||
+ this.a((World) worldserver, blockposition);
|
||||
if (worldserver.isEmpty(blockposition2) && worldserver.isEmpty(blockposition2.down()) && b((IWorldReader) worldserver, blockposition2, enumdirection.opposite())) {
|
||||
- this.b(worldserver, blockposition2, i + 1);
|
||||
- flag2 = true;
|
||||
+ // CraftBukkit start - add event
|
||||
+ if (CraftEventFactory.handleBlockSpreadEvent(worldserver, blockposition, blockposition2, this.getBlockData().set(BlockChorusFlower.AGE, Integer.valueOf(i + 1)), 2)) {
|
||||
+ this.b(worldserver, blockposition2, i + 1);
|
||||
+ flag2 = true;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
}
|
||||
|
||||
if (flag2) {
|
||||
worldserver.setTypeAndData(blockposition, this.b.a((IBlockAccess) worldserver, blockposition), 2);
|
||||
} else {
|
||||
- this.a((World) worldserver, blockposition);
|
||||
+ // CraftBukkit - add event
|
||||
@@ -57,5 +49,13 @@
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
} else {
|
||||
- this.a((World) worldserver, blockposition);
|
||||
+ // CraftBukkit - add event
|
||||
+ if (CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition, this.getBlockData().set(BlockChorusFlower.AGE, Integer.valueOf(5)), 2)) {
|
||||
+ this.a((World) worldserver, blockposition);
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user