Skip to content

Commit

Permalink
More patches
Browse files Browse the repository at this point in the history
  • Loading branch information
AlphaKR93 committed Sep 29, 2023
1 parent ff30483 commit 1c33d68
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 114 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <[email protected]>
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 {
Expand Down
85 changes: 85 additions & 0 deletions patches/server/0025-Implement-FixMySpawnR.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <[email protected]>
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;
Original file line number Diff line number Diff line change
@@ -1,42 +1,35 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: IPECTER <[email protected]>
Date: Wed, 3 May 2023 16:51:49 +0900
Subject: [PATCH] Configurable Sensor Tick
From: AlphaKR93 <[email protected]>
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;
23 changes: 0 additions & 23 deletions patches/unapplied/server/0028-FixMySpawnR-Configuration.patch

This file was deleted.

67 changes: 0 additions & 67 deletions patches/unapplied/server/0029-Implement-FixMySpawnR.patch

This file was deleted.

0 comments on commit 1c33d68

Please sign in to comment.