PaperMC/patches/server/0323-Validate-tripwire-hook-placement-before-update.patch

19 lines
1.1 KiB
Diff
Raw Normal View History

2023-12-05 23:55:31 +01: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
2024-04-24 08:05:14 +02:00
index bc4d324f086d815c139408629a561ea4d94c839b..8614fad5b3df7a6030384b108b1689bf6b9f1209 100644
2023-12-05 23:55:31 +01:00
--- a/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java
2024-04-24 08:05:14 +02:00
@@ -189,6 +189,7 @@ public class TripWireHookBlock extends Block {
2023-12-05 23:55:31 +01:00
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
2023-12-05 23:55:31 +01:00
world.setBlock(pos, (BlockState) iblockdata3.setValue(TripWireHookBlock.FACING, enumdirection), 3);
if (flag1) {
TripWireHookBlock.notifyNeighbors(block, world, pos, enumdirection);