Update eigencraft patch from PaperPR

This commit is contained in:
William Blake Galbreath
2020-08-15 07:26:55 -05:00
parent 0f369fdcb4
commit d7dca8c671

View File

@@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: theosib <millerti@172.16.221.1>
Date: Thu, 27 Sep 2018 01:43:35 -0600
Subject: [PATCH] PaperPR - Optimize redstone algorithm
Subject: [PATCH] Optimize redstone algorithm
Author: theosib <millerti@172.16.221.1>
Co-authored-by: egg82 <phantom_zero@ymail.com>
@@ -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 fedea8106..56f1b4b5d 100644
index fedea81067..56f1b4b5d2 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -655,4 +655,14 @@ public class PaperWorldConfig {
@@ -39,7 +39,7 @@ index fedea8106..56f1b4b5d 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..b69803cbf
index 0000000000..b69803cbf2
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/util/RedstoneWireTurbo.java
@@ -0,0 +1,915 @@
@@ -959,7 +959,7 @@ index 000000000..b69803cbf
+ }
+}
diff --git a/src/main/java/net/minecraft/server/BlockRedstoneWire.java b/src/main/java/net/minecraft/server/BlockRedstoneWire.java
index 7b3ccded0..6abc3d4cf 100644
index 7b3ccded04..7f9ca45d40 100644
--- a/src/main/java/net/minecraft/server/BlockRedstoneWire.java
+++ b/src/main/java/net/minecraft/server/BlockRedstoneWire.java
@@ -1,5 +1,7 @@
@@ -979,7 +979,7 @@ index 7b3ccded0..6abc3d4cf 100644
public BlockRedstoneWire(BlockBase.Info blockbase_info) {
super(blockbase_info);
@@ -212,6 +214,120 @@ public class BlockRedstoneWire extends Block {
@@ -212,6 +214,121 @@ public class BlockRedstoneWire extends Block {
return iblockdata.d(iblockaccess, blockposition, EnumDirection.UP) || iblockdata.a(Blocks.HOPPER);
}
@@ -995,6 +995,7 @@ index 7b3ccded0..6abc3d4cf 100644
+ private void updateSurroundingRedstone(World worldIn, BlockPosition pos, IBlockData state, BlockPosition source) {
+ if (worldIn.paperConfig.useEigencraftRedstone) {
+ turbo.updateSurroundingRedstone(worldIn, pos, state, source);
+ return;
+ }
+ a(worldIn, pos, state);
+ }
@@ -1100,7 +1101,7 @@ index 7b3ccded0..6abc3d4cf 100644
private void a(World world, BlockPosition blockposition, IBlockData iblockdata) {
int i = this.a(world, blockposition);
@@ -281,6 +397,8 @@ public class BlockRedstoneWire extends Block {
@@ -281,6 +398,8 @@ public class BlockRedstoneWire extends Block {
return Math.max(i, j - 1);
}
@@ -1109,7 +1110,7 @@ index 7b3ccded0..6abc3d4cf 100644
private int o(IBlockData iblockdata) {
return iblockdata.a((Block) this) ? (Integer) iblockdata.get(BlockRedstoneWire.POWER) : 0;
}
@@ -303,7 +421,7 @@ public class BlockRedstoneWire extends Block {
@@ -303,7 +422,7 @@ public class BlockRedstoneWire extends Block {
@Override
public void onPlace(IBlockData iblockdata, World world, BlockPosition blockposition, IBlockData iblockdata1, boolean flag) {
if (!iblockdata1.a(iblockdata.getBlock()) && !world.isClientSide) {
@@ -1118,7 +1119,7 @@ index 7b3ccded0..6abc3d4cf 100644
Iterator iterator = EnumDirection.EnumDirectionLimit.VERTICAL.iterator();
while (iterator.hasNext()) {
@@ -330,7 +448,7 @@ public class BlockRedstoneWire extends Block {
@@ -330,7 +449,7 @@ public class BlockRedstoneWire extends Block {
world.applyPhysics(blockposition.shift(enumdirection), this);
}
@@ -1127,7 +1128,7 @@ index 7b3ccded0..6abc3d4cf 100644
this.d(world, blockposition);
}
}
@@ -365,7 +483,7 @@ public class BlockRedstoneWire extends Block {
@@ -365,7 +484,7 @@ public class BlockRedstoneWire extends Block {
public void doPhysics(IBlockData iblockdata, World world, BlockPosition blockposition, Block block, BlockPosition blockposition1, boolean flag) {
if (!world.isClientSide) {
if (iblockdata.canPlace(world, blockposition)) {
@@ -1137,7 +1138,7 @@ index 7b3ccded0..6abc3d4cf 100644
c(iblockdata, world, blockposition);
world.a(blockposition, false);
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 6cc37f5b9..a4bb58136 100644
index 6cc37f5b99..a4bb581367 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -614,6 +614,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {