@@ -982,10 +982,10 @@ index 0000000000000000000000000000000000000000..22a2547810d0c029f29685faddf7ac21
982
982
+ }
983
983
+ }
984
984
diff --git a/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java b/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java
985
- index 74241146a034c5817cddc608c095d829d765f06a..fdee6b7ba4e5e2ab7c4eec8ee0d402f76e7e9a41 100644
985
+ index 74241146a034c5817cddc608c095d829d765f06a..3cba4921daad4b346a3f964f0fa48e1bb4d634a3 100644
986
986
--- a/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java
987
987
+++ b/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java
988
- @@ -253,6 +253,124 @@ public class RedStoneWireBlock extends Block {
988
+ @@ -253,6 +253,116 @@ public class RedStoneWireBlock extends Block {
989
989
return floor.isFaceSturdy(world, pos, Direction.UP) || floor.is(Blocks.HOPPER);
990
990
}
991
991
@@ -1081,6 +1081,10 @@ index 74241146a034c5817cddc608c095d829d765f06a..fdee6b7ba4e5e2ab7c4eec8ee0d402f7
1081
1081
+ }
1082
1082
+
1083
1083
+ if (i != j) {
1084
+ + org.bukkit.event.block.BlockRedstoneEvent event = new org.bukkit.event.block.BlockRedstoneEvent(worldIn.getWorld().getBlockAt(pos1.getX(), pos1.getY(), pos1.getZ()), i, j);
1085
+ + worldIn.getCraftServer().getPluginManager().callEvent(event);
1086
+ +
1087
+ + j = event.getNewCurrent();
1084
1088
+ state = state.setValue(POWER, j);
1085
1089
+
1086
1090
+ if (worldIn.getBlockState(pos1) == iblockstate) {
@@ -1089,18 +1093,6 @@ index 74241146a034c5817cddc608c095d829d765f06a..fdee6b7ba4e5e2ab7c4eec8ee0d402f7
1089
1093
+ if (worldIn.setBlock(pos1, state, Block.UPDATE_KNOWN_SHAPE | Block.UPDATE_CLIENTS))
1090
1094
+ turbo.updateNeighborShapes(worldIn, pos1, state);
1091
1095
+ }
1092
- +
1093
- + // 1.16(.1?) dropped the need for blocks needing updates.
1094
- + // Whether this is necessary after all is to be seen.
1095
- + // if (!worldIn.paperConfig.useEigencraftRedstone) {
1096
- + // // The new search algorithm keeps track of blocks needing updates in its own data structures,
1097
- + // // so only add anything to blocksNeedingUpdate if we're using the vanilla update algorithm.
1098
- + // this.getBlocksNeedingUpdate().add(pos1);
1099
- + //
1100
- + // for (EnumDirection enumfacing1 : EnumDirection.values()) {
1101
- + // this.getBlocksNeedingUpdate().add(pos1.shift(enumfacing1));
1102
- + // }
1103
- + // }
1104
1096
+ }
1105
1097
+
1106
1098
+ return state;
@@ -1110,15 +1102,15 @@ index 74241146a034c5817cddc608c095d829d765f06a..fdee6b7ba4e5e2ab7c4eec8ee0d402f7
1110
1102
private void updatePowerStrength(Level world, BlockPos pos, BlockState state) {
1111
1103
int i = this.calculateTargetStrength(world, pos);
1112
1104
1113
- @@ -322,6 +440 ,7 @@ public class RedStoneWireBlock extends Block {
1105
+ @@ -322,6 +432 ,7 @@ public class RedStoneWireBlock extends Block {
1114
1106
return Math.max(i, j - 1);
1115
1107
}
1116
1108
1117
1109
+ private int getPower(int min, BlockState iblockdata) { return Math.max(min, getWireSignal(iblockdata)); } // Paper - Optimize redstone
1118
1110
private int getWireSignal(BlockState state) {
1119
1111
return state.is((Block) this) ? (Integer) state.getValue(RedStoneWireBlock.POWER) : 0;
1120
1112
}
1121
- @@ -344,7 +463 ,7 @@ public class RedStoneWireBlock extends Block {
1113
+ @@ -344,7 +455 ,7 @@ public class RedStoneWireBlock extends Block {
1122
1114
@Override
1123
1115
public void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) {
1124
1116
if (!oldState.is(state.getBlock()) && !world.isClientSide) {
@@ -1127,7 +1119,7 @@ index 74241146a034c5817cddc608c095d829d765f06a..fdee6b7ba4e5e2ab7c4eec8ee0d402f7
1127
1119
Iterator iterator = Direction.Plane.VERTICAL.iterator();
1128
1120
1129
1121
while (iterator.hasNext()) {
1130
- @@ -371,7 +490 ,7 @@ public class RedStoneWireBlock extends Block {
1122
+ @@ -371,7 +482 ,7 @@ public class RedStoneWireBlock extends Block {
1131
1123
world.updateNeighborsAt(pos.relative(enumdirection), this);
1132
1124
}
1133
1125
@@ -1136,7 +1128,7 @@ index 74241146a034c5817cddc608c095d829d765f06a..fdee6b7ba4e5e2ab7c4eec8ee0d402f7
1136
1128
this.updateNeighborsOfNeighboringWires(world, pos);
1137
1129
}
1138
1130
}
1139
- @@ -406,7 +525 ,7 @@ public class RedStoneWireBlock extends Block {
1131
+ @@ -406,7 +517 ,7 @@ public class RedStoneWireBlock extends Block {
1140
1132
public void neighborChanged(BlockState state, Level world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, boolean notify) {
1141
1133
if (!world.isClientSide) {
1142
1134
if (state.canSurvive(world, pos)) {
0 commit comments