aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0316-Validate-tripwire-hook-placement-before-update.patch
blob: b607c1afe96f8647c44a0847ef65ca28ee7a9358 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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
index 1240f18b3d40f8bde2346c893304ae340a727e24..c2589f42c467ca672417c24076313da51bb2dcbb 100644
--- a/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java
@@ -191,6 +191,7 @@ public class TripWireHookBlock extends Block {
 
             TripWireHookBlock.emitState(world, pos, flag4, flag5, flag2, flag3);
             if (!flag) {
+                if (world.getBlockState(pos).getBlock() == Blocks.TRIPWIRE_HOOK) // Paper - Validate tripwire hook placement before update
                 world.setBlock(pos, (BlockState) iblockdata3.setValue(TripWireHookBlock.FACING, enumdirection), 3);
                 if (flag1) {
                     TripWireHookBlock.notifyNeighbors(block, world, pos, enumdirection);