Skip to content

Commit

Permalink
Crafter 1 gt delay
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yh-china committed Dec 12, 2023
1 parent f0dba9b commit 7279e57
Show file tree
Hide file tree
Showing 14 changed files with 64 additions and 14 deletions.
9 changes: 7 additions & 2 deletions patches/server/0005-Leaves-Server-Config-And-Command.patch
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ index e815dc2a36343925150c3bcb3a0ef6fded1bc955..afe922d39eeacc7916862a3287a9e97e
.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..bb6a781eee54f7d4906c211d5af98921225436e9
index 0000000000000000000000000000000000000000..a1ca90ea40b4ccd8df290f8cc34d63d390acc87c
--- /dev/null
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -0,0 +1,1054 @@
@@ -0,0 +1,1059 @@
+package top.leavesmc.leaves;
+
+import com.destroystokyo.paper.util.SneakyThrow;
Expand Down Expand Up @@ -1014,6 +1014,11 @@ index 0000000000000000000000000000000000000000..bb6a781eee54f7d4906c211d5af98921
+ copperBulb1gt = getBoolean("settings.modify.minecraft-old.copper-bulb-1gt-delay", copperBulb1gt);
+ }
+
+ public static boolean crafter1gt = false;
+ private static void crafter1gt() {
+ crafter1gt = getBoolean("settings.modify.minecraft-old.crafter-1gt-delay", crafter1gt);
+ }
+
+ public static final class WorldConfig {
+
+ public final String worldName;
Expand Down
2 changes: 1 addition & 1 deletion patches/server/0010-Fakeplayer-support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ index 74ff54724626908a083063c54983e0adfbbf7749..7afc1618f2014df67ca42f00c09e863c
* The start ID for the counter.
*/
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index bb6a781eee54f7d4906c211d5af98921225436e9..2b1c7039aff4102b092e587a2f6ffa27b75748b9 100644
index a1ca90ea40b4ccd8df290f8cc34d63d390acc87c..ae21d3e873b22849cc2f02444624d150e9e3868d 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -8,6 +8,9 @@ import org.bukkit.command.Command;
Expand Down
2 changes: 1 addition & 1 deletion patches/server/0019-Optimize-mob-spawning.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Subject: [PATCH] Optimize mob spawning
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)

diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index 2b1c7039aff4102b092e587a2f6ffa27b75748b9..eef823bb4a2dc572a1053e5ec2ce0979e6678052 100644
index ae21d3e873b22849cc2f02444624d150e9e3868d..d5b4e98214f722e2709f542a1f5c3e19a8b1fabe 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -257,7 +257,7 @@ public final class LeavesConfig {
Expand Down
2 changes: 1 addition & 1 deletion patches/server/0021-Multithreaded-Tracker.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Subject: [PATCH] Multithreaded Tracker
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)

diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index eef823bb4a2dc572a1053e5ec2ce0979e6678052..bd1352e2849f9836cd4fbdf4e4868426b5a01822 100644
index d5b4e98214f722e2709f542a1f5c3e19a8b1fabe..51295f0c5ee66a59a9847c4a4d4a7070fc17f62e 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -271,7 +271,7 @@ public final class LeavesConfig {
Expand Down
2 changes: 1 addition & 1 deletion patches/server/0036-Async-Pathfinding.patch
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)
But Pufferfish patch was ported downstream from the Petal fork

diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index bd1352e2849f9836cd4fbdf4e4868426b5a01822..041339f9470bfa48fea686ce27dc6340fd99e60f 100644
index 51295f0c5ee66a59a9847c4a4d4a7070fc17f62e..3c66bd015c493ab971c12be8e134fdaa13daa935 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -372,7 +372,7 @@ public final class LeavesConfig {
Expand Down
2 changes: 1 addition & 1 deletion patches/server/0051-MC-Technical-Survival-Mode.patch
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ index 5eded2322d604c3a304194926a740818631f36de..797725f7472ed36bf5a1369a7dfe600a
entity.spawnReason == org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CHUNK_GEN)) {
continue;
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index 041339f9470bfa48fea686ce27dc6340fd99e60f..dd8c222661a7facb6f9cd64e19676cfe4eee50a6 100644
index 3c66bd015c493ab971c12be8e134fdaa13daa935..4c9793761cdb6fabddd939d1d9d20bf43e977b8e 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -2,6 +2,7 @@ package top.leavesmc.leaves;
Expand Down
2 changes: 1 addition & 1 deletion patches/server/0055-Leaves-Extra-Yggdrasil-Service.patch
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ index 89a50e07bc79cb0d5353f5a06fa037f3942c5940..760b1fb833fea279062965002686b57f
public final Thread serverThread;
private long nextTickTimeNanos;
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index dd8c222661a7facb6f9cd64e19676cfe4eee50a6..94beb47e3ebc5dca07b388ee856c1bfe820e2174 100644
index 4c9793761cdb6fabddd939d1d9d20bf43e977b8e..6f08cdecbc1175ca2808a4d798252b91341c88eb 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -11,6 +11,7 @@ import org.bukkit.configuration.file.YamlConfiguration;
Expand Down
2 changes: 1 addition & 1 deletion patches/server/0060-Syncmatica-Protocol.patch
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ index 68cc14ef2176dd20ede46af3d62ef0797169b87e..507285757ed8c3997748647947b16b7d
public void tick() {
if (this.ackBlockChangesUpTo > -1) {
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index 94beb47e3ebc5dca07b388ee856c1bfe820e2174..794dac1e308fc73eae3568daae7f87bb3fe2b7ca 100644
index 6f08cdecbc1175ca2808a4d798252b91341c88eb..9214b89a27b2f922971c58f3e49058ea9887959c 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -12,6 +12,7 @@ import top.leavesmc.leaves.command.LeavesCommand;
Expand Down
2 changes: 1 addition & 1 deletion patches/server/0067-Leaves-carpet-support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Leaves carpet support


diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index 794dac1e308fc73eae3568daae7f87bb3fe2b7ca..f671a22f032a0f0a72045c62c9e6cadf24cdd4cb 100644
index 9214b89a27b2f922971c58f3e49058ea9887959c..d9a11d6228f3ea86705503d394e6632deda8e1ef 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -14,6 +14,8 @@ import top.leavesmc.leaves.bot.agent.Actions;
Expand Down
2 changes: 1 addition & 1 deletion patches/server/0077-No-block-update-command.patch
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ index 2708251ebc1995e71fb0e5dca9e158a3005f8a8a..e28351b379677fec356b6efec2d882ee
}
}
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index f671a22f032a0f0a72045c62c9e6cadf24cdd4cb..9c4305131f88c55c3d0bdab3243905f1635fb614 100644
index d9a11d6228f3ea86705503d394e6632deda8e1ef..d90a36e1a512842dc322787cc767239a34e895af 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -11,6 +11,7 @@ import org.bukkit.configuration.file.YamlConfiguration;
Expand Down
2 changes: 1 addition & 1 deletion patches/server/0080-Bladeren-Protocol.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Bladeren Protocol


diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index 9c4305131f88c55c3d0bdab3243905f1635fb614..b4545a591ef311154befd6e9bcc5e5e962335622 100644
index d90a36e1a512842dc322787cc767239a34e895af..73a951413c1518895bf8a0efb6267ba4c57d71e9 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -17,6 +17,8 @@ import top.leavesmc.leaves.protocol.syncmatica.SyncmaticaProtocol;
Expand Down
2 changes: 1 addition & 1 deletion patches/server/0110-Add-Leaves-Auto-Update.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Add Leaves Auto Update


diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index b4545a591ef311154befd6e9bcc5e5e962335622..d7273e0a8a624624dbaacef6e78f5d6d104ee1e4 100644
index 73a951413c1518895bf8a0efb6267ba4c57d71e9..f0caa9a182b1fe2a1b1e0a02c878afc0e61771a1 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -17,6 +17,7 @@ import top.leavesmc.leaves.protocol.syncmatica.SyncmaticaProtocol;
Expand Down
2 changes: 1 addition & 1 deletion patches/server/0121-Villager-infinite-discounts.patch
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ index c3d1d7b525a6f2b708144ebe9bc28dfadcfe11fa..55b4386fc57286548161f9ee91e19e22

private GossipType(String key, int multiplier, int maxReputation, int decay, int shareDecrement) {
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index d7273e0a8a624624dbaacef6e78f5d6d104ee1e4..c48de652b97c8f124ff405b116c02f0e37acfb9e 100644
index f0caa9a182b1fe2a1b1e0a02c878afc0e61771a1..13a723e03fad5d9c65c49beec879ba06bdc598e4 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -20,6 +20,7 @@ import top.leavesmc.leaves.protocol.CarpetServerProtocol.CarpetRules;
Expand Down
45 changes: 45 additions & 0 deletions patches/server/0128-Crafter-1-gt-delay.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: violetc <[email protected]>
Date: Tue, 12 Dec 2023 14:15:54 +0800
Subject: [PATCH] Crafter 1 gt delay


diff --git a/src/main/java/net/minecraft/world/level/block/CrafterBlock.java b/src/main/java/net/minecraft/world/level/block/CrafterBlock.java
index 5afac5007bbd2010bb955eea6331875b52441b80..39072e41f640b6284813bac71fc9154982f31ee9 100644
--- a/src/main/java/net/minecraft/world/level/block/CrafterBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/CrafterBlock.java
@@ -75,7 +75,7 @@ public class CrafterBlock extends BaseEntityBlock {
boolean bl2 = state.getValue(TRIGGERED);
BlockEntity blockEntity = world.getBlockEntity(pos);
if (bl && !bl2) {
- world.scheduleTick(pos, this, 4);
+ world.scheduleTick(pos, this, !top.leavesmc.leaves.LeavesConfig.crafter1gt ? 4 : 1); // Leaves - crafter 1 gt delay
world.setBlock(pos, state.setValue(TRIGGERED, Boolean.valueOf(true)), 2);
this.setBlockEntityTriggered(blockEntity, true);
} else if (!bl && bl2) {
@@ -146,7 +146,7 @@ public class CrafterBlock extends BaseEntityBlock {
}

if (state.getValue(TRIGGERED)) {
- world.scheduleTick(pos, this, 4);
+ world.scheduleTick(pos, this, !top.leavesmc.leaves.LeavesConfig.crafter1gt ? 4 : 1); // Leaves - crafter 1 gt delay
}

}
@@ -174,13 +174,13 @@ public class CrafterBlock extends BaseEntityBlock {
protected void dispenseFrom(BlockState state, ServerLevel world, BlockPos pos) {
BlockEntity optional = world.getBlockEntity(pos);
if (optional instanceof CrafterBlockEntity crafterBlockEntity) {
- Optional<CraftingRecipe> optional = getPotentialResults(world, crafterBlockEntity);
- if (optional.isEmpty()) {
+ Optional<CraftingRecipe> optional1 = getPotentialResults(world, crafterBlockEntity);
+ if (optional1.isEmpty()) {
world.levelEvent(1050, pos, 0);
} else {
crafterBlockEntity.setCraftingTicksRemaining(6);
world.setBlock(pos, state.setValue(CRAFTING, Boolean.valueOf(true)), 2);
- CraftingRecipe craftingRecipe = optional.get();
+ CraftingRecipe craftingRecipe = optional1.get();
ItemStack itemStack = craftingRecipe.assemble(crafterBlockEntity, world.registryAccess());
itemStack.onCraftedBySystem(world);
this.dispenseItem(world, pos, crafterBlockEntity, itemStack, state);

0 comments on commit 7279e57

Please sign in to comment.