9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-30 12:29:18 +00:00
Files
LeavesMC/patches/server/0097-CCE-update-suppression.patch
violetc de4f3fe832 1.21.3 (#382)
---------

Co-authored-by: Lumine1909 <133463833+Lumine1909@users.noreply.github.com>
2024-12-02 12:52:54 +08:00

46 lines
2.8 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: violetc <58360096+s-yh-china@users.noreply.github.com>
Date: Thu, 28 Sep 2023 17:07:02 +0800
Subject: [PATCH] CCE update suppression
diff --git a/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java b/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java
index b7c1050dfafa79f3ed86524ce37cd06651cbbdd9..b01918fc97926a3182c21145bb7411e7bc409d35 100644
--- a/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java
@@ -182,7 +182,7 @@ public class ShulkerBoxBlock extends BaseEntityBlock {
protected void onRemove(BlockState state, Level world, BlockPos pos, BlockState newState, boolean moved) {
if (!state.is(newState.getBlock())) {
BlockEntity blockEntity = world.getBlockEntity(pos);
- super.onRemove(state, world, pos, newState, moved);
+ if (!org.leavesmc.leaves.LeavesConfig.modify.oldMC.oldBlockEntityBehaviour) super.onRemove(state, world, pos, newState, moved); // Leaves - behaviour 1.21.1-
if (blockEntity instanceof ShulkerBoxBlockEntity) {
world.updateNeighbourForOutputSignal(pos, state.getBlock());
}
@@ -239,17 +239,21 @@ public class ShulkerBoxBlock extends BaseEntityBlock {
@Override
protected int getAnalogOutputSignal(BlockState state, Level world, BlockPos pos) {
- // Leaves start - fix update suppression crash
+ // Leaves start - fix update suppression crash - and cce fix
if (org.leavesmc.leaves.LeavesConfig.modify.updateSuppressionCrashFix) {
try {
- return AbstractContainerMenu.getRedstoneSignalFromBlockEntity(world.getBlockEntity(pos));
+ return org.leavesmc.leaves.LeavesConfig.modify.oldMC.updater.cceUpdateSuppression ?
+ AbstractContainerMenu.getRedstoneSignalFromContainer((net.minecraft.world.Container) world.getBlockEntity(pos)) :
+ AbstractContainerMenu.getRedstoneSignalFromBlockEntity(world.getBlockEntity(pos));
} catch (ClassCastException ex) {
throw new org.leavesmc.leaves.util.UpdateSuppressionException(pos, this);
}
} else {
- return AbstractContainerMenu.getRedstoneSignalFromBlockEntity(world.getBlockEntity(pos));
+ return org.leavesmc.leaves.LeavesConfig.modify.oldMC.updater.cceUpdateSuppression ?
+ AbstractContainerMenu.getRedstoneSignalFromContainer((net.minecraft.world.Container) world.getBlockEntity(pos)) :
+ AbstractContainerMenu.getRedstoneSignalFromBlockEntity(world.getBlockEntity(pos));
}
- // Leaves end - fix update suppression crash
+ // Leaves end - fix update suppression crash - and cce fix
}
@Override