3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-16 03:20:07 +01:00

fix tripwire hook BlockPlaceEvent (fixes #2969) (#2971)

Dieser Commit ist enthalten in:
Gergely Sarkozi 2020-02-19 04:51:52 +01:00 committet von GitHub
Ursprung 33a615de43
Commit e1f3b6d033
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -0,0 +1,32 @@
From a9c21212ccc71c68ef17076e300d53a23a7ed836 Mon Sep 17 00:00:00 2001
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
index 3c966b4ab..baad98517 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -349,7 +349,9 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
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);
}
@@ -360,7 +362,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
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
--
2.16.1.windows.4