mirror of
https://github.com/LeavesMC/Leaves.git
synced 2025-12-30 12:29:18 +00:00
Container open passthrough (#57)
This commit is contained in:
@@ -128,10 +128,10 @@ index 35d2da9d91dcdd89de7c0f4af028fd182376ea8d..d73482fb1e71fe2951e96ae0593de268
|
||||
.withRequiredArg()
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..24bbcab59ebe153516e602180db0b0353b9dffde
|
||||
index 0000000000000000000000000000000000000000..8a2b48542be4c40898464f79ac332f29e6880c3d
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -0,0 +1,819 @@
|
||||
@@ -0,0 +1,824 @@
|
||||
+package top.leavesmc.leaves;
|
||||
+
|
||||
+import com.destroystokyo.paper.util.SneakyThrow;
|
||||
@@ -776,6 +776,11 @@ index 0000000000000000000000000000000000000000..24bbcab59ebe153516e602180db0b035
|
||||
+ skipSelfRaidCheck = getBoolean("settings.modify.raider-die-skip-self-raid-check", skipSelfRaidCheck);
|
||||
+ }
|
||||
+
|
||||
+ public static boolean containerPassthrough = false;
|
||||
+ private static void containerPassthrough() {
|
||||
+ containerPassthrough = getBoolean("settings.modify.container-passthrough", containerPassthrough);
|
||||
+ }
|
||||
+
|
||||
+ public static final class WorldConfig {
|
||||
+
|
||||
+ public final String worldName;
|
||||
|
||||
33
patches/server/0085-Container-open-passthrough.patch
Normal file
33
patches/server/0085-Container-open-passthrough.patch
Normal file
@@ -0,0 +1,33 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: violetc <58360096+s-yh-china@users.noreply.github.com>
|
||||
Date: Mon, 17 Jul 2023 11:41:50 +0800
|
||||
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 f7fda6fb4e908869310c783e68f7ad7025840592..be4dd47eec1d002165e7ebca5249728ed5fd68a9 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/SignBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/SignBlock.java
|
||||
@@ -96,6 +96,22 @@ public abstract class SignBlock extends BaseEntityBlock implements SimpleWaterlo
|
||||
return InteractionResult.SUCCESS;
|
||||
} else if (bl3) {
|
||||
return InteractionResult.SUCCESS;
|
||||
+ // Leaves start - signContainerPassthrough
|
||||
+ } else if (top.leavesmc.leaves.LeavesConfig.containerPassthrough) {
|
||||
+ if (item == net.minecraft.world.item.Items.AIR && player.isShiftKeyDown()) {
|
||||
+ if (!this.otherPlayerIsEditingSign(player, signBlockEntity) && player.mayBuild() && this.hasEditableText(player, signBlockEntity, bl2)) {
|
||||
+ this.openTextEdit(player, signBlockEntity, bl2);
|
||||
+ return InteractionResult.SUCCESS;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ BlockPos pos1 = pos.relative(hit.getDirection().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));
|
||||
+ }
|
||||
+ return InteractionResult.PASS;
|
||||
+ // Leaves end - signContainerPassthrough
|
||||
} else if (!this.otherPlayerIsEditingSign(player, signBlockEntity) && player.mayBuild() && this.hasEditableText(player, signBlockEntity, bl2)) {
|
||||
this.openTextEdit(player, signBlockEntity, bl2);
|
||||
return InteractionResult.SUCCESS;
|
||||
Reference in New Issue
Block a user