From 1c33d683c82630c5ad219c070d45fb906a361819 Mon Sep 17 00:00:00 2001 From: AlphaKR93 Date: Fri, 29 Sep 2023 21:15:02 +0900 Subject: [PATCH] More patches --- .github/workflows/build.yml | 13 ++- ...024-Improve-biome-temperature-cache.patch} | 4 +- .../server/0025-Implement-FixMySpawnR.patch | 85 +++++++++++++++++++ .../0026-Configurable-sensor-tick.patch} | 35 +++----- .../0028-FixMySpawnR-Configuration.patch | 23 ----- .../server/0029-Implement-FixMySpawnR.patch | 67 --------------- 6 files changed, 113 insertions(+), 114 deletions(-) rename patches/server/{0024-ImproveBiomeTemperatureCache.patch => 0024-Improve-biome-temperature-cache.patch} (91%) create mode 100644 patches/server/0025-Implement-FixMySpawnR.patch rename patches/{unapplied/server/0032-Configurable-Sensor-Tick.patch => server/0026-Configurable-sensor-tick.patch} (59%) delete mode 100644 patches/unapplied/server/0028-FixMySpawnR-Configuration.patch delete mode 100644 patches/unapplied/server/0029-Implement-FixMySpawnR.patch diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b8faa362d..4802bfbe2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -84,6 +84,7 @@ jobs: Plazma-API/build/docs/javadoc - name: Get Release Number + if: startsWith(github.ref_name, 'ver/') run: echo "RELEASE=$(git ls-remote --tags origin | grep "release" | wc -l)" >> $GITHUB_ENV - name: Release Artifacts @@ -96,7 +97,7 @@ jobs: files: build/libs/*.jar prerelease: false - - name: Release Artifacts (Latest) + - name: Release Artifacts (Latest/Stable) if: startsWith(github.ref_name, 'ver/') uses: marvinpinto/action-automatic-releases@latest with: @@ -105,3 +106,13 @@ jobs: repo_token: "${{ secrets.GH_PAT }}" files: build/libs/*.jar prerelease: false + + - name: Release Artifacts (Latest/Development) + if: startsWith(github.ref_name, 'dev/') + uses: marvinpinto/action-automatic-releases@latest + with: + title: "Development build for ${{ env.MC_VERSION }}" + automatic_release_tag: dev-${{ env.MC_VERSION }} + repo_token: "${{ secrets.GH_PAT }}" + files: build/libs/*.jar + prerelease: false diff --git a/patches/server/0024-ImproveBiomeTemperatureCache.patch b/patches/server/0024-Improve-biome-temperature-cache.patch similarity index 91% rename from patches/server/0024-ImproveBiomeTemperatureCache.patch rename to patches/server/0024-Improve-biome-temperature-cache.patch index d9aab3a7e..98b6241c3 100644 --- a/patches/server/0024-ImproveBiomeTemperatureCache.patch +++ b/patches/server/0024-Improve-biome-temperature-cache.patch @@ -1,11 +1,11 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: AlphaKR93 Date: Thu, 28 Sep 2023 12:33:14 +0900 -Subject: [PATCH] ImproveBiomeTemperatureCache +Subject: [PATCH] Improve biome temperature cache diff --git a/src/main/java/net/minecraft/world/level/biome/Biome.java b/src/main/java/net/minecraft/world/level/biome/Biome.java -index ed439b7e94646141c93a7dd3704d1cdeb5c27e16..8c51973491005faa03c866c8472918d0817965ed 100644 +index ed439b7e94646141c93a7dd3704d1cdeb5c27e16..71880b6fde3a287aa75c3799ffdd82a7943bb9db 100644 --- a/src/main/java/net/minecraft/world/level/biome/Biome.java +++ b/src/main/java/net/minecraft/world/level/biome/Biome.java @@ -67,7 +67,7 @@ public final class Biome { diff --git a/patches/server/0025-Implement-FixMySpawnR.patch b/patches/server/0025-Implement-FixMySpawnR.patch new file mode 100644 index 000000000..7d132e256 --- /dev/null +++ b/patches/server/0025-Implement-FixMySpawnR.patch @@ -0,0 +1,85 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: AlphaKR93 +Date: Fri, 29 Sep 2023 21:10:26 +0900 +Subject: [PATCH] Implement FixMySpawnR + + +diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java +index 64d911bee1607880514061c75116d8672df8bb8f..61c2d84c136da81a0d6c286b4875b010f8ef9328 100644 +--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java ++++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java +@@ -46,6 +46,8 @@ public abstract class BaseSpawner { + public int requiredPlayerRange = 16; + public int spawnRange = 4; + private int tickDelay = 0; // Paper ++ private int blockExistsTick = 0; // Plazma - Implement FixMySpawnR ++ private boolean blockLockedByTime = false; // Plazma - Implement FixMySpawnR + + public BaseSpawner() {} + +@@ -81,6 +83,17 @@ public abstract class BaseSpawner { + } + + public void serverTick(ServerLevel world, BlockPos pos) { ++ // Plazma start - Implement FixMySpawnR ++ if (world.plazmaLevelConfiguration().entity.spawning.deadlockTimer.enabled) { ++ if (!this.blockLockedByTime) { ++ if (this.blockExistsTick > world.plazmaLevelConfiguration().entity.spawning.deadlockTimer.timerTimeout) ++ blockLockedByTime = true; ++ else blockExistsTick++; ++ } ++ ++ if (blockLockedByTime && world.getBestNeighborSignal(pos) > 0) return; ++ } ++ // Plazma end + if (spawnCount <= 0 || maxNearbyEntities <= 0) return; // Paper - Ignore impossible spawn tick + // Paper start - Configurable mob spawner tick rate + if (spawnDelay > 0 && --tickDelay > 0) return; +@@ -286,6 +299,13 @@ public abstract class BaseSpawner { + this.spawnRange = nbt.getShort("SpawnRange"); + } + ++ // Plazma start - Implement FixMySpawnR ++ if (world.plazmaLevelConfiguration().entity.spawning.deadlockTimer.enabled && nbt.contains("Plazma.SpawnerTicks", 99)) { ++ this.blockExistsTick = nbt.getInt("Plazma.SpawnerTicks"); ++ this.blockLockedByTime = nbt.getBoolean("Plazma.SpawnerLocked"); ++ } ++ // Plazma end ++ + this.displayEntity = null; + } + +@@ -314,6 +334,9 @@ public abstract class BaseSpawner { + })); + } + ++ nbt.putInt("Plazma.SpawnerTicks", this.blockExistsTick); // Plazma - Implement FixMySpawnR ++ nbt.putBoolean("Plazma.SpawnerLocked", this.blockLockedByTime); // Plazma - Implement FixMySpawnR ++ + nbt.put("SpawnPotentials", (Tag) SpawnData.LIST_CODEC.encodeStart(NbtOps.INSTANCE, this.spawnPotentials).result().orElseThrow()); + return nbt; + } +diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java +index 914cc4f9a5598d2d70c7338d7cfc9be0fe5f0e31..bb0f561f0b0d71697de52c834d2ed1798b2022df 100644 +--- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java ++++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java +@@ -49,6 +49,19 @@ public class LevelConfigurations extends ConfigurationPart { + + } + ++ public Spawning spawning; ++ public class Spawning extends ConfigurationPart { ++ ++ public DeadlockTimer deadlockTimer; ++ public class DeadlockTimer extends ConfigurationPart { ++ ++ public boolean enabled = DO_OPTIMIZE; ++ public int timerTimeout = 0; ++ ++ } ++ ++ } ++ + } + + public Structure structure; diff --git a/patches/unapplied/server/0032-Configurable-Sensor-Tick.patch b/patches/server/0026-Configurable-sensor-tick.patch similarity index 59% rename from patches/unapplied/server/0032-Configurable-Sensor-Tick.patch rename to patches/server/0026-Configurable-sensor-tick.patch index 6059c5973..780ba9a6a 100644 --- a/patches/unapplied/server/0032-Configurable-Sensor-Tick.patch +++ b/patches/server/0026-Configurable-sensor-tick.patch @@ -1,42 +1,35 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: IPECTER -Date: Wed, 3 May 2023 16:51:49 +0900 -Subject: [PATCH] Configurable Sensor Tick +From: AlphaKR93 +Date: Fri, 29 Sep 2023 21:12:38 +0900 +Subject: [PATCH] Configurable sensor tick -Original: Bloom-host/Petal -Copyright (C) 2023 peaches94 diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index 5dd0c925af627f7159289dc1e3e79bc593c421f2..699b166b6438cbe0cd197547df4d8dc4359e0b34 100644 +index fb5c21ba15995d00da87ee6ef9e4ab8f6678d67f..4710f85197bc80e554cc1b2b84058c8dc8049c1f 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -935,10 +935,11 @@ public abstract class Mob extends LivingEntity implements Targeting { +@@ -938,10 +938,10 @@ public abstract class Mob extends LivingEntity implements Targeting { } // Paper end //this.level().getProfiler().push("sensing"); // Purpur - this.sensing.tick(); -+ //this.sensing.tick(); // Plazma - moved down (configurable sensor tick) //this.level().getProfiler().pop(); // Purpur int i = this.level().getServer().getTickCount() + this.getId(); -+ if (i % this.level().plazmaLevelConfiguration().entity.sensor.tick == 0) this.sensing.tick(); // Plazma - Configurable Sensor Tick ++ if (i % this.level().plazmaLevelConfiguration().entity.sensorTick == 0) this.sensing.tick(); // Plazma - moved down if (i % 2 != 0 && this.tickCount > 1) { //this.level().getProfiler().push("targetSelector"); // Purpur if (this.targetSelector.inactiveTick(this.activatedPriority, false)) // Pufferfish - use this to alternate ticking diff --git a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java -index 61c06213b4ceb8e38e9aa41c3517f152d0d669ad..8dadc3fd21d507bf88f7f75935f7477375f21344 100644 +index bb0f561f0b0d71697de52c834d2ed1798b2022df..6711b3d93eb5292314bcd89280d88f367eada9df 100644 --- a/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java +++ b/src/main/java/org/plazmamc/plazma/configurations/LevelConfigurations.java -@@ -107,5 +107,12 @@ public class LevelConfigurations extends ConfigurationPart { +@@ -33,6 +33,8 @@ public class LevelConfigurations extends ConfigurationPart { + public Entity entity; + public class Entity extends ConfigurationPart { - } - -+ public Sensor sensor; -+ public class Sensor extends ConfigurationPart { -+ -+ public int tick = DO_OPTIMIZE ? 10 : 1; ++ public int sensorTick = DO_OPTIMIZE ? 10 : 1; + -+ } -+ - } - } + public boolean ignoreUselessPackets = DO_OPTIMIZE; + + public Player player; diff --git a/patches/unapplied/server/0028-FixMySpawnR-Configuration.patch b/patches/unapplied/server/0028-FixMySpawnR-Configuration.patch deleted file mode 100644 index 51709866a..000000000 --- a/patches/unapplied/server/0028-FixMySpawnR-Configuration.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: IPECTER -Date: Sun, 26 Mar 2023 16:20:13 +0900 -Subject: [PATCH] FixMySpawnR Configuration - - -diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java -index 2033c7ff519e30f507e6535004687eb49c08c33b..b2c9ac1947e6c9ad0e693cfeaf6f2f4bfd521aa0 100644 ---- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java -+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java -@@ -62,4 +62,12 @@ public class GlobalConfiguration extends ConfigurationPart { - } - - } -+ -+ public FixMySpawnR fixMySpawnR; -+ public class FixMySpawnR extends ConfigurationPart { -+ -+ public boolean enabled = DO_OPTIMIZE; -+ public int timerTimeOut = 0; -+ -+ } - } diff --git a/patches/unapplied/server/0029-Implement-FixMySpawnR.patch b/patches/unapplied/server/0029-Implement-FixMySpawnR.patch deleted file mode 100644 index a27eee110..000000000 --- a/patches/unapplied/server/0029-Implement-FixMySpawnR.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: IPECTER -Date: Sun, 26 Mar 2023 13:17:24 +0900 -Subject: [PATCH] Implement FixMySpawnR - -Original: AbsolemJackdaw/FixMySpawnR -Copyright (C) 2023 AbsolemJackdaw - -diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java -index 64d911bee1607880514061c75116d8672df8bb8f..4dcf2c5e4efa645572c7a646e7233232c49a130c 100644 ---- a/src/main/java/net/minecraft/world/level/BaseSpawner.java -+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java -@@ -46,6 +46,8 @@ public abstract class BaseSpawner { - public int requiredPlayerRange = 16; - public int spawnRange = 4; - private int tickDelay = 0; // Paper -+ private int blockExistsTick = 0; // Plazma -+ private boolean blockLockedByTime = false; // Plazma - - public BaseSpawner() {} - -@@ -81,6 +83,18 @@ public abstract class BaseSpawner { - } - - public void serverTick(ServerLevel world, BlockPos pos) { -+ // Plazma start - FixMySpawnR -+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().fixMySpawnR.enabled) { -+ if (!blockLockedByTime) { -+ if (blockExistsTick > org.plazmamc.plazma.configurations.GlobalConfiguration.get().fixMySpawnR.timerTimeOut) { -+ blockLockedByTime = true; -+ } else { -+ blockExistsTick++; -+ } -+ } -+ } -+ if (blockLockedByTime && world.getBestNeighborSignal(pos) > 0) return; -+ // Plazma end - if (spawnCount <= 0 || maxNearbyEntities <= 0) return; // Paper - Ignore impossible spawn tick - // Paper start - Configurable mob spawner tick rate - if (spawnDelay > 0 && --tickDelay > 0) return; -@@ -286,6 +300,13 @@ public abstract class BaseSpawner { - this.spawnRange = nbt.getShort("SpawnRange"); - } - -+ // Plazma start - FixMySpawnR -+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().fixMySpawnR.enabled && nbt.contains("SpawnRange", 99)) { -+ this.blockExistsTick = nbt.getInt("fixmyspawnrTicks"); -+ this.blockLockedByTime = nbt.getBoolean("fixMySpawnerLocked"); -+ } -+ // Plazma end -+ - this.displayEntity = null; - } - -@@ -315,6 +336,12 @@ public abstract class BaseSpawner { - } - - nbt.put("SpawnPotentials", (Tag) SpawnData.LIST_CODEC.encodeStart(NbtOps.INSTANCE, this.spawnPotentials).result().orElseThrow()); -+ // Plazma start - FixMySpawnR -+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().fixMySpawnR.enabled) { -+ nbt.putInt("fixmyspawnrTicks", blockExistsTick); -+ nbt.putBoolean("fixMySpawnerLocked", blockLockedByTime); -+ } -+ // Plazma end - return nbt; - } -