9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-22 08:29:22 +00:00
Files
LeavesMC/patches/server/0116-CCE-update-suppression.patch
violetc f40d340092 1.20.6 (#216)
---------

Co-authored-by: MC_XiaoHei <xiaohei.xor7studio@foxmail.com>
Co-authored-by: Bluemangoo <chenfy2006@qq.com>
2024-05-20 23:03:56 +08:00

37 lines
2.1 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 aeb0577abcc0790edaece34939a6756424610dbc..254ae2f75ab25b3b1c2349b593122c3e09c9b981 100644
--- a/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java
@@ -231,17 +231,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.updateSuppressionCrashFix) {
try {
- return AbstractContainerMenu.getRedstoneSignalFromBlockEntity(world.getBlockEntity(pos));
+ return org.leavesmc.leaves.LeavesConfig.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(null, pos);
}
} else {
- return AbstractContainerMenu.getRedstoneSignalFromBlockEntity(world.getBlockEntity(pos));
+ return org.leavesmc.leaves.LeavesConfig.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