Paper/patches/server/0353-Validate-tripwire-hook-placement-before-update.patch

19 Zeilen
1.1 KiB
Diff

2021-06-11 14:02:28 +02:00
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/world/level/block/TripWireHookBlock.java b/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java
2022-06-08 06:06:41 +02:00
index a5f8c7d9d9998eebce7f15e01c157651b9831516..4a516828e5c6abd63511ee7c93fcff11203cf8d0 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java
2022-06-08 06:06:41 +02:00
@@ -175,6 +175,7 @@ public class TripWireHookBlock extends Block {
2021-06-11 14:02:28 +02:00
2022-06-08 06:06:41 +02:00
this.emitState(world, pos, flag4, flag5, flag2, flag3);
2021-06-11 14:02:28 +02:00
if (!beingRemoved) {
+ if (world.getBlockState(pos).getBlock() == Blocks.TRIPWIRE_HOOK) // Paper - validate
world.setBlock(pos, (BlockState) iblockdata3.setValue(TripWireHookBlock.FACING, enumdirection), 3);
if (flag1) {
this.notifyNeighbors(world, pos, enumdirection);