Update to Minecraft 1.21.2

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2024-10-23 02:15:00 +11:00
parent 2c4beb962b
commit d3a23f42c3
522 changed files with 8501 additions and 6477 deletions

View File

@@ -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
}