3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 20:40:07 +01:00
Paper/Spigot-Server-Patches/0442-Validate-tripwire-hook-placement-before-update.patch

19 Zeilen
1.0 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Sat, 7 Mar 2020 00:07:51 +0000
Subject: [PATCH] Validate tripwire hook placement before update
diff --git a/src/main/java/net/minecraft/server/BlockTripwireHook.java b/src/main/java/net/minecraft/server/BlockTripwireHook.java
index 1b9d889af6bdefed0d6a3ebc832c39effb8af0b9..a5e6e94fe0d7702594a842bcfec2fcaae9f19d7f 100644
--- a/src/main/java/net/minecraft/server/BlockTripwireHook.java
+++ b/src/main/java/net/minecraft/server/BlockTripwireHook.java
@@ -149,6 +149,7 @@ public class BlockTripwireHook extends Block {
this.a(world, blockposition, flag4, flag5, flag2, flag3);
if (!flag) {
+ if (world.getType(blockposition).getBlock() == Blocks.TRIPWIRE_HOOK) // Paper - validate
world.setTypeAndData(blockposition, (IBlockData) iblockdata3.set(BlockTripwireHook.FACING, enumdirection), 3);
if (flag1) {
this.a(world, blockposition, enumdirection);