Skip to content

Commit

Permalink
Update Level.java.patch
Browse files Browse the repository at this point in the history
  • Loading branch information
Matyrobbrt committed Jan 22, 2025
1 parent 0beabaf commit 4bfce2e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions patches/net/minecraft/world/level/Level.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,16 @@

public void blockEntityChanged(BlockPos p_151544_) {
if (this.hasChunkAt(p_151544_)) {
@@ -935,16 +_,15 @@
@@ -934,17 +_,20 @@

public abstract Scoreboard getScoreboard();

+ private static final Direction[] NEIGHBOR_UPDATE_LIST = java.util.stream.Stream.concat(Direction.Plane.HORIZONTAL.stream(), Direction.Plane.VERTICAL.stream()).toArray(Direction[]::new);
+
public void updateNeighbourForOutputSignal(BlockPos p_46718_, Block p_46719_) {
- for (Direction direction : Direction.Plane.HORIZONTAL) {
+ for(Direction direction : Direction.values()) {
+ // Neo: Also send update to vertical directions
+ for (Direction direction : NEIGHBOR_UPDATE_LIST) {
BlockPos blockpos = p_46718_.relative(direction);
if (this.hasChunkAt(blockpos)) {
BlockState blockstate = this.getBlockState(blockpos);
Expand All @@ -193,7 +197,8 @@
blockpos = blockpos.relative(direction);
blockstate = this.getBlockState(blockpos);
- if (blockstate.is(Blocks.COMPARATOR)) {
+ if (blockstate.getWeakChanges(this, blockpos)) {
+ // Neo: send to any blockstate that wants weak changes, but exclude vanilla comparators from vertical updates
+ if (blockstate.getWeakChanges(this, blockpos) && (direction.getAxis().isHorizontal() || !blockstate.is(Blocks.COMPARATOR))) {
this.neighborChanged(blockstate, blockpos, p_46719_, null, false);
}
}
Expand Down Expand Up @@ -254,4 +259,4 @@
+ setDayTimeFraction(dayTimeStep - result);
+ return result;
}
}
}

0 comments on commit 4bfce2e

Please sign in to comment.