Skip to content

Commit

Permalink
Placing locked hopper no longer send NC updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Fortern authored and Lumine1909 committed Sep 15, 2024
1 parent 87740d5 commit 1c05ade
Showing 1 changed file with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Fortern <[email protected]>
Date: Sat, 20 Jan 2024 02:50:56 +0800
Subject: [PATCH] Placing locked hopper no longer send NC updates


diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 3f8113b22ebbb7ff783308033edcf10259dc0e82..cacc6876ed4dc27d090f9d046fe8a4634f240176 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -51,6 +51,7 @@ import net.minecraft.world.level.biome.BiomeManager;
import net.minecraft.world.level.block.BaseFireBlock;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
+import net.minecraft.world.level.block.HopperBlock;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.TickingBlockEntity;
import net.minecraft.world.level.block.state.BlockState;
@@ -1030,7 +1031,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
}

if ((i & 1) != 0) {
- this.blockUpdated(blockposition, iblockdata1.getBlock());
+ if (!(iblockdata.getBlock() instanceof HopperBlock) || iblockdata.getValue(HopperBlock.ENABLED)) { // Leaves - Placing locked hopper doesn't send NC updates.
+ this.blockUpdated(blockposition, iblockdata1.getBlock());
+ } // Leaves
if (!this.isClientSide && iblockdata.hasAnalogOutputSignal()) {
this.updateNeighbourForOutputSignal(blockposition, newBlock.getBlock());
}

0 comments on commit 1c05ade

Please sign in to comment.