Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-15 19:10:09 +01:00
4104545b11
"It was from a different time before books were as jank as they are now. As time has gone on they've only proven to be worse and worse."
29 Zeilen
1.6 KiB
Diff
29 Zeilen
1.6 KiB
Diff
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
|
|
|
|
Caused a deadlock
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/block/FireBlock.java b/src/main/java/net/minecraft/world/level/block/FireBlock.java
|
|
index ad0b485dbc77717f16191d6950a2e91faaede94a..c86bf175853197dceaa91a2287ef51de87b9d5f9 100644
|
|
--- a/src/main/java/net/minecraft/world/level/block/FireBlock.java
|
|
+++ b/src/main/java/net/minecraft/world/level/block/FireBlock.java
|
|
@@ -100,6 +100,7 @@ public class FireBlock extends BaseFireBlock {
|
|
@Override
|
|
public BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
|
|
// 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
|
|
if (!(world instanceof Level)) {
|
|
@@ -115,7 +116,7 @@ public class FireBlock extends BaseFireBlock {
|
|
return blockState.getHandle();
|
|
}
|
|
}
|
|
- return this.getStateWithAge(world, pos, (Integer) state.getValue(FireBlock.AGE));
|
|
+ return this.getStateWithAge(world, pos, (Integer) state.getValue(FireBlock.AGE)); // Paper - diff on change, see "don't fire events in world generation"
|
|
// CraftBukkit end
|
|
}
|
|
|