diff options
author | Mark Vainomaa <[email protected]> | 2020-01-17 04:10:57 +0200 |
---|---|---|
committer | Zach <[email protected]> | 2020-01-16 20:10:57 -0600 |
commit | 0a8414c4042f2b00368115f9b8e37f0ec24b0bbf (patch) | |
tree | 6193526570891e517a0ec38e249617721b65dd85 | |
parent | 2ecb1c64831cf4bf944a76706b88505b9dcd5eaf (diff) | |
download | Paper-0a8414c4042f2b00368115f9b8e37f0ec24b0bbf.tar.gz Paper-0a8414c4042f2b00368115f9b8e37f0ec24b0bbf.zip |
Fix dupe with Eigencraft redstone implementation (#2866)
-rw-r--r-- | Spigot-Server-Patches/0339-Optimize-redstone-algorithm.patch | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/Spigot-Server-Patches/0339-Optimize-redstone-algorithm.patch b/Spigot-Server-Patches/0339-Optimize-redstone-algorithm.patch index e578671343..7696032053 100644 --- a/Spigot-Server-Patches/0339-Optimize-redstone-algorithm.patch +++ b/Spigot-Server-Patches/0339-Optimize-redstone-algorithm.patch @@ -1,4 +1,4 @@ -From 0834959b160570b5a53a63d118ae4c460e857aed Mon Sep 17 00:00:00 2001 +From 0eed64a22346b109b59a6ed9c885b2426f86bfb9 Mon Sep 17 00:00:00 2001 From: theosib <[email protected]> Date: Thu, 27 Sep 2018 01:43:35 -0600 Subject: [PATCH] Optimize redstone algorithm @@ -19,7 +19,7 @@ Aside from making the obvious class/function renames and obfhelpers I didn't nee Just added Bukkit's event system and took a few liberties with dead code and comment misspellings. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index c7ff264cb..1ad6d6483 100644 +index e26aadfb0..cf9470057 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -439,4 +439,14 @@ public class PaperWorldConfig { @@ -39,10 +39,10 @@ index c7ff264cb..1ad6d6483 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; @@ -1144,5 +1147,5 @@ index dc0d89ee6..6189935bd 100644 int i = 0; EnumDirection[] aenumdirection = World.a; -- -2.23.0 +2.24.1 |