From 701114058cf52477ec8b88ad2fe6035237e4fb08 Mon Sep 17 00:00:00 2001 From: Mark Vainomaa Date: Fri, 17 Jan 2020 04:07:50 +0200 Subject: [PATCH] Fix dupe with Eigencraft redstone implementation (#2864) --- .../0331-Optimize-redstone-algorithm.patch | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Spigot-Server-Patches/0331-Optimize-redstone-algorithm.patch b/Spigot-Server-Patches/0331-Optimize-redstone-algorithm.patch index 6661a1272..17fc34bdc 100644 --- a/Spigot-Server-Patches/0331-Optimize-redstone-algorithm.patch +++ b/Spigot-Server-Patches/0331-Optimize-redstone-algorithm.patch @@ -1,4 +1,4 @@ -From 9382064df0fb23829f26cfa668d948625c046239 Mon Sep 17 00:00:00 2001 +From 7300336b4ea331e4d37eabd94f391e90cdd03804 Mon Sep 17 00:00:00 2001 From: theosib Date: Thu, 27 Sep 2018 01:43:35 -0600 Subject: [PATCH] Optimize redstone algorithm @@ -39,10 +39,10 @@ index dd5e263d7..357c7cf1d 100644 } diff --git a/src/main/java/com/destroystokyo/paper/util/RedstoneWireTurbo.java b/src/main/java/com/destroystokyo/paper/util/RedstoneWireTurbo.java new file mode 100644 -index 000000000..cf5661f1c +index 000000000..b69803cbf --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/util/RedstoneWireTurbo.java -@@ -0,0 +1,912 @@ +@@ -0,0 +1,915 @@ +package com.destroystokyo.paper.util; + +import java.util.List; @@ -938,8 +938,11 @@ index 000000000..cf5661f1c + // and set it in the world. + // Possible optimization: Don't commit state changes to the world until they + // need to be known by some nearby non-redstone-wire block. -+ state = state.set(BlockRedstoneWire.POWER, Integer.valueOf(j)); -+ worldIn.setTypeAndData(upd.self, state, 2); ++ BlockPosition pos = new BlockPosition(upd.self.getX(), upd.self.getY(), upd.self.getZ()); ++ if (wire.canPlace(null, worldIn, pos)) { ++ state = state.set(BlockRedstoneWire.POWER, Integer.valueOf(j)); ++ worldIn.setTypeAndData(upd.self, state, 2); ++ } + } + + return state;