@@ -19,25 +19,25 @@
|
||||
@@ -100,7 +109,24 @@
|
||||
|
||||
@Override
|
||||
protected IBlockData updateShape(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {
|
||||
- return this.canSurvive(iblockdata, generatoraccess, blockposition) ? this.getStateWithAge(generatoraccess, blockposition, (Integer) iblockdata.getValue(BlockFire.AGE)) : Blocks.AIR.defaultBlockState();
|
||||
protected IBlockData updateShape(IBlockData iblockdata, IWorldReader iworldreader, ScheduledTickAccess scheduledtickaccess, BlockPosition blockposition, EnumDirection enumdirection, BlockPosition blockposition1, IBlockData iblockdata1, RandomSource randomsource) {
|
||||
- return this.canSurvive(iblockdata, iworldreader, blockposition) ? this.getStateWithAge(iworldreader, blockposition, (Integer) iblockdata.getValue(BlockFire.AGE)) : Blocks.AIR.defaultBlockState();
|
||||
+ // CraftBukkit start
|
||||
+ if (!this.canSurvive(iblockdata, generatoraccess, blockposition)) {
|
||||
+ if (!this.canSurvive(iblockdata, iworldreader, blockposition)) {
|
||||
+ // Suppress during worldgen
|
||||
+ if (!(generatoraccess instanceof World)) {
|
||||
+ if (!(iworldreader instanceof World world)) {
|
||||
+ return Blocks.AIR.defaultBlockState();
|
||||
+ }
|
||||
+ CraftBlockState blockState = CraftBlockStates.getBlockState(generatoraccess, blockposition);
|
||||
+ CraftBlockState blockState = CraftBlockStates.getBlockState(world, blockposition);
|
||||
+ blockState.setData(Blocks.AIR.defaultBlockState());
|
||||
+
|
||||
+ BlockFadeEvent event = new BlockFadeEvent(blockState.getBlock(), blockState);
|
||||
+ ((World) generatoraccess).getCraftServer().getPluginManager().callEvent(event);
|
||||
+ world.getCraftServer().getPluginManager().callEvent(event);
|
||||
+
|
||||
+ if (!event.isCancelled()) {
|
||||
+ return blockState.getHandle();
|
||||
+ }
|
||||
+ }
|
||||
+ return this.getStateWithAge(generatoraccess, blockposition, (Integer) iblockdata.getValue(BlockFire.AGE));
|
||||
+ return this.getStateWithAge(iworldreader, blockposition, (Integer) iblockdata.getValue(BlockFire.AGE));
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user