2020-04-02 23:07:06 +02:00
From 348184180d29734db3274dd6de280a3f9faaf6a7 Mon Sep 17 00:00:00 2001
2020-02-19 04:51:52 +01:00
From: Trigary <trigary0@gmail.com>
Date: Mon, 17 Feb 2020 22:53:33 +0100
Subject: [PATCH] fix blockstate capture undoing
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
2020-04-02 23:07:06 +02:00
index bb34486a36..5117dafbcf 100644
2020-02-19 04:51:52 +01:00
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
2020-03-10 12:01:15 +01:00
@@ -353,7 +353,9 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
2020-02-19 04:51:52 +01:00
Block block = iblockdata.getBlock();
// CraftBukkit start - capture blockstates
+ boolean capturedBlockState = false; //Paper - fix blockstate capture undoing
if (this.captureBlockStates && !this.capturedBlockStates.containsKey(blockposition)) {
+ capturedBlockState = true; //Paper - fix blockstate capture undoing
CraftBlockState blockstate = (CraftBlockState) world.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()).getState(); // Paper - use CB getState to get a suitable snapshot
this.capturedBlockStates.put(blockposition.immutableCopy(), blockstate);
}
2020-03-10 12:01:15 +01:00
@@ -364,7 +366,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
2020-02-19 04:51:52 +01:00
if (iblockdata1 == null) {
// CraftBukkit start - remove blockstate if failed
- if (this.captureBlockStates) {
+ if (/*this.captureBlockStates*/ capturedBlockState) { //Paper - fix blockstate capture undoing
this.capturedBlockStates.remove(blockposition);
}
// CraftBukkit end
--
2020-03-15 21:03:36 +01:00
2.25.1
2020-02-19 04:51:52 +01:00