diff options
author | Mark Vainomaa <[email protected]> | 2020-01-17 04:14:29 +0200 |
---|---|---|
committer | Zach <[email protected]> | 2020-01-16 20:14:29 -0600 |
commit | f28cd6653881806ba88a257ef69d3a64bfefca59 (patch) | |
tree | c944a719835b6544153b486c3e848d836b01b535 | |
parent | 3adc8eb6e6a4b9f174ff3719af62f34374360619 (diff) | |
download | Paper-f28cd6653881806ba88a257ef69d3a64bfefca59.tar.gz Paper-f28cd6653881806ba88a257ef69d3a64bfefca59.zip |
Fix dupe with Eigencraft redstone implementation (#2867)
-rw-r--r-- | Spigot-Server-Patches/0394-Optimize-redstone-algorithm.patch | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/Spigot-Server-Patches/0394-Optimize-redstone-algorithm.patch b/Spigot-Server-Patches/0394-Optimize-redstone-algorithm.patch index e9ddd44e51..c578240744 100644 --- a/Spigot-Server-Patches/0394-Optimize-redstone-algorithm.patch +++ b/Spigot-Server-Patches/0394-Optimize-redstone-algorithm.patch @@ -1,4 +1,4 @@ -From 38967270f42cbfe7456f9f4a901b2a8dbf8fc057 Mon Sep 17 00:00:00 2001 +From 99c8dd0cc669c7285ba4571865ff27ae02eb3469 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 61ad2cef7b..a70a64070e 100644 +index 61ad2cef7..a70a64070 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -588,4 +588,14 @@ public class PaperWorldConfig { @@ -39,10 +39,10 @@ index 61ad2cef7b..a70a64070e 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 0000000000..21d9d6d7ed +index 000000000..f3add024f --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/util/RedstoneWireTurbo.java -@@ -0,0 +1,910 @@ +@@ -0,0 +1,913 @@ +package com.destroystokyo.paper.util; + +import java.util.List; @@ -936,8 +936,11 @@ index 0000000000..21d9d6d7ed + // 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; @@ -954,7 +957,7 @@ index 0000000000..21d9d6d7ed + } +} diff --git a/src/main/java/net/minecraft/server/BlockRedstoneWire.java b/src/main/java/net/minecraft/server/BlockRedstoneWire.java -index 2e30270bb7..72d2617071 100644 +index 2e30270bb..72d261707 100644 --- a/src/main/java/net/minecraft/server/BlockRedstoneWire.java +++ b/src/main/java/net/minecraft/server/BlockRedstoneWire.java @@ -1,5 +1,7 @@ @@ -1122,7 +1125,7 @@ index 2e30270bb7..72d2617071 100644 iblockdata.a(world, blockposition, 0); world.setAir(blockposition); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 94e189a550..d790fd89f7 100644 +index 94e189a55..d790fd89f 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -648,6 +648,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -1142,5 +1145,5 @@ index 94e189a550..d790fd89f7 100644 int i = 0; EnumDirection[] aenumdirection = World.a; -- -2.21.0 +2.24.1 |