Skip to content

Commit

Permalink
more optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
AlphaKR93 committed Oct 27, 2024
1 parent 393e079 commit fa3c15b
Show file tree
Hide file tree
Showing 3 changed files with 387 additions and 24 deletions.
26 changes: 2 additions & 24 deletions patches/server/0042-Optimize-advancement-criteria-triggering.patch
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,6 @@ From: AlphaKR93 <[email protected]>
Date: Sun, 27 Oct 2024 00:16:25 +0900
Subject: [PATCH] Optimize advancement criteria triggering

Based on Achievements Optimizer
Copyright (C) 2024 bigenergy, Licensed under MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


diff --git a/src/main/java/net/minecraft/advancements/critereon/InventoryChangeTrigger.java b/src/main/java/net/minecraft/advancements/critereon/InventoryChangeTrigger.java
index ebbad97920df3d1645637e646a98e16cb04d361e..a149c949a042e1d1e504d9f5ce0bfa6df92db2fc 100644
Expand Down Expand Up @@ -52,18 +31,17 @@ index ebbad97920df3d1645637e646a98e16cb04d361e..a149c949a042e1d1e504d9f5ce0bfa6d
int j = 0;
int k = 0;
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
index 9de9b3f2148216df41258d503fa1de896cca4771..e6352488b0fcb0f0332d3d82614930e9c94eb594 100644
index 9de9b3f2148216df41258d503fa1de896cca4771..49bce6e28e12f3729cab5628cf3e0f508a56d0d7 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
@@ -134,4 +134,17 @@ public class GlobalConfiguration extends ConfigurationPart {
@@ -134,4 +134,16 @@ public class GlobalConfiguration extends ConfigurationPart {

}

+ public Advancements advancements;
+ public class Advancements extends ConfigurationPart {
+
+ int criteriaTriggerIdleTick = OPTIMIZE ? 5 : 0;
+ public boolean optimizeItemPredicate = OPTIMIZE;
+
+ @PostProcess
+ void post() {
Expand Down
32 changes: 32 additions & 0 deletions patches/server/0043-Configurable-water-flowing-speed.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <[email protected]>
Date: Sun, 27 Oct 2024 13:48:01 +0900
Subject: [PATCH] Configurable water flowing speed


diff --git a/src/main/java/net/minecraft/world/level/material/WaterFluid.java b/src/main/java/net/minecraft/world/level/material/WaterFluid.java
index 9dcdb2f4001115db0c26fdbf86531dbe6098485d..0fc89b33864000a262ec5369708f7aedeaf6dc0b 100644
--- a/src/main/java/net/minecraft/world/level/material/WaterFluid.java
+++ b/src/main/java/net/minecraft/world/level/material/WaterFluid.java
@@ -122,7 +122,7 @@ public abstract class WaterFluid extends FlowingFluid {

@Override
public int getTickDelay(LevelReader world) {
- return 5;
+ return world.getWorldBorder().world.plazmaConfig().block.waterFlowingTick; // Plazma - Configurable water flowing speed
}

@Override
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
index db87e8d98aeeeb89566dac8f94c02846cb287fb9..f3ac159231768b9b39550e6f5fd512c340738e61 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
@@ -91,6 +91,8 @@ public class WorldConfigurations extends ConfigurationPart {
public Block block;
public class Block extends ConfigurationPart {

+ public int waterFlowingTick = 5;
+
public OptimizeFarmCheck optimizeFarmCheck;
public class OptimizeFarmCheck extends ConfigurationPart {

Loading

0 comments on commit fa3c15b

Please sign in to comment.