Files
OldSliceMC/patches/server/0006-Allow-opening-covered-chests.patch

44 lines
2.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Cryptite <cryptite@gmail.com>
Date: Thu, 23 Sep 2021 09:08:06 -0500
Subject: [PATCH] Allow opening covered chests
diff --git a/src/main/java/net/minecraft/world/level/block/ChestBlock.java b/src/main/java/net/minecraft/world/level/block/ChestBlock.java
index eecb8c089b5f426b1395b47f714af32c210555ef..8a9bdc75396b9d3561dbb64010842945533bbdaa 100644
--- a/src/main/java/net/minecraft/world/level/block/ChestBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/ChestBlock.java
@@ -349,9 +349,10 @@ public class ChestBlock extends AbstractChestBlock<ChestBlockEntity> implements
}
private static boolean isBlockedChestByBlock(BlockGetter world, BlockPos pos) {
- BlockPos blockposition1 = pos.above();
-
- return world.getBlockState(blockposition1).isRedstoneConductor(world, blockposition1);
+ return false;
+// BlockPos blockposition1 = pos.above();
+//
+// return world.getBlockState(blockposition1).isRedstoneConductor(world, blockposition1);
}
private static boolean isCatSittingOnChest(LevelAccessor world, BlockPos pos) {
diff --git a/src/main/java/net/minecraft/world/level/block/EnderChestBlock.java b/src/main/java/net/minecraft/world/level/block/EnderChestBlock.java
index 7e45c97acce83a9fe8ada486e9fcdafe58769736..80e30b978455890506ef555773983dd4058185e3 100644
--- a/src/main/java/net/minecraft/world/level/block/EnderChestBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/EnderChestBlock.java
@@ -77,10 +77,10 @@ public class EnderChestBlock extends AbstractChestBlock<EnderChestBlockEntity> i
PlayerEnderChestContainer playerEnderChestContainer = player.getEnderChestInventory();
BlockEntity blockEntity = world.getBlockEntity(pos);
if (playerEnderChestContainer != null && blockEntity instanceof EnderChestBlockEntity) {
- BlockPos blockPos = pos.above();
- if (world.getBlockState(blockPos).isRedstoneConductor(world, blockPos)) {
- return InteractionResult.sidedSuccess(world.isClientSide);
- } else if (world.isClientSide) {
+// BlockPos blockPos = pos.above();
+// if (world.getBlockState(blockPos).isRedstoneConductor(world, blockPos)) {
+// return InteractionResult.sidedSuccess(world.isClientSide);
+ if (world.isClientSide) {
return InteractionResult.SUCCESS;
} else {
EnderChestBlockEntity enderChestBlockEntity = (EnderChestBlockEntity)blockEntity;