Skip to content

Commit

Permalink
Configurable tripwire dupe
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreeam-qwq committed Dec 25, 2024
1 parent a1415c3 commit e907565
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions patches/server/0137-Configurable-tripwire-dupe.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Dreeam <[email protected]>
Date: Tue, 24 Dec 2024 13:28:56 -0500
Subject: [PATCH] Configurable tripwire dupe

Bring back MC-59471, MC-129055 on 1.21.2+, which fixed in 1.21.2 snapshots 24w33a and 24w36a

diff --git a/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java b/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java
index c2589f42c467ca672417c24076313da51bb2dcbb..fda1f2840f5a79d99217bd0fa72f4a1b1a75eb7e 100644
--- a/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/TripWireHookBlock.java
@@ -206,7 +206,7 @@ public class TripWireHookBlock extends Block {
if (iblockdata4 != null) {
BlockState iblockdata5 = world.getBlockState(blockposition2);

- if (iblockdata5.is(Blocks.TRIPWIRE) || iblockdata5.is(Blocks.TRIPWIRE_HOOK)) {
+ if (org.dreeam.leaf.config.modules.gameplay.ConfigurableTripWireDupe.enabled || iblockdata5.is(Blocks.TRIPWIRE) || iblockdata5.is(Blocks.TRIPWIRE_HOOK)) { // Leaf - Configurable tripwire dupe
world.setBlock(blockposition2, (BlockState) iblockdata4.trySetValue(TripWireHookBlock.ATTACHED, flag4), 3);
}
}
diff --git a/src/main/java/org/dreeam/leaf/config/modules/gameplay/ConfigurableTripWireDupe.java b/src/main/java/org/dreeam/leaf/config/modules/gameplay/ConfigurableTripWireDupe.java
new file mode 100644
index 0000000000000000000000000000000000000000..b259b7023315b4632b05b511695c1f32b7890b9c
--- /dev/null
+++ b/src/main/java/org/dreeam/leaf/config/modules/gameplay/ConfigurableTripWireDupe.java
@@ -0,0 +1,18 @@
+package org.dreeam.leaf.config.modules.gameplay;
+
+import org.dreeam.leaf.config.ConfigModules;
+import org.dreeam.leaf.config.EnumConfigCategory;
+
+public class ConfigurableTripWireDupe extends ConfigModules {
+
+ public String getBasePath() {
+ return EnumConfigCategory.GAMEPLAY.getBaseKeyName();
+ }
+
+ public static boolean enabled = false;
+
+ @Override
+ public void onLoaded() {
+ enabled = config.getBoolean(getBasePath() + ".allow-tripwire-dupe", enabled);
+ }
+}

0 comments on commit e907565

Please sign in to comment.