9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2026-01-04 15:41:31 +00:00

Update container open passthrough

This commit is contained in:
violetc
2023-11-16 10:26:17 +08:00
parent c5b1beaecb
commit b2f1fb4451

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Container open passthrough
diff --git a/src/main/java/net/minecraft/world/level/block/SignBlock.java b/src/main/java/net/minecraft/world/level/block/SignBlock.java
index 614777d15bcf4141a89d0a0f7bd880526c668ffd..f24bf88440976d6f3e12abe64d319fb6a7205896 100644
index 614777d15bcf4141a89d0a0f7bd880526c668ffd..a9dc9431fab1cbb45119e61be6d7689a34247ed0 100644
--- a/src/main/java/net/minecraft/world/level/block/SignBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/SignBlock.java
@@ -114,6 +114,22 @@ public abstract class SignBlock extends BaseEntityBlock implements SimpleWaterlo
@@ -114,6 +114,25 @@ public abstract class SignBlock extends BaseEntityBlock implements SimpleWaterlo
return InteractionResult.SUCCESS;
} else if (flag2) {
return InteractionResult.SUCCESS;
@@ -22,6 +22,9 @@ index 614777d15bcf4141a89d0a0f7bd880526c668ffd..f24bf88440976d6f3e12abe64d319fb6
+ }
+
+ BlockPos pos1 = pos.relative(hit.getDirection().getOpposite());
+ if (this instanceof WallSignBlock || this instanceof WallHangingSignBlock) {
+ pos1 = pos.relative(state.getValue(HorizontalDirectionalBlock.FACING).getOpposite());
+ }
+ if (world.getBlockEntity(pos1) instanceof net.minecraft.world.level.block.entity.RandomizableContainerBlockEntity) {
+ BlockState state1 = world.getBlockState(pos1);
+ return state1.use(world, player, hand, hit.withPosition(pos1));