forked from LeavesMC/Leaves
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Placing locked hopper no longer send NC updates
- Loading branch information
1 parent
87740d5
commit 1c05ade
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
patches/server/0129-Placing-locked-hopper-no-longer-send-NC-updates.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); | ||
} |