-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
113 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...r/0024-ImproveBiomeTemperatureCache.patch → ...024-Improve-biome-temperature-cache.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
35 changes: 14 additions & 21 deletions
35
...erver/0032-Configurable-Sensor-Tick.patch → ...erver/0026-Configurable-sensor-tick.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
23
patches/unapplied/server/0028-FixMySpawnR-Configuration.patch
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.