PaperMC/patches/server/0340-Don-t-fire-BlockFade-on-worldgen-threads.patch

28 lines
1.7 KiB
Diff
Raw Permalink Normal View History

2021-06-11 14:02:28 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 23 Apr 2020 01:36:39 -0400
Subject: [PATCH] Don't fire BlockFade on worldgen threads
diff --git a/src/main/java/net/minecraft/world/level/block/FireBlock.java b/src/main/java/net/minecraft/world/level/block/FireBlock.java
2024-12-03 19:21:12 +01:00
index 422e5750669457bea6e4b8de799d289e8e315a09..bd7835a8b470662b32cc28a4d8f777d4bb8dc60c 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/world/level/block/FireBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/FireBlock.java
2023-12-05 23:55:31 +01:00
@@ -108,6 +108,7 @@ public class FireBlock extends BaseFireBlock {
2021-06-11 14:02:28 +02:00
@Override
2024-10-23 16:04:01 +02:00
protected BlockState updateShape(BlockState state, LevelReader world, ScheduledTickAccess tickView, BlockPos pos, Direction direction, BlockPos neighborPos, BlockState neighborState, RandomSource random) {
2021-06-11 14:02:28 +02:00
// CraftBukkit start
+ if (!(world instanceof ServerLevel)) return this.canSurvive(state, world, pos) ? (BlockState) this.getStateWithAge(world, pos, (Integer) state.getValue(FireBlock.AGE)) : Blocks.AIR.defaultBlockState(); // Paper - don't fire events in world generation
if (!this.canSurvive(state, world, pos)) {
// Suppress during worldgen
2024-10-23 16:04:01 +02:00
if (!(world instanceof Level world1)) {
2023-12-05 23:55:31 +01:00
@@ -123,7 +124,7 @@ public class FireBlock extends BaseFireBlock {
2021-06-11 14:02:28 +02:00
return blockState.getHandle();
}
}
- return this.getStateWithAge(world, pos, (Integer) state.getValue(FireBlock.AGE));
+ return this.getStateWithAge(world, pos, (Integer) state.getValue(FireBlock.AGE)); // Paper - don't fire events in world generation; diff on change, see "don't fire events in world generation"
2021-06-11 14:02:28 +02:00
// CraftBukkit end
}