prepare for 1.21.3

This commit is contained in:
AlphaKR93
2024-10-24 10:51:17 +09:00
parent 46433f7303
commit 08a067e974
48 changed files with 264 additions and 264 deletions

View File

@@ -8,6 +8,7 @@ export PROJECT_DIR=$(pwd)
alias api="cd $PROJECT_DIR/*-API" alias api="cd $PROJECT_DIR/*-API"
alias srv="cd $PROJECT_DIR/*-Server" alias srv="cd $PROJECT_DIR/*-Server"
alias c="clear;"
alias ap="./gradlew --no-rebuild applyPatches" alias ap="./gradlew --no-rebuild applyPatches"
alias aap="./gradlew --no-rebuild applyAPIPatches" alias aap="./gradlew --no-rebuild applyAPIPatches"
alias agp="./gradlew --no-rebuild applyGeneratedAPIPatches" alias agp="./gradlew --no-rebuild applyGeneratedAPIPatches"

View File

@@ -61,18 +61,18 @@ index 8b5293b0c696ef21d0101493ffa41b60bf0bc86b..03be23690a94a14d7343526acad67ccf
} }
diff --git a/src/main/java/io/papermc/paper/threadedregions/EntityScheduler.java b/src/main/java/io/papermc/paper/threadedregions/EntityScheduler.java diff --git a/src/main/java/io/papermc/paper/threadedregions/EntityScheduler.java b/src/main/java/io/papermc/paper/threadedregions/EntityScheduler.java
index 62484ebf4550b05182f693a3180bbac5d5fd906d..8b39c463b90db2d4faa33471ddce65f775908f2f 100644 index c03608fec..931800662 100644
--- a/src/main/java/io/papermc/paper/threadedregions/EntityScheduler.java --- a/src/main/java/io/papermc/paper/threadedregions/EntityScheduler.java
+++ b/src/main/java/io/papermc/paper/threadedregions/EntityScheduler.java +++ b/src/main/java/io/papermc/paper/threadedregions/EntityScheduler.java
@@ -41,6 +41,7 @@ public final class EntityScheduler { @@ -41,6 +41,7 @@ public final class EntityScheduler {
private long tickCount = 0L; private long tickCount = 0L;
private static final long RETIRED_TICK_COUNT = -1L; private static final long RETIRED_TICK_COUNT = -1L;
+ private static final net.minecraft.server.MinecraftServer SERVER = net.minecraft.server.MinecraftServer.getServer(); + private static final net.minecraft.server.MinecraftServer SERVER = net.minecraft.server.MinecraftServer.getServer(); // Plazma - Port SparklyPaper patches; Skip EntityScheduler's executeTick checks if there isn't any tasks to be run
private final Object stateLock = new Object(); private final Object stateLock = new Object();
private final Long2ObjectOpenHashMap<List<ScheduledTask>> oneTimeDelayed = new Long2ObjectOpenHashMap<>(); private final Long2ObjectOpenHashMap<List<ScheduledTask>> oneTimeDelayed = new Long2ObjectOpenHashMap<>();
@@ -61,14 +62,15 @@ public final class EntityScheduler { @@ -61,15 +62,15 @@ public final class EntityScheduler {
* @throws IllegalStateException If the scheduler is already retired. * @throws IllegalStateException If the scheduler is already retired.
*/ */
public void retire() { public void retire() {
@@ -86,26 +86,19 @@ index 62484ebf4550b05182f693a3180bbac5d5fd906d..8b39c463b90db2d4faa33471ddce65f7
} }
- final Entity thisEntity = this.entity.getHandleRaw(); - final Entity thisEntity = this.entity.getHandleRaw();
-
// correctly handle and order retiring while running executeTick // correctly handle and order retiring while running executeTick
for (int i = 0, len = this.currentlyExecuting.size(); i < len; ++i) { for (int i = 0, len = this.currentlyExecuting.size(); i < len; ++i) {
@@ -124,9 +126,12 @@ public final class EntityScheduler { final ScheduledTask task = this.currentlyExecuting.pollFirst();
@@ -124,6 +125,7 @@ public final class EntityScheduler {
if (this.tickCount == RETIRED_TICK_COUNT) { if (this.tickCount == RETIRED_TICK_COUNT) {
return false; return false;
} }
- this.oneTimeDelayed.computeIfAbsent(this.tickCount + Math.max(1L, delay), (final long keyInMap) -> { + SERVER.entitiesWithScheduledTasks.add(this.entity.getHandleRaw()); // Plazma - Port SparklyPaper patches; Skip EntityScheduler's executeTick checks if there isn't any tasks to be run
- return new ArrayList<>(); this.oneTimeDelayed.computeIfAbsent(this.tickCount + Math.max(1L, delay), (final long keyInMap) -> {
- }).add(task); return new ArrayList<>();
+ // Plazma start - Port SparklyPaper patches; Skip EntityScheduler's executeTick checks if there isn't any tasks to be run }).add(task);
+ SERVER.entitiesWithScheduledTasks.add(this.entity.getHandleRaw()); @@ -143,6 +145,12 @@ public final class EntityScheduler {
+ this.oneTimeDelayed.computeIfAbsent(
+ this.tickCount + Math.max(1L, delay), (final long keyInMap) -> new ArrayList<>()
+ ).add(task);
+ // Plazma end - Port SparklyPaper patches; Skip EntityScheduler's executeTick checks if there isn't any tasks to be run
}
return true;
@@ -143,6 +148,12 @@ public final class EntityScheduler {
TickThread.ensureTickThread(thisEntity, "May not tick entity scheduler asynchronously"); TickThread.ensureTickThread(thisEntity, "May not tick entity scheduler asynchronously");
final List<ScheduledTask> toRun; final List<ScheduledTask> toRun;
synchronized (this.stateLock) { synchronized (this.stateLock) {
@@ -118,29 +111,11 @@ index 62484ebf4550b05182f693a3180bbac5d5fd906d..8b39c463b90db2d4faa33471ddce65f7
if (this.tickCount == RETIRED_TICK_COUNT) { if (this.tickCount == RETIRED_TICK_COUNT) {
throw new IllegalStateException("Ticking retired scheduler"); throw new IllegalStateException("Ticking retired scheduler");
} }
diff --git a/src/main/java/io/papermc/paper/util/player/NearbyPlayers.java b/src/main/java/io/papermc/paper/util/player/NearbyPlayers.java
index f164256d59b761264876ca0c85f812d101bfd5de..deaeb134c47da8710afa747bf980bd00aab846d6 100644
--- a/src/main/java/io/papermc/paper/util/player/NearbyPlayers.java
+++ b/src/main/java/io/papermc/paper/util/player/NearbyPlayers.java
@@ -106,6 +106,13 @@ public final class NearbyPlayers {
return chunk == null ? null : chunk.players[type.ordinal()];
}
+ // Plazma start - Port SparklyPaper patches; Cache coordinate key used for nearby players when ticking chunks
+ public ReferenceList<ServerPlayer> getPlayers(final long nearbyCoordKey, final NearbyMapType type) {
+ final TrackedChunk chunk = this.byChunk.get(nearbyCoordKey);
+ return chunk == null ? null : chunk.players[type.ordinal()];
+ }
+ // Plazma end - Port SparklyPaper patches; Cache coordinate key used for nearby players when ticking chunks
+
public ReferenceList<ServerPlayer> getPlayersByChunk(final int chunkX, final int chunkZ, final NearbyMapType type) {
final TrackedChunk chunk = this.byChunk.get(CoordinateUtils.getChunkKey(chunkX, chunkZ));
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 79ee153cd3c7bd3b2f34e7d30f70be5080cfa3c6..2452dae1e55165bd8c49c4670e3f2adb523de5da 100644 index ccfeda1ba..c63910d92 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -321,6 +321,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -327,6 +327,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public volatile boolean abnormalExit = false; // Paper public volatile boolean abnormalExit = false; // Paper
public static final long SERVER_INIT = System.nanoTime(); // Paper - Lag compensation public static final long SERVER_INIT = System.nanoTime(); // Paper - Lag compensation
public gg.pufferfish.pufferfish.util.AsyncExecutor mobSpawnExecutor = new gg.pufferfish.pufferfish.util.AsyncExecutor("MobSpawning"); // Pufferfish - optimize mob spawning public gg.pufferfish.pufferfish.util.AsyncExecutor mobSpawnExecutor = new gg.pufferfish.pufferfish.util.AsyncExecutor("MobSpawning"); // Pufferfish - optimize mob spawning
@@ -148,12 +123,12 @@ index 79ee153cd3c7bd3b2f34e7d30f70be5080cfa3c6..2452dae1e55165bd8c49c4670e3f2adb
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) { public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
AtomicReference<S> atomicreference = new AtomicReference(); AtomicReference<S> atomicreference = new AtomicReference();
@@ -1739,17 +1740,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1773,17 +1774,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
//MinecraftTimings.bukkitSchedulerTimer.stopTiming(); // Spigot // Paper // Purpur //MinecraftTimings.bukkitSchedulerTimer.stopTiming(); // Spigot // Paper // Purpur
// Paper start - Folia scheduler API // Paper start - Folia scheduler API
((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick(); ((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick();
- getAllLevels().forEach(level -> { - getAllLevels().forEach(level -> {
- for (final Entity entity : level.getEntityLookup().getAllCopy()) { // Paper - rewrite chunk system - for (final Entity entity : level.moonrise$getEntityLookup().getAllCopy()) { // Paper - rewrite chunk system
- if (entity.isRemoved()) { - if (entity.isRemoved()) {
- continue; - continue;
- } - }
@@ -164,59 +139,49 @@ index 79ee153cd3c7bd3b2f34e7d30f70be5080cfa3c6..2452dae1e55165bd8c49c4670e3f2adb
- } - }
- }); - });
+ // Plazma start - Port SparklyPaper patches; Skip EntityScheduler's executeTick checks if there isn't any tasks to be run + // Plazma start - Port SparklyPaper patches; Skip EntityScheduler's executeTick checks if there isn't any tasks to be run
+ for (final Entity entity: entitiesWithScheduledTasks) { + for (final Entity entity : entitiesWithScheduledTasks) {
+ if (entity.isRemoved()) continue; + if (entity.isRemoved() || entity.getBukkitEntityRaw() == null) continue;
+ + bukkit.taskScheduler.executeTick();
+ final org.bukkit.craftbukkit.entity.CraftEntity bukkit = entity.getBukkitEntityRaw();
+ //noinspection ConstantValue
+ if (bukkit != null) bukkit.taskScheduler.executeTick();
+ } + }
+ // Plazma end - Port SparklyPaper patches; Skip EntityScheduler's executeTick checks if there isn't any tasks to be run + // Plazma end - Port SparklyPaper patches; Skip EntityScheduler's executeTick checks if there isn't any tasks to be run
// Paper end - Folia scheduler API // Paper end - Folia scheduler API
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.CALLBACK_MANAGER.handleQueue(this.tickCount); // Paper io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.CALLBACK_MANAGER.handleQueue(this.tickCount); // Paper
//this.profiler.push("commandFunctions"); // Purpur //this.profiler.push("commandFunctions"); // Purpur
@@ -1816,7 +1815,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1849,8 +1845,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
//this.profiler.push("tick"); // Purpur
try { try {
//worldserver.timings.doTick.startTiming(); // Spigot // Purpur - //worldserver.timings.doTick.startTiming(); // Spigot // Purpur
+ // Plazma start - Port SparklyPaper patches; Track World specific MSPT - worldserver.tick(shouldKeepTicking);
+ //worldserver.timings.doTick.startTiming(); // Spigot // Purpur// Plazma start - Port SparklyPaper patches; Track World specific MSPT
+ long before = Util.getNanos(); + long before = Util.getNanos();
worldserver.tick(shouldKeepTicking); + worldserver.tick(shouldKeepTicking); // diff on changes
+ long after = Util.getNanos() - before; + long after = Util.getNanos() - before;
+ +
+ worldserver.tickTimes5s.add(this.tickCount, after); + worldserver.tickTimes5s.add(this.tickCount, after);
+ worldserver.tickTimes10s.add(this.tickCount, after); + worldserver.tickTimes10s.add(this.tickCount, after);
+ worldserver.tickTimes60s.add(this.tickCount, after); + worldserver.tickTimes60s.add(this.tickCount, after);
+ // Plazma end - Port SparklyPaper patches; Track World specific MSPT + // Plazma end - Port SparklyPaper patches; Track World specific MSPT
// Paper start //worldserver.timings.doTick.stopTiming(); // Spigot // Purpur
for (final io.papermc.paper.chunk.SingleThreadChunkRegionManager regionManager : worldserver.getChunkSource().chunkMap.regionManagers) { } catch (Throwable throwable) {
regionManager.recalculateRegions(); CrashReport crashreport = CrashReport.forThrowable(throwable, "Exception ticking world");
@@ -2595,7 +2602,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public ProfilerFiller getProfiler() {
- //if (gg.pufferfish.pufferfish.PufferfishConfig.disableMethodProfiler) return net.minecraft.util.profiling.InactiveProfiler.INSTANCE; // Pufferfish // Purpur
+ //if (true || gg.pufferfish.pufferfish.PufferfishConfig.disableMethodProfiler) return net.minecraft.util.profiling.InactiveProfiler.INSTANCE; // Pufferfish // Purpur
return this.profiler;
}
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 6cbbe9c692068edee7e66f85081ec95b8dd12101..3a2acbdcfb64dff5ecb686ba7ea405b488e6eca9 100644 index 1bc42bcb5..f6afc085b 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -224,6 +224,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -237,6 +237,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
this.paperConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess()); this.paperConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess());
this.plazmaConfigurations.initializeGlobalConfiguration(this.registryAccess()); // Plazma - Configurable Plazma this.plazmaConfigurations.initializeGlobalConfiguration(this.registryAccess()); // Plazma - Configurable Plazma
this.plazmaConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess()); // Plazma - Configurable Plazma this.plazmaConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess()); // Plazma - Configurable Plazma
+ net.sparklypower.sparklypaper.HalloweenManager.startSyncEpochTask(); // Plazma - Port SparklyPaper patches; Optimize Spooky Season + net.sparklypower.sparklypaper.HalloweenManager.startSyncEpochTask(); // Plazma - Port SparklyPaper patches; Optimize Spooky Season
// Paper end - initialize global and world-defaults configuration // Paper end - initialize global and world-defaults configuration
this.server.spark.enableEarlyIfRequested(); // Paper - spark
// Paper start - fix converting txt to json file; convert old users earlier after PlayerList creation but before file load/save // Paper start - fix converting txt to json file; convert old users earlier after PlayerList creation but before file load/save
if (this.convertOldUsers()) {
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 4b8776e760cca21e558c8fcb1e0e8d07c3589490..dd1a38488802080f961f87b73dfbb8229fb69e99 100644 index 1883abec1..adfc891ae 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1439,7 +1439,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1262,7 +1262,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
// Paper end - Configurable entity tracking range by Y // Paper end - Configurable entity tracking range by Y
// CraftBukkit start - respect vanish API // CraftBukkit start - respect vanish API
@@ -225,21 +190,8 @@ index 4b8776e760cca21e558c8fcb1e0e8d07c3589490..dd1a38488802080f961f87b73dfbb822
flag = false; flag = false;
} }
// CraftBukkit end // CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 5eb7bcf492ee354ef775cd8d09c7ca2bdfeb7ce2..697cb18bce2f2470a0a2347ba6709e1449b360fd 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -615,7 +615,7 @@ public class ServerChunkCache extends ChunkSource {
// Paper start - optimise chunk tick iteration
com.destroystokyo.paper.util.maplist.ReferenceList<ServerPlayer> playersNearby
- = nearbyPlayers.getPlayers(chunkcoordintpair, io.papermc.paper.util.player.NearbyPlayers.NearbyMapType.SPAWN_RANGE);
+ = nearbyPlayers.getPlayers(chunk1.nearbyPlayersCoordinateKey, io.papermc.paper.util.player.NearbyPlayers.NearbyMapType.SPAWN_RANGE);
if (playersNearby == null) {
continue;
}
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
index e16dcb7f60bc3cf2cbef4674b23f12e1e5bd59d3..c3a4fcf600e72f9e95e9df673619ce37d0480cca 100644 index dfd090040..a0ddb5eb4 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java --- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java +++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
@@ -78,6 +78,7 @@ public class ServerEntity { @@ -78,6 +78,7 @@ public class ServerEntity {
@@ -250,32 +202,47 @@ index e16dcb7f60bc3cf2cbef4674b23f12e1e5bd59d3..c3a4fcf600e72f9e95e9df673619ce37
public ServerEntity(ServerLevel worldserver, Entity entity, int i, boolean flag, Consumer<Packet<?>> consumer, Set<ServerPlayerConnection> trackedPlayers) { public ServerEntity(ServerLevel worldserver, Entity entity, int i, boolean flag, Consumer<Packet<?>> consumer, Set<ServerPlayerConnection> trackedPlayers) {
this.trackedPlayers = trackedPlayers; this.trackedPlayers = trackedPlayers;
@@ -217,12 +218,15 @@ public class ServerEntity { @@ -218,20 +219,21 @@ public class ServerEntity {
if ((this.trackDelta || this.entity.hasImpulse || this.entity instanceof LivingEntity && ((LivingEntity) this.entity).isFallFlying()) && this.tickCount > 0) { if ((this.trackDelta || this.entity.hasImpulse || this.entity instanceof LivingEntity && ((LivingEntity) this.entity).isFallFlying()) && this.tickCount > 0) {
Vec3 vec3d1 = this.entity.getDeltaMovement(); Vec3 vec3d1 = this.entity.getDeltaMovement();
- double d0 = vec3d1.distanceToSqr(this.ap); - double d0 = vec3d1.distanceToSqr(this.lastSentMovement);
- -
- if (d0 > 1.0E-7D || d0 > 0.0D && vec3d1.lengthSqr() == 0.0D) { - if (d0 > 1.0E-7D || d0 > 0.0D && vec3d1.lengthSqr() == 0.0D) {
- this.ap = vec3d1; - this.lastSentMovement = vec3d1;
- this.broadcast.accept(new ClientboundSetEntityMotionPacket(this.entity.getId(), this.ap)); - Entity entity1 = this.entity;
-
- if (entity1 instanceof AbstractHurtingProjectile) {
- AbstractHurtingProjectile entityfireball = (AbstractHurtingProjectile) entity1;
-
- this.broadcast.accept(new ClientboundBundlePacket(List.of(new ClientboundSetEntityMotionPacket(this.entity.getId(), this.lastSentMovement), new ClientboundProjectilePowerPacket(entityfireball.getId(), entityfireball.accelerationPower))));
- } else {
- this.broadcast.accept(new ClientboundSetEntityMotionPacket(this.entity.getId(), this.lastSentMovement));
- }
- }
+ // Plazma start - SparklyPaper port; Skip distanceToSqr if the delta movement hasn't changed + // Plazma start - SparklyPaper port; Skip distanceToSqr if the delta movement hasn't changed
+ if (!skipSqrWhenNoDeltaChanges && vec3d1 != this.ap) { + if (!skipSqrWhenNoDeltaChanges && vec3d1 != this.ap) {
+ double d0 = vec3d1.distanceToSqr(this.ap); + double d0 = vec3d1.distanceToSqr(this.lastSentMovement);
+ if (d0 > 1.0E-7D || d0 > 0.0D && vec3d1.lengthSqr() == 0.0D) { + if (d0 > 1.0E-7D || d0 > 0.0D && vec3d1.lengthSqr() == 0.0D) {
+ this.ap = vec3d1; + this.lastSentMovement = vec3d1;
+ this.broadcast.accept(new ClientboundSetEntityMotionPacket(this.entity.getId(), this.ap)); + Entity entity1 = this.entity;
+ if (entity1 instanceof AbstractHurtingProjectile) {
+ AbstractHurtingProjectile entityfireball = (AbstractHurtingProjectile) entity1;
+ this.broadcast.accept(new ClientboundBundlePacket(List.of(new ClientboundSetEntityMotionPacket(this.entity.getId(), this.lastSentMovement), new ClientboundProjectilePowerPacket(entityfireball.getId(), entityfireball.accelerationPower))));
+ } else {
+ this.broadcast.accept(new ClientboundSetEntityMotionPacket(this.entity.getId(), this.lastSentMovement));
+ } + }
} + } // diff on changes
+ } // diff on changes
+ // Plazma end - SparklyPaper port; Skip distanceToSqr if the delta movement hasn't changed + // Plazma end - SparklyPaper port; Skip distanceToSqr if the delta movement hasn't changed
} }
if (packet1 != null) { if (packet1 != null) {
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 5456d2ded6f6e75c48868147e5a2dde5eb23bec8..e2de0c343098d65d830f27b4f80c3f8a9f18a7ae 100644 index dfcd3989f..f5f944899 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -233,6 +233,12 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -233,6 +233,12 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
private final alternate.current.wire.WireHandler wireHandler = new alternate.current.wire.WireHandler(this); // Paper - optimize redstone (Alternate Current) private final alternate.current.wire.WireHandler wireHandler = new alternate.current.wire.WireHandler(this); // Paper - optimize redstone (Alternate Current)
public boolean hasRidableMoveEvent = false; // Purpur public boolean hasRidableMoveEvent = false; // Purpur
@@ -289,7 +256,7 @@ index 5456d2ded6f6e75c48868147e5a2dde5eb23bec8..e2de0c343098d65d830f27b4f80c3f8a
return this.chunkSource.getChunkAtIfLoadedImmediately(x, z); // Paper - Use getChunkIfLoadedImmediately return this.chunkSource.getChunkAtIfLoadedImmediately(x, z); // Paper - Use getChunkIfLoadedImmediately
} }
diff --git a/src/main/java/net/minecraft/stats/ServerStatsCounter.java b/src/main/java/net/minecraft/stats/ServerStatsCounter.java diff --git a/src/main/java/net/minecraft/stats/ServerStatsCounter.java b/src/main/java/net/minecraft/stats/ServerStatsCounter.java
index f890738d3bb9fb5e70a9d323c6cec97f9948f9cf..eb3fc1af68768383d524cf0f50c4f4b304b9d5ca 100644 index fb7342f7a..8b068f6b4 100644
--- a/src/main/java/net/minecraft/stats/ServerStatsCounter.java --- a/src/main/java/net/minecraft/stats/ServerStatsCounter.java
+++ b/src/main/java/net/minecraft/stats/ServerStatsCounter.java +++ b/src/main/java/net/minecraft/stats/ServerStatsCounter.java
@@ -90,12 +90,14 @@ public class ServerStatsCounter extends StatsCounter { @@ -90,12 +90,14 @@ public class ServerStatsCounter extends StatsCounter {
@@ -325,10 +292,10 @@ index f890738d3bb9fb5e70a9d323c6cec97f9948f9cf..eb3fc1af68768383d524cf0f50c4f4b3
} }
} }
diff --git a/src/main/java/net/minecraft/world/entity/ambient/Bat.java b/src/main/java/net/minecraft/world/entity/ambient/Bat.java diff --git a/src/main/java/net/minecraft/world/entity/ambient/Bat.java b/src/main/java/net/minecraft/world/entity/ambient/Bat.java
index a70255995f380a9b0f7057cb5cb820f7655b93fc..2bffc790496fd9b09516d0d908b5319c9dbb1c63 100644 index 36e5a6462..bdc2391ae 100644
--- a/src/main/java/net/minecraft/world/entity/ambient/Bat.java --- a/src/main/java/net/minecraft/world/entity/ambient/Bat.java
+++ b/src/main/java/net/minecraft/world/entity/ambient/Bat.java +++ b/src/main/java/net/minecraft/world/entity/ambient/Bat.java
@@ -306,7 +306,7 @@ public class Bat extends AmbientCreature { @@ -307,7 +307,7 @@ public class Bat extends AmbientCreature {
int i = world.getMaxLocalRawBrightness(pos); int i = world.getMaxLocalRawBrightness(pos);
byte b0 = 4; byte b0 = 4;
@@ -337,12 +304,11 @@ index a70255995f380a9b0f7057cb5cb820f7655b93fc..2bffc790496fd9b09516d0d908b5319c
b0 = 7; b0 = 7;
} else if (random.nextBoolean()) { } else if (random.nextBoolean()) {
return false; return false;
@@ -320,7 +320,25 @@ public class Bat extends AmbientCreature { @@ -321,7 +321,24 @@ public class Bat extends AmbientCreature {
private static boolean isSpookySeason = false; private static boolean isSpookySeason = false;
private static final int ONE_HOUR = 20 * 60 * 60; private static final int ONE_HOUR = 20 * 60 * 60;
private static int lastSpookyCheck = -ONE_HOUR; private static int lastSpookyCheck = -ONE_HOUR;
- public static boolean isHalloweenSeason(Level level) { return level.purpurConfig.forceHalloweenSeason || isHalloween(); } // Purpur - public static boolean isHalloweenSeason(Level level) { return level.purpurConfig.forceHalloweenSeason || isHalloween(); } // Purpur
+
+ // Plazma start - Port SparklyPaper patches; Optimize Spooky Season + // Plazma start - Port SparklyPaper patches; Optimize Spooky Season
+ private static boolean isSpookySeason(Level level) { + private static boolean isSpookySeason(Level level) {
+ if (level.purpurConfig.forceHalloweenSeason) return true; + if (level.purpurConfig.forceHalloweenSeason) return true;
@@ -383,11 +349,11 @@ index 608390ed36710a419de1542b80340dd3fcc7299c..043f068345ca3c50209c1c3cc1feb627
mapItemSavedData.tickCarriedBy(player, stack); mapItemSavedData.tickCarriedBy(player, stack);
} }
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index df73867ee5682fb966b69dd85da61a6928d8dab3..5712ab081e9534f60248caaceea44445ff855e30 100644 index 253d47418..28ed05ed0 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1339,6 +1339,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -1456,6 +1456,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
boolean flag = this.tickRateManager().runsNormally(); int tickedEntities = 0; // Paper - rewrite chunk system
int tilesThisCycle = 0; int tilesThisCycle = 0;
+ int shouldTickBlocksAtLastResult = -1; // Plazma - Port SparklyPaper patches; Optimize tickingBlockEntities + int shouldTickBlocksAtLastResult = -1; // Plazma - Port SparklyPaper patches; Optimize tickingBlockEntities
@@ -395,15 +361,18 @@ index df73867ee5682fb966b69dd85da61a6928d8dab3..5712ab081e9534f60248caaceea44445
var toRemove = new it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<TickingBlockEntity>(); // Paper - Fix MC-117075; use removeAll var toRemove = new it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<TickingBlockEntity>(); // Paper - Fix MC-117075; use removeAll
toRemove.add(null); // Paper - Fix MC-117075 toRemove.add(null); // Paper - Fix MC-117075
for (tileTickPosition = 0; tileTickPosition < this.blockEntityTickers.size(); tileTickPosition++) { // Paper - Disable tick limiters for (tileTickPosition = 0; tileTickPosition < this.blockEntityTickers.size(); tileTickPosition++) { // Paper - Disable tick limiters
@@ -1351,14 +1353,28 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -1468,14 +1470,28 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
tilesThisCycle--; tilesThisCycle--;
toRemove.add(tickingblockentity); // Paper - Fix MC-117075; use removeAll toRemove.add(tickingblockentity); // Paper - Fix MC-117075; use removeAll
// Spigot end // Spigot end
- } else if (flag && this.shouldTickBlocksAt(tickingblockentity.getPos())) { - } else if (flag && this.shouldTickBlocksAt(tickingblockentity.getPos())) {
- tickingblockentity.tick(); - tickingblockentity.tick();
- // Paper start - execute chunk tasks during tick - // Paper start - rewrite chunk system
- if ((this.tileTickPosition & 7) == 0) { - if ((++tickedEntities & 7) == 0) {
- MinecraftServer.getServer().executeMidTickTasks(); - ((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemLevel)(Level)(Object)this).moonrise$midTickTasks();
- }
- // Paper end - rewrite chunk system
- }
+ // Plazma start - Port SparklyPaper patches; Optimize tickingBlockEntities + // Plazma start - Port SparklyPaper patches; Optimize tickingBlockEntities
+ } else if (flag) { + } else if (flag) {
+ long chunkPos = tickingblockentity.getChunkCoordinateKey(); + long chunkPos = tickingblockentity.getChunkCoordinateKey();
@@ -414,18 +383,17 @@ index df73867ee5682fb966b69dd85da61a6928d8dab3..5712ab081e9534f60248caaceea44445
+ shouldTick = this.shouldTickBlocksAt(chunkPos); + shouldTick = this.shouldTickBlocksAt(chunkPos);
+ shouldTickBlocksAtLastResult = shouldTick ? 1 : 0; + shouldTickBlocksAtLastResult = shouldTick ? 1 : 0;
+ shouldTickBlocksAtChunkPos = chunkPos; + shouldTickBlocksAtChunkPos = chunkPos;
+ } + } // diff on changes
+ +
+ if (shouldTick) { + if (shouldTick) {
+ tickingblockentity.tick(); + tickingblockentity.tick();
+ // Paper start - execute chunk tasks during tick + // Paper start - execute chunk tasks during tick
+ if ((this.tileTickPosition & 7) == 0) { + if ((++tickedEntities & 7) == 0) {
+ MinecraftServer.getServer().executeMidTickTasks(); + ((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemLevel)(Level)(Object)this).moonrise$midTickTasks();
+ } + }
+ // Paper end - execute chunk tasks during tick + // Paper end - execute chunk tasks during tick
} + } // diff on changes
- // Paper end - execute chunk tasks during tick + } // diff on changes
}
+ // Plazma end - Port SparklyPaper patches; Optimize tickingBlockEntities + // Plazma end - Port SparklyPaper patches; Optimize tickingBlockEntities
} }
this.blockEntityTickers.removeAll(toRemove); // Paper - Fix MC-117075 this.blockEntityTickers.removeAll(toRemove); // Paper - Fix MC-117075
@@ -679,7 +647,7 @@ index 28e3b73507b988f7234cbf29c4024c88180d0aef..6239c171ca996f3f5c23060f728a6223
+ long getChunkCoordinateKey(); // Plazma - Port SparklyPaper patches; Optimize tickingBlockEntities + long getChunkCoordinateKey(); // Plazma - Port SparklyPaper patches; Optimize tickingBlockEntities
} }
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java
index 1aac95b03a9e2e37c24f2a30bcb259c1424e1c78..e7c0c36fd3455c0536e98259b46dbcc952d90e01 100644 index 75c8125e2..d6005f010 100644
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java --- a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java +++ b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java
@@ -66,6 +66,7 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom @@ -66,6 +66,7 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom
@@ -690,8 +658,8 @@ index 1aac95b03a9e2e37c24f2a30bcb259c1424e1c78..e7c0c36fd3455c0536e98259b46dbcc9
private long inhabitedTime; private long inhabitedTime;
/** @deprecated */ /** @deprecated */
@Nullable @Nullable
@@ -140,6 +141,7 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom @@ -144,6 +145,7 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom
// Paper end - rewrite light engine public ChunkAccess(ChunkPos pos, UpgradeData upgradeData, LevelHeightAccessor heightLimitView, Registry<Biome> biomeRegistry, long inhabitedTime, @Nullable LevelChunkSection[] sectionArray, @Nullable BlendingData blendingData) {
this.locX = pos.x; this.locZ = pos.z; // Paper - reduce need for field lookups this.locX = pos.x; this.locZ = pos.z; // Paper - reduce need for field lookups
this.chunkPos = pos; this.coordinateKey = ChunkPos.asLong(locX, locZ); // Paper - cache long key this.chunkPos = pos; this.coordinateKey = ChunkPos.asLong(locX, locZ); // Paper - cache long key
+ this.nearbyPlayersCoordinateKey = io.papermc.paper.util.CoordinateUtils.getChunkKey(locX, locZ); // Plazma - Port SparklyPaper patches; Cache coordinate key used for nearby players when ticking chunks + this.nearbyPlayersCoordinateKey = io.papermc.paper.util.CoordinateUtils.getChunkKey(locX, locZ); // Plazma - Port SparklyPaper patches; Cache coordinate key used for nearby players when ticking chunks
@@ -699,10 +667,10 @@ index 1aac95b03a9e2e37c24f2a30bcb259c1424e1c78..e7c0c36fd3455c0536e98259b46dbcc9
this.levelHeightAccessor = heightLimitView; this.levelHeightAccessor = heightLimitView;
this.sections = new LevelChunkSection[heightLimitView.getSectionsCount()]; this.sections = new LevelChunkSection[heightLimitView.getSectionsCount()];
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
index ab4dd0c8b4b17ff1b54c06b72dc8b3caba430fe2..e026dc9ed15284f55cdd4bc99c0718aba6d2e8c6 100644 index a4578ae22..87f781e94 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -75,6 +75,8 @@ public class LevelChunk extends ChunkAccess { @@ -74,6 +74,8 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
public String getType() { public String getType() {
return "<null>"; return "<null>";
} }
@@ -711,7 +679,7 @@ index ab4dd0c8b4b17ff1b54c06b72dc8b3caba430fe2..e026dc9ed15284f55cdd4bc99c0718ab
}; };
private final Map<BlockPos, LevelChunk.RebindableTickingBlockEntityWrapper> tickersInLevel; private final Map<BlockPos, LevelChunk.RebindableTickingBlockEntityWrapper> tickersInLevel;
public boolean loaded; public boolean loaded;
@@ -1101,7 +1103,7 @@ public class LevelChunk extends ChunkAccess { @@ -966,7 +968,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
} }
private <T extends BlockEntity> TickingBlockEntity createTicker(T blockEntity, BlockEntityTicker<T> blockEntityTicker) { private <T extends BlockEntity> TickingBlockEntity createTicker(T blockEntity, BlockEntityTicker<T> blockEntityTicker) {
@@ -720,7 +688,7 @@ index ab4dd0c8b4b17ff1b54c06b72dc8b3caba430fe2..e026dc9ed15284f55cdd4bc99c0718ab
} }
@FunctionalInterface @FunctionalInterface
@@ -1152,17 +1154,21 @@ public class LevelChunk extends ChunkAccess { @@ -1017,6 +1019,8 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
public String toString() { public String toString() {
return String.valueOf(this.ticker) + " <wrapped>"; return String.valueOf(this.ticker) + " <wrapped>";
} }
@@ -729,21 +697,16 @@ index ab4dd0c8b4b17ff1b54c06b72dc8b3caba430fe2..e026dc9ed15284f55cdd4bc99c0718ab
} }
private class BoundTickingBlockEntity<T extends BlockEntity> implements TickingBlockEntity { private class BoundTickingBlockEntity<T extends BlockEntity> implements TickingBlockEntity {
@@ -1025,7 +1029,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
+ private final long chunkCoordinateKey; // Plazma - Port SparklyPaper patches; Optimize TickingBlockEntity
private final T blockEntity;
private final BlockEntityTicker<T> ticker; private final BlockEntityTicker<T> ticker;
private boolean loggedInvalidBlockState; private boolean loggedInvalidBlockState;
- BoundTickingBlockEntity(final BlockEntity tileentity, final BlockEntityTicker blockentityticker) { - BoundTickingBlockEntity(final BlockEntity tileentity, final BlockEntityTicker blockentityticker) {
+ BoundTickingBlockEntity(final BlockEntity tileentity, final BlockEntityTicker blockentityticker, long chunkCoordinateKey) { + BoundTickingBlockEntity(final BlockEntity tileentity, final BlockEntityTicker blockentityticker, long chunkCoordinateKey) { // Plazma - Port SparklyPaper patches; Optimize TickingBlockEntity
this.blockEntity = (T) tileentity; // CraftBukkit - decompile error this.blockEntity = (T) tileentity; // CraftBukkit - decompile error
this.ticker = blockentityticker; this.ticker = blockentityticker;
+ this.chunkCoordinateKey = chunkCoordinateKey;
} }
@@ -1095,5 +1099,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
@Override
@@ -1230,5 +1236,7 @@ public class LevelChunk extends ChunkAccess {
return "Level ticker for " + s + "@" + String.valueOf(this.getPos()); return "Level ticker for " + s + "@" + String.valueOf(this.getPos());
} }

View File

@@ -9,10 +9,10 @@ Subject: [PATCH] Optimize default configurations
- YouHaveTrouble/minecraft-exploits-and-how-to-fix-them - YouHaveTrouble/minecraft-exploits-and-how-to-fix-them
diff --git a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java diff --git a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
index cba3d725245223c5d9e8e59dcceec61f0acc1b85..63af4c9e2bc662e08ebf858d84933b3e4e3b92cb 100644 index 8f1645573..8e35f7fbe 100644
--- a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java --- a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
+++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java +++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
@@ -72,7 +72,7 @@ public class PufferfishConfig { @@ -64,7 +64,7 @@ public class PufferfishConfig {
getString("info.version", "1.0"); getString("info.version", "1.0");
setComment("info", setComment("info",
"Pufferfish Configuration", "Pufferfish Configuration",
@@ -21,31 +21,31 @@ index cba3d725245223c5d9e8e59dcceec61f0acc1b85..63af4c9e2bc662e08ebf858d84933b3e
"Join our Discord for support: https://discord.gg/reZw4vQV9H", "Join our Discord for support: https://discord.gg/reZw4vQV9H",
"Download new builds at https://ci.pufferfish.host/job/Pufferfish"); "Download new builds at https://ci.pufferfish.host/job/Pufferfish");
@@ -227,7 +227,7 @@ public class PufferfishConfig { @@ -219,7 +219,7 @@ public class PufferfishConfig {
public static int maxProjectileLoadsPerTick; public static int maxProjectileLoadsPerTick;
public static int maxProjectileLoadsPerProjectile; public static int maxProjectileLoadsPerProjectile;
private static void projectileLoading() { private static void projectileLoading() {
- maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", 10, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick."); - maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", 10, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick.");
+ maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 8 : 10, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick."); + maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 8 : 10, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick."); // Plazma - Optimize default configurations
maxProjectileLoadsPerProjectile = getInt("projectile.max-loads-per-projectile", 10, "Controls how many chunks a projectile", "can load in its lifetime before it gets", "automatically removed."); maxProjectileLoadsPerProjectile = getInt("projectile.max-loads-per-projectile", 10, "Controls how many chunks a projectile", "can load in its lifetime before it gets", "automatically removed.");
setComment("projectile", "Optimizes projectile settings"); setComment("projectile", "Optimizes projectile settings");
@@ -241,12 +241,12 @@ public class PufferfishConfig { @@ -233,12 +233,12 @@ public class PufferfishConfig {
public static int activationDistanceMod; public static int activationDistanceMod;
private static void dynamicActivationOfBrains() throws IOException { private static void dynamicActivationOfBrains() throws IOException {
- dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", false); // Purpur - dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", false); // Purpur
+ dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize()); // Purpur + dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize()); // Purpur // Plazma - Optimize default configurations
startDistance = getInt("dab.start-distance", "activation-range.start-distance", 12, startDistance = getInt("dab.start-distance", "activation-range.start-distance", 12,
"This value determines how far away an entity has to be", "This value determines how far away an entity has to be",
"from the player to start being effected by DEAR."); "from the player to start being effected by DEAR.");
startDistanceSquared = startDistance * startDistance; startDistanceSquared = startDistance * startDistance;
- maximumActivationPrio = getInt("dab.max-tick-freq", "activation-range.max-tick-freq", 20, - maximumActivationPrio = getInt("dab.max-tick-freq", "activation-range.max-tick-freq", 20,
+ maximumActivationPrio = getInt("dab.max-tick-freq", "activation-range.max-tick-freq", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 7 : 8, + maximumActivationPrio = getInt("dab.max-tick-freq", "activation-range.max-tick-freq", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 7 : 8, // Plazma - Optimize default configurations
"This value defines how often in ticks, the furthest entity", "This value defines how often in ticks, the furthest entity",
"will get their pathfinders and behaviors ticked. 20 = 1s"); "will get their pathfinders and behaviors ticked. 20 = 1s");
activationDistanceMod = getInt("dab.activation-dist-mod", "activation-range.activation-dist-mod", 8, activationDistanceMod = getInt("dab.activation-dist-mod", "activation-range.activation-dist-mod", 8,
@@ -269,8 +269,18 @@ public class PufferfishConfig { @@ -261,8 +261,18 @@ public class PufferfishConfig {
public static Map<String, Integer> projectileTimeouts; public static Map<String, Integer> projectileTimeouts;
private static void projectileTimeouts() { private static void projectileTimeouts() {
// Set some defaults // Set some defaults
@@ -67,10 +67,10 @@ index cba3d725245223c5d9e8e59dcceec61f0acc1b85..63af4c9e2bc662e08ebf858d84933b3e
"These values define a entity's maximum lifespan. If an", "These values define a entity's maximum lifespan. If an",
"entity is in this list and it has survived for longer than", "entity is in this list and it has survived for longer than",
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
index 32035e37b39ba42232fea948166e7c1d4d06190c..8445a0b25d647b2c1f9a44f849084cdec0842e18 100644 index a9dd0e521..d417b773d 100644
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java --- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java +++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
@@ -167,7 +167,7 @@ public class GlobalConfiguration extends ConfigurationPart { @@ -172,7 +172,7 @@ public class GlobalConfiguration extends ConfigurationPart {
public class Watchdog extends ConfigurationPart { public class Watchdog extends ConfigurationPart {
public int earlyWarningEvery = 5000; public int earlyWarningEvery = 5000;
@@ -79,7 +79,7 @@ index 32035e37b39ba42232fea948166e7c1d4d06190c..8445a0b25d647b2c1f9a44f849084cde
} }
public SpamLimiter spamLimiter; public SpamLimiter spamLimiter;
@@ -207,7 +207,7 @@ public class GlobalConfiguration extends ConfigurationPart { @@ -214,7 +214,7 @@ public class GlobalConfiguration extends ConfigurationPart {
public Commands commands; public Commands commands;
public class Commands extends ConfigurationPart { public class Commands extends ConfigurationPart {
@@ -88,16 +88,16 @@ index 32035e37b39ba42232fea948166e7c1d4d06190c..8445a0b25d647b2c1f9a44f849084cde
public boolean fixTargetSelectorTagCompletion = true; public boolean fixTargetSelectorTagCompletion = true;
public boolean timeCommandAffectsAllWorlds = false; public boolean timeCommandAffectsAllWorlds = false;
} }
@@ -256,7 +256,7 @@ public class GlobalConfiguration extends ConfigurationPart { @@ -263,7 +263,7 @@ public class GlobalConfiguration extends ConfigurationPart {
public BookSize bookSize; public BookSize bookSize;
public class BookSize extends ConfigurationPart { public class BookSize extends ConfigurationPart {
- public int pageMax = 2560; // TODO this appears to be a duplicate setting with one above - public IntOr.Disabled pageMax = new IntOr.Disabled(OptionalInt.of(2560)); // TODO this appears to be a duplicate setting with one above
+ public int pageMax = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 1024 : 2560; // TODO this appears to be a duplicate setting with one above // Plazma - Optimize default configurations + public IntOr.Disabled pageMax = new IntOr.Disabled(OptionalInt.of(org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 1024 : 2560)); // TODO this appears to be a duplicate setting with one above // Plazma - Optimize default configurations
public double totalMultiplier = 0.98D; // TODO this should probably be merged into the above inner class public double totalMultiplier = 0.98D; // TODO this should probably be merged into the above inner class
} }
public boolean resolveSelectorsInBooks = false; public boolean resolveSelectorsInBooks = false;
@@ -267,7 +267,15 @@ public class GlobalConfiguration extends ConfigurationPart { @@ -274,7 +274,15 @@ public class GlobalConfiguration extends ConfigurationPart {
public class PacketLimiter extends ConfigurationPart { public class PacketLimiter extends ConfigurationPart {
public Component kickMessage = Component.translatable("disconnect.exceeded_packet_rate", NamedTextColor.RED); public Component kickMessage = Component.translatable("disconnect.exceeded_packet_rate", NamedTextColor.RED);
public PacketLimit allPackets = new PacketLimit(7.0, 500.0, PacketLimit.ViolateAction.KICK); public PacketLimit allPackets = new PacketLimit(7.0, 500.0, PacketLimit.ViolateAction.KICK);
@@ -114,7 +114,7 @@ index 32035e37b39ba42232fea948166e7c1d4d06190c..8445a0b25d647b2c1f9a44f849084cde
@ConfigSerializable @ConfigSerializable
public record PacketLimit(@Required double interval, @Required double maxPacketRate, ViolateAction action) { public record PacketLimit(@Required double interval, @Required double maxPacketRate, ViolateAction action) {
@@ -335,7 +343,7 @@ public class GlobalConfiguration extends ConfigurationPart { @@ -342,7 +350,7 @@ public class GlobalConfiguration extends ConfigurationPart {
executor.setMaximumPoolSize(_chatExecutorMaxSize); executor.setMaximumPoolSize(_chatExecutorMaxSize);
} }
} }
@@ -124,10 +124,10 @@ index 32035e37b39ba42232fea948166e7c1d4d06190c..8445a0b25d647b2c1f9a44f849084cde
public boolean loadPermissionsYmlBeforePlugins = true; public boolean loadPermissionsYmlBeforePlugins = true;
@Constraints.Min(4) @Constraints.Min(4)
diff --git a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java diff --git a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
index efc91ff91827872c62b8bd060282549ccdcf67dd..1d926378887b9e42f1827e958f506be3e27d5ab5 100644 index c867796f6..ecced2072 100644
--- a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java --- a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
+++ b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java +++ b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
@@ -96,12 +96,32 @@ public class WorldConfiguration extends ConfigurationPart { @@ -100,12 +100,32 @@ public class WorldConfiguration extends ConfigurationPart {
public class AntiXray extends ConfigurationPart { public class AntiXray extends ConfigurationPart {
public boolean enabled = false; public boolean enabled = false;
@@ -163,7 +163,7 @@ index efc91ff91827872c62b8bd060282549ccdcf67dd..1d926378887b9e42f1827e958f506be3
//<editor-fold desc="Anti-Xray Hidden Blocks" defaultstate="collapsed"> //<editor-fold desc="Anti-Xray Hidden Blocks" defaultstate="collapsed">
Blocks.COPPER_ORE, Blocks.COPPER_ORE,
Blocks.DEEPSLATE_COPPER_ORE, Blocks.DEEPSLATE_COPPER_ORE,
@@ -128,7 +148,28 @@ public class WorldConfiguration extends ConfigurationPart { @@ -132,7 +152,28 @@ public class WorldConfiguration extends ConfigurationPart {
Blocks.ENDER_CHEST Blocks.ENDER_CHEST
//</editor-fold> //</editor-fold>
); );
@@ -193,7 +193,7 @@ index efc91ff91827872c62b8bd060282549ccdcf67dd..1d926378887b9e42f1827e958f506be3
} }
} }
@@ -151,14 +192,14 @@ public class WorldConfiguration extends ConfigurationPart { @@ -155,14 +196,14 @@ public class WorldConfiguration extends ConfigurationPart {
public ArmorStands armorStands; public ArmorStands armorStands;
public class ArmorStands extends ConfigurationPart { public class ArmorStands extends ConfigurationPart {
@@ -211,16 +211,7 @@ index efc91ff91827872c62b8bd060282549ccdcf67dd..1d926378887b9e42f1827e958f506be3
} }
public Sniffer sniffer; public Sniffer sniffer;
@@ -181,7 +222,7 @@ public class WorldConfiguration extends ConfigurationPart { @@ -407,7 +448,7 @@ public class WorldConfiguration extends ConfigurationPart {
@MergeMap
public Reference2IntMap<MobCategory> spawnLimits = Util.make(new Reference2IntOpenHashMap<>(NaturalSpawner.SPAWNING_CATEGORIES.length), map -> Arrays.stream(NaturalSpawner.SPAWNING_CATEGORIES).forEach(mobCategory -> map.put(mobCategory, -1)));
@MergeMap
- public Map<MobCategory, DespawnRange> despawnRanges = Arrays.stream(MobCategory.values()).collect(Collectors.toMap(Function.identity(), category -> new DespawnRange(category.getNoDespawnDistance(), category.getDespawnDistance())));
+ public Map<MobCategory, DespawnRange> despawnRanges = Arrays.stream(MobCategory.values()).collect(Collectors.toMap(Function.identity(), category -> new DespawnRange(category.getNoDespawnDistance(), org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? (net.minecraft.server.MinecraftServer.getServer().server.getSimulationDistance() * 16) + 8 : category.getDespawnDistance()))); // Plazma - Optimize default configurations
@MergeMap
public Reference2IntMap<MobCategory> ticksPerSpawn = Util.make(new Reference2IntOpenHashMap<>(NaturalSpawner.SPAWNING_CATEGORIES.length), map -> Arrays.stream(NaturalSpawner.SPAWNING_CATEGORIES).forEach(mobCategory -> map.put(mobCategory, -1)));
@@ -382,7 +423,7 @@ public class WorldConfiguration extends ConfigurationPart {
public class Environment extends ConfigurationPart { public class Environment extends ConfigurationPart {
public boolean disableThunder = false; public boolean disableThunder = false;
public boolean disableIceAndSnow = false; public boolean disableIceAndSnow = false;
@@ -229,7 +220,7 @@ index efc91ff91827872c62b8bd060282549ccdcf67dd..1d926378887b9e42f1827e958f506be3
public boolean disableExplosionKnockback = false; public boolean disableExplosionKnockback = false;
public boolean generateFlatBedrock = false; public boolean generateFlatBedrock = false;
public FrostedIce frostedIce; public FrostedIce frostedIce;
@@ -434,7 +475,7 @@ public class WorldConfiguration extends ConfigurationPart { @@ -463,7 +504,7 @@ public class WorldConfiguration extends ConfigurationPart {
public Fixes fixes; public Fixes fixes;
public class Fixes extends ConfigurationPart { public class Fixes extends ConfigurationPart {
@@ -238,7 +229,7 @@ index efc91ff91827872c62b8bd060282549ccdcf67dd..1d926378887b9e42f1827e958f506be3
public boolean disableUnloadedChunkEnderpearlExploit = true; public boolean disableUnloadedChunkEnderpearlExploit = true;
public boolean preventTntFromMovingInWater = false; public boolean preventTntFromMovingInWater = false;
public boolean splitOverstackedLoot = true; public boolean splitOverstackedLoot = true;
@@ -462,9 +503,9 @@ public class WorldConfiguration extends ConfigurationPart { @@ -491,9 +532,9 @@ public class WorldConfiguration extends ConfigurationPart {
public class Collisions extends ConfigurationPart { public class Collisions extends ConfigurationPart {
public boolean onlyPlayersCollide = false; public boolean onlyPlayersCollide = false;
public boolean allowVehicleCollisions = true; public boolean allowVehicleCollisions = true;
@@ -250,7 +241,7 @@ index efc91ff91827872c62b8bd060282549ccdcf67dd..1d926378887b9e42f1827e958f506be3
public boolean allowPlayerCrammingDamage = false; public boolean allowPlayerCrammingDamage = false;
} }
@@ -472,18 +513,41 @@ public class WorldConfiguration extends ConfigurationPart { @@ -501,18 +542,41 @@ public class WorldConfiguration extends ConfigurationPart {
public class Chunks extends ConfigurationPart { public class Chunks extends ConfigurationPart {
public AutosavePeriod autoSaveInterval = AutosavePeriod.def(); public AutosavePeriod autoSaveInterval = AutosavePeriod.def();
@@ -300,7 +291,7 @@ index efc91ff91827872c62b8bd060282549ccdcf67dd..1d926378887b9e42f1827e958f506be3
}); });
public boolean flushRegionsOnSave = false; public boolean flushRegionsOnSave = false;
} }
@@ -498,9 +562,9 @@ public class WorldConfiguration extends ConfigurationPart { @@ -527,9 +591,9 @@ public class WorldConfiguration extends ConfigurationPart {
public TickRates tickRates; public TickRates tickRates;
public class TickRates extends ConfigurationPart { public class TickRates extends ConfigurationPart {
@@ -312,7 +303,7 @@ index efc91ff91827872c62b8bd060282549ccdcf67dd..1d926378887b9e42f1827e958f506be3
public int wetFarmland = 1; public int wetFarmland = 1;
public int dryFarmland = 1; public int dryFarmland = 1;
public Table<EntityType<?>, String, Integer> sensor = Util.make(HashBasedTable.create(), table -> table.put(EntityType.VILLAGER, "secondarypoisensor", 40)); public Table<EntityType<?>, String, Integer> sensor = Util.make(HashBasedTable.create(), table -> table.put(EntityType.VILLAGER, "secondarypoisensor", 40));
@@ -534,9 +598,9 @@ public class WorldConfiguration extends ConfigurationPart { @@ -563,9 +627,9 @@ public class WorldConfiguration extends ConfigurationPart {
public class Misc extends ConfigurationPart { public class Misc extends ConfigurationPart {
public int lightQueueSize = 20; public int lightQueueSize = 20;
@@ -321,9 +312,9 @@ index efc91ff91827872c62b8bd060282549ccdcf67dd..1d926378887b9e42f1827e958f506be3
public boolean showSignClickCommandFailureMsgsToPlayer = false; public boolean showSignClickCommandFailureMsgsToPlayer = false;
- public RedstoneImplementation redstoneImplementation = RedstoneImplementation.VANILLA; - public RedstoneImplementation redstoneImplementation = RedstoneImplementation.VANILLA;
+ public RedstoneImplementation redstoneImplementation = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? RedstoneImplementation.ALTERNATE_CURRENT : RedstoneImplementation.VANILLA; // Plazma - Optimize default configurations + public RedstoneImplementation redstoneImplementation = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? RedstoneImplementation.ALTERNATE_CURRENT : RedstoneImplementation.VANILLA; // Plazma - Optimize default configurations
public AlternateCurrentUpdateOrder alternateCurrentUpdateOrder = AlternateCurrentUpdateOrder.HORIZONTAL_FIRST_OUTWARD;
public boolean disableEndCredits = false; public boolean disableEndCredits = false;
public float maxLeashDistance = 10f; public DoubleOr.Default maxLeashDistance = DoubleOr.Default.USE_DEFAULT;
public boolean disableSprintInterruptionOnAttack = false;
diff --git a/src/main/java/io/papermc/paper/configuration/type/fallback/ArrowDespawnRate.java b/src/main/java/io/papermc/paper/configuration/type/fallback/ArrowDespawnRate.java diff --git a/src/main/java/io/papermc/paper/configuration/type/fallback/ArrowDespawnRate.java b/src/main/java/io/papermc/paper/configuration/type/fallback/ArrowDespawnRate.java
index 24763d3d270c29c95e0b3e85111145234f660a62..80ddc627e02e3c749e6b074afa93d357d9c7d62a 100644 index 24763d3d270c29c95e0b3e85111145234f660a62..80ddc627e02e3c749e6b074afa93d357d9c7d62a 100644
--- a/src/main/java/io/papermc/paper/configuration/type/fallback/ArrowDespawnRate.java --- a/src/main/java/io/papermc/paper/configuration/type/fallback/ArrowDespawnRate.java
@@ -337,10 +328,10 @@ index 24763d3d270c29c95e0b3e85111145234f660a62..80ddc627e02e3c749e6b074afa93d357
} }
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index 29eef278940cab33a1f5f168f66ab2b80f0d60ce..b4d47c53bb2a5c75e9f69506dbd69a8817f368dc 100644 index 639a0624f..e4b42f745 100644
--- a/src/main/java/net/minecraft/server/Main.java --- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java
@@ -151,7 +151,7 @@ public class Main { @@ -152,7 +152,7 @@ public class Main {
File configFile = (File) optionset.valueOf("bukkit-settings"); File configFile = (File) optionset.valueOf("bukkit-settings");
YamlConfiguration configuration = YamlConfiguration.loadConfiguration(configFile); YamlConfiguration configuration = YamlConfiguration.loadConfiguration(configFile);
configuration.options().copyDefaults(true); configuration.options().copyDefaults(true);
@@ -350,10 +341,10 @@ index 29eef278940cab33a1f5f168f66ab2b80f0d60ce..b4d47c53bb2a5c75e9f69506dbd69a88
File commandFile = (File) optionset.valueOf("commands-settings"); File commandFile = (File) optionset.valueOf("commands-settings");
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
index 09aa0c9ec7d66ff82167c035481e5fcccf8618de..3ed078e33a99e4cc7b536ab6590ef939ac2966db 100644 index 5971f99c0..ef0f1598f 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
@@ -131,14 +131,14 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie @@ -132,14 +132,14 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
this.spawnMonsters = this.get("spawn-monsters", true); this.spawnMonsters = this.get("spawn-monsters", true);
this.useNativeTransport = this.get("use-native-transport", true); this.useNativeTransport = this.get("use-native-transport", true);
this.enableCommandBlock = this.get("enable-command-block", false); this.enableCommandBlock = this.get("enable-command-block", false);
@@ -372,7 +363,7 @@ index 09aa0c9ec7d66ff82167c035481e5fcccf8618de..3ed078e33a99e4cc7b536ab6590ef939
this.maxPlayers = this.get("max-players", 20); this.maxPlayers = this.get("max-players", 20);
this.networkCompressionThreshold = this.get("network-compression-threshold", 256); this.networkCompressionThreshold = this.get("network-compression-threshold", 256);
this.broadcastRconToOps = this.get("broadcast-rcon-to-ops", true); this.broadcastRconToOps = this.get("broadcast-rcon-to-ops", true);
@@ -146,7 +146,7 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie @@ -147,7 +147,7 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
this.maxWorldSize = this.get("max-world-size", (integer) -> { this.maxWorldSize = this.get("max-world-size", (integer) -> {
return Mth.clamp(integer, 1, 29999984); return Mth.clamp(integer, 1, 29999984);
}, 29999984); }, 29999984);
@@ -382,10 +373,10 @@ index 09aa0c9ec7d66ff82167c035481e5fcccf8618de..3ed078e33a99e4cc7b536ab6590ef939
this.enableJmxMonitoring = this.get("enable-jmx-monitoring", false); this.enableJmxMonitoring = this.get("enable-jmx-monitoring", false);
this.enableStatus = this.get("enable-status", true); this.enableStatus = this.get("enable-status", true);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 02037da80f2f3cada359bbe0f58160fd15761b77..8de087636686b78c12bc1c293258713ff7dddff0 100644 index 0bd9f4dc2..52d9b6253 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -428,7 +428,7 @@ public final class CraftServer implements Server { @@ -434,7 +434,7 @@ public final class CraftServer implements Server {
this.configuration = YamlConfiguration.loadConfiguration(this.getConfigFile()); this.configuration = YamlConfiguration.loadConfiguration(this.getConfigFile());
this.configuration.options().copyDefaults(true); this.configuration.options().copyDefaults(true);
@@ -426,18 +417,10 @@ index 09053b4ccf268fd204c81dbb8d4f10fa9edcad5f..93f67f125b3674e645cfdae27e579e12
#### ENGLISH #### #### ENGLISH ####
This is the %s configuration file for Plazma. This is the %s configuration file for Plazma.
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
index cdb4d9a76640fbf0fa202d7b70f5c2bc7005a84b..0a8d1f2b33257a371abb97a3a88af1f89ee46e24 100644 index 546d92019..97fc4fb79 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java --- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
@@ -49,6 +49,7 @@ public class PurpurConfig { @@ -243,7 +243,7 @@ public class PurpurConfig {
+ "join us in our Discord guild.\n"
+ "\n"
+ "Website: https://purpurmc.org \n"
+ + "Vanilla Food Properties: https://gist.github.com/BillyGalbreath/4fdfba991bd020e814eabf5143e3b225 \n" // Plazma
+ "Docs: https://purpurmc.org/docs \n";
private static File CONFIG_FILE;
public static YamlConfiguration config;
@@ -241,7 +242,7 @@ public class PurpurConfig {
laggingThreshold = getDouble("settings.lagging-threshold", laggingThreshold); laggingThreshold = getDouble("settings.lagging-threshold", laggingThreshold);
} }
@@ -446,7 +429,7 @@ index cdb4d9a76640fbf0fa202d7b70f5c2bc7005a84b..0a8d1f2b33257a371abb97a3a88af1f8
private static void useAlternateKeepAlive() { private static void useAlternateKeepAlive() {
useAlternateKeepAlive = getBoolean("settings.use-alternate-keepalive", useAlternateKeepAlive); useAlternateKeepAlive = getBoolean("settings.use-alternate-keepalive", useAlternateKeepAlive);
} }
@@ -481,7 +482,7 @@ public class PurpurConfig { @@ -492,7 +492,7 @@ public class PurpurConfig {
} }
public static boolean useUPnP = false; public static boolean useUPnP = false;
@@ -456,10 +439,10 @@ index cdb4d9a76640fbf0fa202d7b70f5c2bc7005a84b..0a8d1f2b33257a371abb97a3a88af1f8
private static void networkSettings() { private static void networkSettings() {
useUPnP = getBoolean("settings.network.upnp-port-forwarding", useUPnP); useUPnP = getBoolean("settings.network.upnp-port-forwarding", useUPnP);
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index 6717941d18dbd6871b4613106b9787063e11722f..b6a6a74dfd00a4536258c8693048c9d1ac4df435 100644 index 3bcbf5e2d..1ff95cced 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java --- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -433,7 +433,7 @@ public class PurpurWorldConfig { @@ -424,7 +424,7 @@ public class PurpurWorldConfig {
public boolean idleTimeoutTargetPlayer = true; public boolean idleTimeoutTargetPlayer = true;
public String playerDeathExpDropEquation = "expLevel * 7"; public String playerDeathExpDropEquation = "expLevel * 7";
public int playerDeathExpDropMax = 100; public int playerDeathExpDropMax = 100;
@@ -468,7 +451,7 @@ index 6717941d18dbd6871b4613106b9787063e11722f..b6a6a74dfd00a4536258c8693048c9d1
public boolean teleportOnNetherCeilingDamage = false; public boolean teleportOnNetherCeilingDamage = false;
public boolean totemOfUndyingWorksInInventory = false; public boolean totemOfUndyingWorksInInventory = false;
public boolean playerFixStuckPortal = false; public boolean playerFixStuckPortal = false;
@@ -3135,7 +3135,7 @@ public class PurpurWorldConfig { @@ -3247,7 +3247,7 @@ public class PurpurWorldConfig {
public boolean zombieJockeyOnlyBaby = true; public boolean zombieJockeyOnlyBaby = true;
public double zombieJockeyChance = 0.05D; public double zombieJockeyChance = 0.05D;
public boolean zombieJockeyTryExistingChickens = true; public boolean zombieJockeyTryExistingChickens = true;
@@ -478,23 +461,23 @@ index 6717941d18dbd6871b4613106b9787063e11722f..b6a6a74dfd00a4536258c8693048c9d1
public boolean zombieTakeDamageFromWater = false; public boolean zombieTakeDamageFromWater = false;
public boolean zombieAlwaysDropExp = false; public boolean zombieAlwaysDropExp = false;
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index 1cf6d4f854d89c515e48e1fb365eb95ff9340765..7d1ae99e83dc6511838092c3ab6e0fd5f39faabc 100644 index 2c408fa4a..aadad0a1e 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java --- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java +++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -150,14 +150,14 @@ public class SpigotWorldConfig @@ -150,14 +150,14 @@ public class SpigotWorldConfig
public double itemMerge; public double itemMerge;
private void itemMerge() private void itemMerge()
{ {
- this.itemMerge = this.getDouble("merge-radius.item", 2.5 ); - this.itemMerge = this.getDouble("merge-radius.item", 0.5 );
+ this.itemMerge = this.getDouble("merge-radius.item", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 3.5 : 2.5 ); // Plazma - Optimize default configurations + this.itemMerge = this.getDouble("merge-radius.item", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 3.5 : 0.5); // Plazma - Optimize default configurations
this.log( "Item Merge Radius: " + this.itemMerge ); this.log( "Item Merge Radius: " + this.itemMerge );
} }
public double expMerge; public double expMerge;
private void expMerge() private void expMerge()
{ {
- this.expMerge = this.getDouble("merge-radius.exp", 3.0 ); - this.expMerge = this.getDouble("merge-radius.exp", -1 );
+ this.expMerge = this.getDouble("merge-radius.exp", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 4.0 : 3.0 ); // Plazma - Optimize default configurations + this.expMerge = this.getDouble("merge-radius.exp", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 4.0 : -1); // Plazma - Optimize default configurations
this.log( "Experience Merge Radius: " + this.expMerge ); this.log( "Experience Merge Radius: " + this.expMerge );
} }
@@ -507,47 +490,58 @@ index 1cf6d4f854d89c515e48e1fb365eb95ff9340765..7d1ae99e83dc6511838092c3ab6e0fd5
this.log( "Mob Spawn Range: " + this.mobSpawnRange ); this.log( "Mob Spawn Range: " + this.mobSpawnRange );
} }
@@ -207,26 +207,26 @@ public class SpigotWorldConfig @@ -207,27 +207,29 @@ public class SpigotWorldConfig
this.log( "Item Despawn Rate: " + this.itemDespawnRate ); this.log( "Item Despawn Rate: " + this.itemDespawnRate );
} }
- public int animalActivationRange = 32; - public int animalActivationRange = 32;
- public int monsterActivationRange = 32; - public int monsterActivationRange = 32;
+ public int animalActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 16 : 32; // Plazma - Optimize default configurations - public int raiderActivationRange = 64;
+ public int monsterActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 24 : 32; // Plazma - Optimize default configurations
public int raiderActivationRange = 48;
- public int miscActivationRange = 16; - public int miscActivationRange = 16;
+ public int miscActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 8 : 16; // Plazma - Optimize default configurations - // Paper start
// Paper start
- public int flyingMonsterActivationRange = 32; - public int flyingMonsterActivationRange = 32;
- public int waterActivationRange = 16; - public int waterActivationRange = 16;
- public int villagerActivationRange = 32; - public int villagerActivationRange = 32;
+ public int flyingMonsterActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 48 : 32; // Plazma - Optimize default configurations - public int wakeUpInactiveAnimals = 4;
+ public int waterActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 8 : 16; // Plazma - Optimize default configurations - public int wakeUpInactiveAnimalsEvery = 60*20;
+ public int villagerActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 16 : 32; // Plazma - Optimize default configurations
public int wakeUpInactiveAnimals = 4;
public int wakeUpInactiveAnimalsEvery = 60*20;
- public int wakeUpInactiveAnimalsFor = 5*20; - public int wakeUpInactiveAnimalsFor = 5*20;
- public int wakeUpInactiveMonsters = 8; - public int wakeUpInactiveMonsters = 8;
+ public int wakeUpInactiveAnimalsFor = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 40 : 100; // Plazma - Optimize default configurations - public int wakeUpInactiveMonstersEvery = 20*20;
+ public int wakeUpInactiveMonsters = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 4 : 8; // Plazma - Optimize default configurations
public int wakeUpInactiveMonstersEvery = 20*20;
- public int wakeUpInactiveMonstersFor = 5*20; - public int wakeUpInactiveMonstersFor = 5*20;
- public int wakeUpInactiveVillagers = 4; - public int wakeUpInactiveVillagers = 4;
+ public int wakeUpInactiveMonstersFor = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 60 : 100; // Plazma - Optimize default configurations - public int wakeUpInactiveVillagersEvery = 30*20;
+ public int wakeUpInactiveVillagers = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 1 : 4; // Plazma - Optimize default configurations
public int wakeUpInactiveVillagersEvery = 30*20;
- public int wakeUpInactiveVillagersFor = 5*20; - public int wakeUpInactiveVillagersFor = 5*20;
- public int wakeUpInactiveFlying = 8; - public int wakeUpInactiveFlying = 8;
+ public int wakeUpInactiveVillagersFor = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 20 : 100; // Plazma - Optimize default configurations - public int wakeUpInactiveFlyingEvery = 10*20;
+ public int wakeUpInactiveFlying = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 1 : 8; // Plazma - Optimize default configurations
public int wakeUpInactiveFlyingEvery = 10*20;
- public int wakeUpInactiveFlyingFor = 5*20; - public int wakeUpInactiveFlyingFor = 5*20;
+ public int wakeUpInactiveFlyingFor = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 60 : 100; // Plazma - Optimize default configurations - public int villagersWorkImmunityAfter = 5*20;
public int villagersWorkImmunityAfter = 5*20; + // Plazma start - Optimize default configurations
+ public int animalActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 16 : 32;
+ public int monsterActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 24 : 32;
+ public int raiderActivationRange = 64; // diff on changes
+ public int miscActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 8 : 16;
+ // Paper start // diff on changes
+ public int flyingMonsterActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 48 : 32;
+ public int waterActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 8 : 16;
+ public int villagerActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 16 : 32;
+ public int wakeUpInactiveAnimals = 4; // diff on changes
+ public int wakeUpInactiveAnimalsEvery = 1200;
+ public int wakeUpInactiveAnimalsFor = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 40 : 100;
+ public int wakeUpInactiveMonsters = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 4 : 8;
+ public int wakeUpInactiveMonstersEvery = 400;
+ public int wakeUpInactiveMonstersFor = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 60 : 100;
+ public int wakeUpInactiveVillagers = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 1 : 4;
+ public int wakeUpInactiveVillagersEvery = 600;
+ public int wakeUpInactiveVillagersFor = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 20 : 100;
+ public int wakeUpInactiveFlying = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 1 : 8;
+ public int wakeUpInactiveFlyingEvery = 200;
+ public int wakeUpInactiveFlyingFor = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 60 : 100;
+ public int villagersWorkImmunityAfter = 100;
+ // Plazma end - Optimize default configurations
public int villagersWorkImmunityFor = 20; public int villagersWorkImmunityFor = 20;
public boolean villagersActiveForPanic = true; public boolean villagersActiveForPanic = true;
@@ -299,7 +299,7 @@ public class SpigotWorldConfig // Paper end
@@ -299,7 +301,7 @@ public class SpigotWorldConfig
{ {
this.set( "ticks-per.hopper-check", 1 ); this.set( "ticks-per.hopper-check", 1 );
} }
@@ -556,7 +550,7 @@ index 1cf6d4f854d89c515e48e1fb365eb95ff9340765..7d1ae99e83dc6511838092c3ab6e0fd5
this.hopperAmount = this.getInt( "hopper-amount", 1 ); this.hopperAmount = this.getInt( "hopper-amount", 1 );
this.hopperCanLoadChunks = this.getBoolean( "hopper-can-load-chunks", false ); this.hopperCanLoadChunks = this.getBoolean( "hopper-can-load-chunks", false );
this.log( "Hopper Transfer: " + this.hopperTransfer + " Hopper Check: " + this.hopperCheck + " Hopper Amount: " + this.hopperAmount + " Hopper Can Load Chunks: " + this.hopperCanLoadChunks ); this.log( "Hopper Transfer: " + this.hopperTransfer + " Hopper Check: " + this.hopperCheck + " Hopper Amount: " + this.hopperAmount + " Hopper Can Load Chunks: " + this.hopperCanLoadChunks );
@@ -309,7 +309,7 @@ public class SpigotWorldConfig @@ -309,7 +311,7 @@ public class SpigotWorldConfig
public int tridentDespawnRate; public int tridentDespawnRate;
private void arrowDespawnRate() private void arrowDespawnRate()
{ {

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Tweak console logging
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 3a2acbdcfb64dff5ecb686ba7ea405b488e6eca9..c48f42815314e2fb106b0dff5f38a9e5c3498632 100644 index f6afc085b..dea61aeaf 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -193,16 +193,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -197,16 +197,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
DedicatedServer.LOGGER.warn("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\""); DedicatedServer.LOGGER.warn("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\"");
} }
@@ -25,13 +25,12 @@ index 3a2acbdcfb64dff5ecb686ba7ea405b488e6eca9..c48f42815314e2fb106b0dff5f38a9e5
DedicatedServer.LOGGER.info("Loading properties"); DedicatedServer.LOGGER.info("Loading properties");
DedicatedServerProperties dedicatedserverproperties = this.settings.getProperties(); DedicatedServerProperties dedicatedserverproperties = this.settings.getProperties();
@@ -226,6 +216,17 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -239,6 +229,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
this.plazmaConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess()); // Plazma - Configurable Plazma this.plazmaConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess()); // Plazma - Configurable Plazma
net.sparklypower.sparklypaper.HalloweenManager.startSyncEpochTask(); // Plazma - Port SparklyPaper patches; Optimize Spooky Season net.sparklypower.sparklypaper.HalloweenManager.startSyncEpochTask(); // Plazma - Port SparklyPaper patches; Optimize Spooky Season
// Paper end - initialize global and world-defaults configuration // Paper end - initialize global and world-defaults configuration
+ // Plazma - Tweak console logging; Moved down + // Paper start - detect running as root // Plazma - Tweak console logging (moved down)
+ // Paper start - detect running as root + if (io.papermc.paper.util.ServerEnvironment.userIsRootOrAdmin()) {
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().consoleLogs.rootUserWarnings && io.papermc.paper.util.ServerEnvironment.userIsRootOrAdmin()) {
+ DedicatedServer.LOGGER.warn("****************************"); + DedicatedServer.LOGGER.warn("****************************");
+ DedicatedServer.LOGGER.warn("YOU ARE RUNNING THIS SERVER AS AN ADMINISTRATIVE OR ROOT USER. THIS IS NOT ADVISED."); + DedicatedServer.LOGGER.warn("YOU ARE RUNNING THIS SERVER AS AN ADMINISTRATIVE OR ROOT USER. THIS IS NOT ADVISED.");
+ DedicatedServer.LOGGER.warn("YOU ARE OPENING YOURSELF UP TO POTENTIAL RISKS WHEN DOING THIS."); + DedicatedServer.LOGGER.warn("YOU ARE OPENING YOURSELF UP TO POTENTIAL RISKS WHEN DOING THIS.");
@@ -39,11 +38,10 @@ index 3a2acbdcfb64dff5ecb686ba7ea405b488e6eca9..c48f42815314e2fb106b0dff5f38a9e5
+ DedicatedServer.LOGGER.warn("****************************"); + DedicatedServer.LOGGER.warn("****************************");
+ } + }
+ // Paper end - detect running as root + // Paper end - detect running as root
+ // Plazma end - Tweak console logging this.server.spark.enableEarlyIfRequested(); // Paper - spark
// Paper start - fix converting txt to json file; convert old users earlier after PlayerList creation but before file load/save // Paper start - fix converting txt to json file; convert old users earlier after PlayerList creation but before file load/save
if (this.convertOldUsers()) { if (this.convertOldUsers()) {
this.getProfileCache().save(false); // Paper @@ -339,6 +338,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -333,6 +334,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
String proxyFlavor = (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) ? "Velocity" : "BungeeCord"; String proxyFlavor = (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) ? "Velocity" : "BungeeCord";
String proxyLink = (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) ? "https://docs.papermc.io/velocity/security" : "http://www.spigotmc.org/wiki/firewall-guide/"; String proxyLink = (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) ? "https://docs.papermc.io/velocity/security" : "http://www.spigotmc.org/wiki/firewall-guide/";
// Paper end - Add Velocity IP Forwarding Support // Paper end - Add Velocity IP Forwarding Support
@@ -51,7 +49,7 @@ index 3a2acbdcfb64dff5ecb686ba7ea405b488e6eca9..c48f42815314e2fb106b0dff5f38a9e5
if (!this.usesAuthentication()) { if (!this.usesAuthentication()) {
DedicatedServer.LOGGER.warn("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!"); DedicatedServer.LOGGER.warn("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!");
DedicatedServer.LOGGER.warn("The server will make no attempt to authenticate usernames. Beware."); DedicatedServer.LOGGER.warn("The server will make no attempt to authenticate usernames. Beware.");
@@ -346,7 +348,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -352,7 +352,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
DedicatedServer.LOGGER.warn("While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose."); DedicatedServer.LOGGER.warn("While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose.");
} }
// Spigot end // Spigot end

View File

@@ -5,12 +5,12 @@ Subject: [PATCH] Add missing purpur configuration options
diff --git a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java diff --git a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
index 569f42645a7730451944fbbd6b96910493feeca5..a14d2ec3b8c89045916b95da5ce2a18d1e866bcf 100644 index 62c62fd26..43791817a 100644
--- a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java --- a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
+++ b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java +++ b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
@@ -150,6 +150,23 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS @@ -158,6 +158,23 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
protected void registerGoals() { this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.allayMaxHealth);
this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.allayScale);
} }
+ +
+ // Plazma start - Add missing purpur configuration options + // Plazma start - Add missing purpur configuration options
@@ -33,10 +33,10 @@ index 569f42645a7730451944fbbd6b96910493feeca5..a14d2ec3b8c89045916b95da5ce2a18d
@Override @Override
diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
index 24a1663cf1cd3f888981a13907811b55bdbf6133..fdc3aa9672077787e841d240fe1e690dcd9ca321 100644 index e88d6d691..00803dcc2 100644
--- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java --- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
+++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java +++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
@@ -93,6 +93,18 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl @@ -96,6 +96,18 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl
public int getPurpurBreedTime() { public int getPurpurBreedTime() {
return this.level().purpurConfig.camelBreedingTicks; return this.level().purpurConfig.camelBreedingTicks;
} }
@@ -51,7 +51,7 @@ index 24a1663cf1cd3f888981a13907811b55bdbf6133..fdc3aa9672077787e841d240fe1e690d
+ public boolean isAlwaysExperienceDropper() { + public boolean isAlwaysExperienceDropper() {
+ return level().purpurConfig.camelAlwaysDropExp; + return level().purpurConfig.camelAlwaysDropExp;
+ } + }
+ // Plazma end - Add missing purpur configuration optionsurpur end + // Plazma end - Add missing purpur configuration options
// Purpur end // Purpur end
@Override @Override
@@ -84,7 +84,7 @@ index 4c861b18fbfbae3cb2f1e3563393cfcf4005591c..651f30b4fb02dc03fabad34b62d7d86f
public int getPurpurBreedTime() { public int getPurpurBreedTime() {
diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java
index 64d0e2edf0e47bfe3bc5fbdbabac26c494110467..e077a0bffedd0bb11c9ab5eb507451a0cf6317ea 100644 index 5cd69dd54..1abf23fb1 100644
--- a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java --- a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java
+++ b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java +++ b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java
@@ -93,6 +93,23 @@ public class Tadpole extends AbstractFish { @@ -93,6 +93,23 @@ public class Tadpole extends AbstractFish {
@@ -112,10 +112,10 @@ index 64d0e2edf0e47bfe3bc5fbdbabac26c494110467..e077a0bffedd0bb11c9ab5eb507451a0
@Override @Override
diff --git a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java diff --git a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
index 21bdcbd51d9f440e0734750b40cefa4c08cdaf5f..a2cc1efaa621861828b007759536ac49d7e3646e 100644 index b6f528170..bc931f54d 100644
--- a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java --- a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
+++ b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java +++ b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
@@ -119,6 +119,18 @@ public class Sniffer extends Animal { @@ -120,6 +120,18 @@ public class Sniffer extends Animal {
public int getPurpurBreedTime() { public int getPurpurBreedTime() {
return this.level().purpurConfig.snifferBreedingTicks; return this.level().purpurConfig.snifferBreedingTicks;
} }
@@ -135,10 +135,10 @@ index 21bdcbd51d9f440e0734750b40cefa4c08cdaf5f..a2cc1efaa621861828b007759536ac49
@Override @Override
diff --git a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java diff --git a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
index 722e1fed4b333958e95a847b27cfc67d04f13263..16891921341f8967c9115f415f91ec379fcd5b0c 100644 index 8e24cd9ed..c0398f21c 100644
--- a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java --- a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
+++ b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java +++ b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
@@ -147,6 +147,23 @@ public class Warden extends Monster implements VibrationSystem { @@ -148,6 +148,23 @@ public class Warden extends Monster implements VibrationSystem {
this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
} }
@@ -163,7 +163,7 @@ index 722e1fed4b333958e95a847b27cfc67d04f13263..16891921341f8967c9115f415f91ec37
@Override @Override
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java b/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java diff --git a/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java b/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java
index e0aec3b3e04d603dc208029554f981c6b9e6b43e..337702c8042d44d4be6be1341023d0779cfaa580 100644 index c14019a13..8b9f78b3b 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java --- a/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java
@@ -45,12 +45,12 @@ public class ChestBoat extends Boat implements HasCustomInventoryScreen, Contain @@ -45,12 +45,12 @@ public class ChestBoat extends Boat implements HasCustomInventoryScreen, Contain
@@ -181,7 +181,7 @@ index e0aec3b3e04d603dc208029554f981c6b9e6b43e..337702c8042d44d4be6be1341023d077
this.setPos(d0, d1, d2); this.setPos(d0, d1, d2);
this.xo = d0; this.xo = d0;
this.yo = d1; this.yo = d1;
@@ -170,7 +170,7 @@ public class ChestBoat extends Boat implements HasCustomInventoryScreen, Contain @@ -177,7 +177,7 @@ public class ChestBoat extends Boat implements HasCustomInventoryScreen, Contain
@Override @Override
public int getContainerSize() { public int getContainerSize() {
@@ -191,10 +191,10 @@ index e0aec3b3e04d603dc208029554f981c6b9e6b43e..337702c8042d44d4be6be1341023d077
@Override @Override
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
index 0a8d1f2b33257a371abb97a3a88af1f89ee46e24..dace438eac55b33b9318dfd9f8706883bab64971 100644 index 97fc4fb79..cd8194b08 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java --- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
@@ -329,6 +329,7 @@ public class PurpurConfig { @@ -330,6 +330,7 @@ public class PurpurConfig {
} }
public static int barrelRows = 3; public static int barrelRows = 3;
@@ -202,7 +202,7 @@ index 0a8d1f2b33257a371abb97a3a88af1f89ee46e24..dace438eac55b33b9318dfd9f8706883
public static boolean enderChestSixRows = false; public static boolean enderChestSixRows = false;
public static boolean enderChestPermissionRows = false; public static boolean enderChestPermissionRows = false;
public static boolean cryingObsidianValidForPortalFrame = false; public static boolean cryingObsidianValidForPortalFrame = false;
@@ -369,6 +370,7 @@ public class PurpurConfig { @@ -372,6 +373,7 @@ public class PurpurConfig {
case 1 -> 9; case 1 -> 9;
default -> 27; default -> 27;
}); });
@@ -211,26 +211,24 @@ index 0a8d1f2b33257a371abb97a3a88af1f89ee46e24..dace438eac55b33b9318dfd9f8706883
org.bukkit.event.inventory.InventoryType.ENDER_CHEST.setDefaultSize(enderChestSixRows ? 54 : 27); org.bukkit.event.inventory.InventoryType.ENDER_CHEST.setDefaultSize(enderChestSixRows ? 54 : 27);
enderChestPermissionRows = getBoolean("settings.blocks.ender_chest.use-permissions-for-rows", enderChestPermissionRows); enderChestPermissionRows = getBoolean("settings.blocks.ender_chest.use-permissions-for-rows", enderChestPermissionRows);
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index b6a6a74dfd00a4536258c8693048c9d1ac4df435..182e8c3f9a631a98576b2efb63371d57f9f5f25f 100644 index 1ff95cced..0318c4916 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java --- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -1178,7 +1178,15 @@ public class PurpurWorldConfig { @@ -1135,7 +1135,13 @@ public class PurpurWorldConfig {
public boolean allayRidable = false;
public boolean allayRidableInWater = true;
public boolean allayControllable = true; public boolean allayControllable = true;
public double allayMaxHealth = 20.0D;
public double allayScale = 1.0D;
+ // Plazma start - Add missing purpur config options + // Plazma start - Add missing purpur config options
+ public double allayMaxHealth = 20.0D;
+ public boolean allayTakeDamageFromWater = false; + public boolean allayTakeDamageFromWater = false;
+ public boolean allayAlwaysDropExp = false; + public boolean allayAlwaysDropExp = false;
private void allaySettings() { private void allaySettings() {
+ allayMaxHealth = getDouble("mobs.allay.max-health", allayMaxHealth);
+ allayTakeDamageFromWater = getBoolean("mobs.allay.take-damage-from-water", allayTakeDamageFromWater); + allayTakeDamageFromWater = getBoolean("mobs.allay.take-damage-from-water", allayTakeDamageFromWater);
+ allayAlwaysDropExp = getBoolean("mobs.allay.always-drop-exp", allayAlwaysDropExp); + allayAlwaysDropExp = getBoolean("mobs.allay.always-drop-exp", allayAlwaysDropExp);
+ // Plazma end - Add missing purpur configuration options + // Plazma end - Add missing purpur configuration options
allayRidable = getBoolean("mobs.allay.ridable", allayRidable); allayRidable = getBoolean("mobs.allay.ridable", allayRidable);
allayRidableInWater = getBoolean("mobs.allay.ridable-in-water", allayRidableInWater); allayRidableInWater = getBoolean("mobs.allay.ridable-in-water", allayRidableInWater);
allayControllable = getBoolean("mobs.allay.controllable", allayControllable); allayControllable = getBoolean("mobs.allay.controllable", allayControllable);
@@ -1295,7 +1303,13 @@ public class PurpurWorldConfig { @@ -1290,7 +1296,13 @@ public class PurpurWorldConfig {
public double camelMovementSpeedMin = 0.09D; public double camelMovementSpeedMin = 0.09D;
public double camelMovementSpeedMax = 0.09D; public double camelMovementSpeedMax = 0.09D;
public int camelBreedingTicks = 6000; public int camelBreedingTicks = 6000;
@@ -244,7 +242,7 @@ index b6a6a74dfd00a4536258c8693048c9d1ac4df435..182e8c3f9a631a98576b2efb63371d57
camelRidableInWater = getBoolean("mobs.camel.ridable-in-water", camelRidableInWater); camelRidableInWater = getBoolean("mobs.camel.ridable-in-water", camelRidableInWater);
camelMaxHealthMin = getDouble("mobs.camel.attributes.max_health.min", camelMaxHealthMin); camelMaxHealthMin = getDouble("mobs.camel.attributes.max_health.min", camelMaxHealthMin);
camelMaxHealthMax = getDouble("mobs.camel.attributes.max_health.max", camelMaxHealthMax); camelMaxHealthMax = getDouble("mobs.camel.attributes.max_health.max", camelMaxHealthMax);
@@ -1723,7 +1737,15 @@ public class PurpurWorldConfig { @@ -1744,7 +1756,15 @@ public class PurpurWorldConfig {
public boolean frogControllable = true; public boolean frogControllable = true;
public float frogRidableJumpHeight = 0.65F; public float frogRidableJumpHeight = 0.65F;
public int frogBreedingTicks = 6000; public int frogBreedingTicks = 6000;
@@ -260,9 +258,9 @@ index b6a6a74dfd00a4536258c8693048c9d1ac4df435..182e8c3f9a631a98576b2efb63371d57
frogRidable = getBoolean("mobs.frog.ridable", frogRidable); frogRidable = getBoolean("mobs.frog.ridable", frogRidable);
frogRidableInWater = getBoolean("mobs.frog.ridable-in-water", frogRidableInWater); frogRidableInWater = getBoolean("mobs.frog.ridable-in-water", frogRidableInWater);
frogControllable = getBoolean("mobs.frog.controllable", frogControllable); frogControllable = getBoolean("mobs.frog.controllable", frogControllable);
@@ -2676,7 +2698,13 @@ public class PurpurWorldConfig { @@ -2756,7 +2776,13 @@ public class PurpurWorldConfig {
public boolean snifferControllable = true;
public double snifferMaxHealth = 14.0D; public double snifferMaxHealth = 14.0D;
public double snifferScale = 1.0D;
public int snifferBreedingTicks = 6000; public int snifferBreedingTicks = 6000;
+ // Plazma start - Add missing purpur config options + // Plazma start - Add missing purpur config options
+ public boolean snifferTakeDamageFromWater = false; + public boolean snifferTakeDamageFromWater = false;
@@ -274,7 +272,7 @@ index b6a6a74dfd00a4536258c8693048c9d1ac4df435..182e8c3f9a631a98576b2efb63371d57
snifferRidable = getBoolean("mobs.sniffer.ridable", snifferRidable); snifferRidable = getBoolean("mobs.sniffer.ridable", snifferRidable);
snifferRidableInWater = getBoolean("mobs.sniffer.ridable-in-water", snifferRidableInWater); snifferRidableInWater = getBoolean("mobs.sniffer.ridable-in-water", snifferRidableInWater);
snifferControllable = getBoolean("mobs.sniffer.controllable", snifferControllable); snifferControllable = getBoolean("mobs.sniffer.controllable", snifferControllable);
@@ -2775,7 +2803,15 @@ public class PurpurWorldConfig { @@ -2864,7 +2890,15 @@ public class PurpurWorldConfig {
public boolean tadpoleRidable = false; public boolean tadpoleRidable = false;
public boolean tadpoleRidableInWater = true; public boolean tadpoleRidableInWater = true;
public boolean tadpoleControllable = true; public boolean tadpoleControllable = true;
@@ -290,7 +288,7 @@ index b6a6a74dfd00a4536258c8693048c9d1ac4df435..182e8c3f9a631a98576b2efb63371d57
tadpoleRidable = getBoolean("mobs.tadpole.ridable", tadpoleRidable); tadpoleRidable = getBoolean("mobs.tadpole.ridable", tadpoleRidable);
tadpoleRidableInWater = getBoolean("mobs.tadpole.ridable-in-water", tadpoleRidableInWater); tadpoleRidableInWater = getBoolean("mobs.tadpole.ridable-in-water", tadpoleRidableInWater);
tadpoleControllable = getBoolean("mobs.tadpole.controllable", tadpoleControllable); tadpoleControllable = getBoolean("mobs.tadpole.controllable", tadpoleControllable);
@@ -2991,7 +3027,15 @@ public class PurpurWorldConfig { @@ -3092,7 +3126,15 @@ public class PurpurWorldConfig {
public boolean wardenRidable = false; public boolean wardenRidable = false;
public boolean wardenRidableInWater = true; public boolean wardenRidableInWater = true;
public boolean wardenControllable = true; public boolean wardenControllable = true;

View File

@@ -0,0 +1,32 @@
diff --git a/src/main/java/io/papermc/paper/util/player/NearbyPlayers.java b/src/main/java/io/papermc/paper/util/player/NearbyPlayers.java
index f164256d59b761264876ca0c85f812d101bfd5de..deaeb134c47da8710afa747bf980bd00aab846d6 100644
--- a/src/main/java/io/papermc/paper/util/player/NearbyPlayers.java
+++ b/src/main/java/io/papermc/paper/util/player/NearbyPlayers.java
@@ -106,6 +106,13 @@ public final class NearbyPlayers {
return chunk == null ? null : chunk.players[type.ordinal()];
}
+ // Plazma start - Port SparklyPaper patches; Cache coordinate key used for nearby players when ticking chunks
+ public ReferenceList<ServerPlayer> getPlayers(final long nearbyCoordKey, final NearbyMapType type) {
+ final TrackedChunk chunk = this.byChunk.get(nearbyCoordKey);
+ return chunk == null ? null : chunk.players[type.ordinal()];
+ }
+ // Plazma end - Port SparklyPaper patches; Cache coordinate key used for nearby players when ticking chunks
+
public ReferenceList<ServerPlayer> getPlayersByChunk(final int chunkX, final int chunkZ, final NearbyMapType type) {
final TrackedChunk chunk = this.byChunk.get(CoordinateUtils.getChunkKey(chunkX, chunkZ));
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 5eb7bcf492ee354ef775cd8d09c7ca2bdfeb7ce2..697cb18bce2f2470a0a2347ba6709e1449b360fd 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -615,7 +615,7 @@ public class ServerChunkCache extends ChunkSource {
// Paper start - optimise chunk tick iteration
com.destroystokyo.paper.util.maplist.ReferenceList<ServerPlayer> playersNearby
- = nearbyPlayers.getPlayers(chunkcoordintpair, io.papermc.paper.util.player.NearbyPlayers.NearbyMapType.SPAWN_RANGE);
+ = nearbyPlayers.getPlayers(chunk1.nearbyPlayersCoordinateKey, io.papermc.paper.util.player.NearbyPlayers.NearbyMapType.SPAWN_RANGE);
if (playersNearby == null) {
continue;
}

View File

@@ -0,0 +1,14 @@
diff --git a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
index c867796f6..ecced2072 100644
--- a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
+++ b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
@@ -181,7 +222,7 @@ public class WorldConfiguration extends ConfigurationPart {
@MergeMap
public Reference2IntMap<MobCategory> spawnLimits = Util.make(new Reference2IntOpenHashMap<>(NaturalSpawner.SPAWNING_CATEGORIES.length), map -> Arrays.stream(NaturalSpawner.SPAWNING_CATEGORIES).forEach(mobCategory -> map.put(mobCategory, -1)));
@MergeMap
- public Map<MobCategory, DespawnRange> despawnRanges = Arrays.stream(MobCategory.values()).collect(Collectors.toMap(Function.identity(), category -> new DespawnRange(category.getNoDespawnDistance(), category.getDespawnDistance())));
+ public Map<MobCategory, DespawnRange> despawnRanges = Arrays.stream(MobCategory.values()).collect(Collectors.toMap(Function.identity(), category -> new DespawnRange(category.getNoDespawnDistance(), org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? (net.minecraft.server.MinecraftServer.getServer().server.getSimulationDistance() * 16) + 8 : category.getDespawnDistance()))); // Plazma - Optimize default configurations
@MergeMap
public Reference2IntMap<MobCategory> ticksPerSpawn = Util.make(new Reference2IntOpenHashMap<>(NaturalSpawner.SPAWNING_CATEGORIES.length), map -> Arrays.stream(NaturalSpawner.SPAWNING_CATEGORIES).forEach(mobCategory -> map.put(mobCategory, -1)));