9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-28 03:19:22 +00:00
Files
LeavesMC/patches/server/0126-Placing-locked-hopper-no-longer-send-NC-updates.patch
2024-05-27 14:31:44 +08:00

30 lines
1.7 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Fortern <blueten.ki@gmail.com>
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 ac9647b7232a860b87c0a15aa7971e243d311152..c9e7f2b93a3f5934710864310191433fe6d248d2 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -54,6 +54,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;
@@ -1024,7 +1025,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());
}