mirror of
https://github.com/LeavesMC/Leaves.git
synced 2025-12-19 14:59:32 +00:00
32 lines
1.5 KiB
Diff
32 lines
1.5 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: MC_XiaoHei <xor7xiaohei@gmail.com>
|
|
Date: Sat, 5 Jul 2025 09:48:47 +0800
|
|
Subject: [PATCH] Fix block place desync due to update suppression
|
|
|
|
|
|
diff --git a/net/minecraft/world/item/ItemStack.java b/net/minecraft/world/item/ItemStack.java
|
|
index e59b8d42d602bbdae1071f2a5be1180420c4efb7..5dadbdb4bb4c0d3a2dcc33120ac725bfe3e6f65c 100644
|
|
--- a/net/minecraft/world/item/ItemStack.java
|
|
+++ b/net/minecraft/world/item/ItemStack.java
|
|
@@ -389,8 +389,12 @@ public final class ItemStack implements DataComponentHolder {
|
|
}
|
|
}
|
|
InteractionResult interactionResult;
|
|
+ org.leavesmc.leaves.util.UpdateSuppressionException ue = null; // Leaves start - fix block place desync due to update suppression
|
|
try {
|
|
interactionResult = item.useOn(context);
|
|
+ } catch (org.leavesmc.leaves.util.UpdateSuppressionException te) {
|
|
+ interactionResult = net.minecraft.world.InteractionResult.SUCCESS.configurePaper(e -> e.placedBlockAt(clickedPos.immutable()));
|
|
+ ue = te; // Leaves end - fix block place desync due to update suppression
|
|
} finally {
|
|
serverLevel.captureBlockStates = false;
|
|
}
|
|
@@ -537,6 +541,7 @@ public final class ItemStack implements DataComponentHolder {
|
|
serverLevel.capturedBlockStates.clear();
|
|
// CraftBukkit end
|
|
|
|
+ if (ue != null) throw ue;
|
|
return interactionResult;
|
|
}
|
|
}
|