Skip to content

Commit

Permalink
Update container open passthrough
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yh-china committed Nov 16, 2023
1 parent c5b1bea commit b2f1fb4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions patches/server/0079-Container-open-passthrough.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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));
Expand Down

0 comments on commit b2f1fb4

Please sign in to comment.