9
0
mirror of https://github.com/Dreeam-qwq/Gale.git synced 2025-12-23 16:59:23 +00:00

Remove vanilla profiler

This commit is contained in:
Martijn Muijsers
2022-12-22 23:08:14 +01:00
parent 36f648cddb
commit 54108bde41
53 changed files with 2056 additions and 322 deletions

View File

@@ -7,7 +7,7 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org Gale - https://galemc.org
diff --git a/src/main/java/net/minecraft/server/network/TextFilterClient.java b/src/main/java/net/minecraft/server/network/TextFilterClient.java diff --git a/src/main/java/net/minecraft/server/network/TextFilterClient.java b/src/main/java/net/minecraft/server/network/TextFilterClient.java
index 92a60fc35145b7dd5fe17ea9b6823a919f483945..2393b6a5f3f12c2b17b172ee8ca42ead218e2a10 100644 index e0c6783071b1a6ff841842f8a88a990d0fe83180..4b3d2280326c7eeda4952c36edff141cbff90e16 100644
--- a/src/main/java/net/minecraft/server/network/TextFilterClient.java --- a/src/main/java/net/minecraft/server/network/TextFilterClient.java
+++ b/src/main/java/net/minecraft/server/network/TextFilterClient.java +++ b/src/main/java/net/minecraft/server/network/TextFilterClient.java
@@ -98,38 +98,44 @@ public class TextFilterClient implements AutoCloseable { @@ -98,38 +98,44 @@ public class TextFilterClient implements AutoCloseable {
@@ -92,3 +92,29 @@ index 50a9f33aa31e9273c7c52d4bb2b02f0f884f7ba5..19779298b2b2ecbe30f9308dad1d8037
return this.allInstances.stream().filter(typeClass::isInstance).collect(Collectors.toList()); return this.allInstances.stream().filter(typeClass::isInstance).collect(Collectors.toList());
}); });
return Collections.unmodifiableCollection(list); return Collections.unmodifiableCollection(list);
diff --git a/src/main/java/net/minecraft/world/entity/monster/Zoglin.java b/src/main/java/net/minecraft/world/entity/monster/Zoglin.java
index 5956a7759964f5e4939f062e93714fba64f53141..51ad507a3b625201ecca50bd92f8f089f3b4d60a 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Zoglin.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Zoglin.java
@@ -182,7 +182,7 @@ public class Zoglin extends Monster implements Enemy, HoglinBase {
@Override
public Brain<Zoglin> getBrain() {
- return super.getBrain();
+ return (Brain<Zoglin>) super.getBrain(); // Gale - dev import deobfuscation fixes
}
protected void updateActivity() {
diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java
index ac75c54e897565e340b66823caeed92ba1d1641a..e44eec821eaa1cd77569814000d4aa36253fb13d 100644
--- a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java
+++ b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java
@@ -70,7 +70,7 @@ public class PiglinBrute extends AbstractPiglin {
@Override
public Brain<PiglinBrute> getBrain() {
- return super.getBrain();
+ return (Brain<PiglinBrute>) super.getBrain(); // Gale - dev import deobfuscation fixes
}
@Override

File diff suppressed because it is too large Load Diff

View File

@@ -40,10 +40,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 9e075de3542bda8ae086c9ca68bcd00b16d565d0..a635319daf8b9a7de45c080ce71c24a90530c45b 100644 index 90d45d9c7dca9ff4acde6fc8539dcaf8eb59fe11..dc4bbb66a4077350657ef0034960a646ba03082b 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3647,7 +3647,7 @@ public abstract class LivingEntity extends Entity { @@ -3629,7 +3629,7 @@ public abstract class LivingEntity extends Entity {
Vec3 vec3d1 = new Vec3(entity.getX(), entity.getEyeY(), entity.getZ()); Vec3 vec3d1 = new Vec3(entity.getX(), entity.getEyeY(), entity.getZ());
// Paper - diff on change - used in CraftLivingEntity#hasLineOfSight(Location) and CraftWorld#lineOfSightExists // Paper - diff on change - used in CraftLivingEntity#hasLineOfSight(Location) and CraftWorld#lineOfSightExists
@@ -74,10 +74,10 @@ index d1eefa6ef3e9abfe7af4d8310aa64465fa2d5463..c970be55461f3063ec22ec0490781b97
default BlockHitResult clip(ClipContext raytrace1, BlockPos blockposition) { default BlockHitResult clip(ClipContext raytrace1, BlockPos blockposition) {
// Paper start - Prevent raytrace from loading chunks // Paper start - Prevent raytrace from loading chunks
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 6b5740e4e73a753c9516d7cbde575c1826afa22a..dde088d4ad90a63adc480492be42bc2dfc0f0cf7 100644 index d92a2ac99b22ae8617c295b44e6b8cab2a95ae48..924e507a67e87c56346e7ae0ba6ef3fd8f72f853 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
@@ -406,6 +406,91 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -403,6 +403,91 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
return null; return null;
} }

View File

@@ -19,10 +19,10 @@ require it to be initialized earlier. By moving it to the superclass, we
initialize it earlier, ensuring that it is available sooner. initialize it earlier, ensuring that it is available sooner.
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 e9c7e0f0c411f4a810c9ab3b846c74353a6ef815..2f57e7c3cfbba9c6ee832dec01ef7079d5e4d1c2 100644 index c44d75ccda1edc7d2d04c42fb1af141cd22b2354..a44374f7ec27bdb12ab69d516fb847d223fc60ee 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
@@ -793,7 +793,6 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -772,7 +772,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
} }
// Paper start - optimise random block ticking // Paper start - optimise random block ticking
private final BlockPos.MutableBlockPos chunkTickMutablePosition = new BlockPos.MutableBlockPos(); private final BlockPos.MutableBlockPos chunkTickMutablePosition = new BlockPos.MutableBlockPos();
@@ -31,10 +31,10 @@ index e9c7e0f0c411f4a810c9ab3b846c74353a6ef815..2f57e7c3cfbba9c6ee832dec01ef7079
public void tickChunk(LevelChunk chunk, int randomTickSpeed) { public void tickChunk(LevelChunk chunk, int randomTickSpeed) {
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 dde088d4ad90a63adc480492be42bc2dfc0f0cf7..89f0914a2cc4e06363a0fb63774efc484ebcdab0 100644 index 924e507a67e87c56346e7ae0ba6ef3fd8f72f853..860d398c2228b14000dcf8bf2460e7c2eaa56739 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
@@ -179,6 +179,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -177,6 +177,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public final Map<Explosion.CacheKey, Float> explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions public final Map<Explosion.CacheKey, Float> explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions
public java.util.ArrayDeque<net.minecraft.world.level.block.RedstoneTorchBlock.Toggle> redstoneUpdateInfos; // Paper - Move from Map in BlockRedstoneTorch to here public java.util.ArrayDeque<net.minecraft.world.level.block.RedstoneTorchBlock.Toggle> redstoneUpdateInfos; // Paper - Move from Map in BlockRedstoneTorch to here

View File

@@ -52,22 +52,22 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index ca84eddbdb1e198b899750e5f6b3eafd25ce970f..5b8260b6a309bd1aba2286e8c1f8cfc44326adbd 100644 index d95c3b14c06421c03c99f84efb3a5319200f8a57..8ed18a158a13dceca7cd342125c09e52ac0d013c 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -703,6 +703,7 @@ public class ServerChunkCache extends ChunkSource { @@ -689,6 +689,7 @@ public class ServerChunkCache extends ChunkSource {
ProfilerFiller gameprofilerfiller = this.level.getProfiler(); // Paper end - optimize isOutisdeRange
LevelData worlddata = this.level.getLevelData();
gameprofilerfiller.push("pollingChunks");
+ this.level.resetIceAndSnowTick(); // Gale - Airplane - optimize random calls in chunk ticking - reset ice & snow tick random + this.level.resetIceAndSnowTick(); // Gale - Airplane - optimize random calls in chunk ticking - reset ice & snow tick random
int k = this.level.getGameRules().getInt(GameRules.RULE_RANDOMTICKING); int k = this.level.getGameRules().getInt(GameRules.RULE_RANDOMTICKING);
boolean flag1 = level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) != 0L && worlddata.getGameTime() % level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) == 0L; // CraftBukkit boolean flag1 = level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) != 0L && worlddata.getGameTime() % level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) == 0L; // CraftBukkit
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 2f57e7c3cfbba9c6ee832dec01ef7079d5e4d1c2..aeaa5c08e8694b353b33f95e2973e6c38bc280a0 100644 index a44374f7ec27bdb12ab69d516fb847d223fc60ee..b589aeb3af47437a657bda806c99ef3fa95f22f8 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
@@ -795,6 +795,8 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -774,6 +774,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
private final BlockPos.MutableBlockPos chunkTickMutablePosition = new BlockPos.MutableBlockPos(); private final BlockPos.MutableBlockPos chunkTickMutablePosition = new BlockPos.MutableBlockPos();
// Paper end // Paper end
@@ -76,8 +76,8 @@ index 2f57e7c3cfbba9c6ee832dec01ef7079d5e4d1c2..aeaa5c08e8694b353b33f95e2973e6c3
public void tickChunk(LevelChunk chunk, int randomTickSpeed) { public void tickChunk(LevelChunk chunk, int randomTickSpeed) {
ChunkPos chunkcoordintpair = chunk.getPos(); ChunkPos chunkcoordintpair = chunk.getPos();
boolean flag = this.isRaining(); boolean flag = this.isRaining();
@@ -805,7 +807,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -781,7 +783,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
gameprofilerfiller.push("thunder"); int k = chunkcoordintpair.getMinBlockZ();
final BlockPos.MutableBlockPos blockposition = this.chunkTickMutablePosition; // Paper - use mutable to reduce allocation rate, final to force compile fail on change final BlockPos.MutableBlockPos blockposition = this.chunkTickMutablePosition; // Paper - use mutable to reduce allocation rate, final to force compile fail on change
- if (!this.paperConfig().environment.disableThunder && flag && this.isThundering() && this.spigotConfig.thunderChance > 0 && this.random.nextInt(this.spigotConfig.thunderChance) == 0) { // Spigot // Paper - disable thunder - if (!this.paperConfig().environment.disableThunder && flag && this.isThundering() && this.spigotConfig.thunderChance > 0 && this.random.nextInt(this.spigotConfig.thunderChance) == 0) { // Spigot // Paper - disable thunder
@@ -85,8 +85,8 @@ index 2f57e7c3cfbba9c6ee832dec01ef7079d5e4d1c2..aeaa5c08e8694b353b33f95e2973e6c3
blockposition.set(this.findLightningTargetAround(this.getBlockRandomPos(j, 0, k, 15))); // Paper blockposition.set(this.findLightningTargetAround(this.getBlockRandomPos(j, 0, k, 15))); // Paper
if (this.isRainingAt(blockposition)) { if (this.isRainingAt(blockposition)) {
DifficultyInstance difficultydamagescaler = this.getCurrentDifficultyAt(blockposition); DifficultyInstance difficultydamagescaler = this.getCurrentDifficultyAt(blockposition);
@@ -835,7 +837,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -810,7 +812,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
gameprofilerfiller.popPush("iceandsnow");
int l; int l;
- if (!this.paperConfig().environment.disableIceAndSnow && this.random.nextInt(16) == 0) { // Paper - Disable ice and snow - if (!this.paperConfig().environment.disableIceAndSnow && this.random.nextInt(16) == 0) { // Paper - Disable ice and snow
@@ -95,10 +95,10 @@ index 2f57e7c3cfbba9c6ee832dec01ef7079d5e4d1c2..aeaa5c08e8694b353b33f95e2973e6c3
this.getRandomBlockPosition(j, 0, k, 15, blockposition); this.getRandomBlockPosition(j, 0, k, 15, blockposition);
int normalY = chunk.getHeight(Heightmap.Types.MOTION_BLOCKING, blockposition.getX() & 15, blockposition.getZ() & 15) + 1; int normalY = chunk.getHeight(Heightmap.Types.MOTION_BLOCKING, blockposition.getX() & 15, blockposition.getZ() & 15) + 1;
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 28e4b302284f955a73e75d0f4276d55fb51826f5..9279e4fe06178528c2df539ca2dbf9e830ac787c 100644 index 40e0c951604875ce96b200561cbbf51bab97e188..bca581f2a192015f5461e5bf776234687e5ae9fc 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
@@ -88,6 +88,18 @@ public class LevelChunk extends ChunkAccess { @@ -87,6 +87,18 @@ public class LevelChunk extends ChunkAccess {
private final LevelChunkTicks<Block> blockTicks; private final LevelChunkTicks<Block> blockTicks;
private final LevelChunkTicks<Fluid> fluidTicks; private final LevelChunkTicks<Fluid> fluidTicks;
@@ -117,7 +117,7 @@ index 28e4b302284f955a73e75d0f4276d55fb51826f5..9279e4fe06178528c2df539ca2dbf9e8
public LevelChunk(Level world, ChunkPos pos) { public LevelChunk(Level world, ChunkPos pos) {
this(world, pos, UpgradeData.EMPTY, new LevelChunkTicks<>(), new LevelChunkTicks<>(), 0L, (LevelChunkSection[]) null, (LevelChunk.PostLoadProcessor) null, (BlendingData) null); this(world, pos, UpgradeData.EMPTY, new LevelChunkTicks<>(), new LevelChunkTicks<>(), 0L, (LevelChunkSection[]) null, (LevelChunk.PostLoadProcessor) null, (BlendingData) null);
} }
@@ -118,6 +130,7 @@ public class LevelChunk extends ChunkAccess { @@ -117,6 +129,7 @@ public class LevelChunk extends ChunkAccess {
this.fluidTicks = fluidTickScheduler; this.fluidTicks = fluidTickScheduler;
// CraftBukkit start // CraftBukkit start
this.bukkitChunk = new org.bukkit.craftbukkit.CraftChunk(this); this.bukkitChunk = new org.bukkit.craftbukkit.CraftChunk(this);

View File

@@ -31,7 +31,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/world/entity/player/Inventory.java b/src/main/java/net/minecraft/world/entity/player/Inventory.java diff --git a/src/main/java/net/minecraft/world/entity/player/Inventory.java b/src/main/java/net/minecraft/world/entity/player/Inventory.java
index a1a625a8dacf4d2bbf75ddd90dce1b1be663c919..1147eab33e1570f53ecc8e59218e96598535f501 100644 index 5bc033bf59d49eda1f8f2574165bbcbeab7faa0f..b59185cff16528b2e5a0c52807db9f21e2a68dda 100644
--- a/src/main/java/net/minecraft/world/entity/player/Inventory.java --- a/src/main/java/net/minecraft/world/entity/player/Inventory.java
+++ b/src/main/java/net/minecraft/world/entity/player/Inventory.java +++ b/src/main/java/net/minecraft/world/entity/player/Inventory.java
@@ -681,6 +681,8 @@ public class Inventory implements Container, Nameable { @@ -681,6 +681,8 @@ public class Inventory implements Container, Nameable {

View File

@@ -186,7 +186,7 @@ index 0000000000000000000000000000000000000000..bf6a36c933b686f0e34591dff3d43b37
+ } + }
+} +}
diff --git a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java diff --git a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
index ff40fe323964f173561a6838fb443e79abf9df38..91ba64113f8fba4e0ada8b10d379243ae8c03327 100644 index 0ffc131baf5c0edc4f2ca0f466fcdb20be4a47b8..eafd6fa6c5eec1e3c164cbdc235be2681b7df04a 100644
--- a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java --- a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
+++ b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java +++ b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
@@ -43,6 +43,8 @@ public abstract class FlowingFluid extends Fluid { @@ -43,6 +43,8 @@ public abstract class FlowingFluid extends Fluid {

View File

@@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index a635319daf8b9a7de45c080ce71c24a90530c45b..1ef947f46f63589ce0e11c8db357cb817eecbbd2 100644 index dc4bbb66a4077350657ef0034960a646ba03082b..1ca43696e693c49279a2dd5f5bba557e0a2704fb 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1934,6 +1934,20 @@ public abstract class LivingEntity extends Entity { @@ -1932,6 +1932,20 @@ public abstract class LivingEntity extends Entity {
return this.lastClimbablePos; return this.lastClimbablePos;
} }

View File

@@ -1,93 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martijn Muijsers <martijnmuijsers@live.nl>
Date: Wed, 23 Nov 2022 21:45:42 +0100
Subject: [PATCH] Config to disable vanilla profiler
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
This patch is based on the following patch:
"Config to disable method profiler"
By: Paul Sauve <paul@technove.co>
As part of: Airplane (https://github.com/TECHNOVE/Airplane)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
* Airplane copyright *
Airplane
Copyright (C) 2020 Technove LLC
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 3898e8a92edca52bc7d4e9ac061e24baceaec608..4e2cb2923d1d2a337ffda5b1990d5c9caf47b779 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -160,6 +160,7 @@ import net.minecraft.world.phys.Vec2;
import net.minecraft.world.phys.Vec3;
import org.apache.commons.lang3.Validate;
import org.galemc.gale.configuration.GaleConfigurations;
+import org.galemc.gale.configuration.GaleGlobalConfiguration;
import org.slf4j.Logger;
// CraftBukkit start
@@ -2243,6 +2244,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public ProfilerFiller getProfiler() {
+ // Gale start - Airplane - config to disable vanilla profiler
+ if (GaleGlobalConfiguration.get().smallOptimizations.disableVanillaProfiler) {
+ return net.minecraft.util.profiling.InactiveProfiler.INSTANCE;
+ }
+ // Gale end - Airplane - config to disable vanilla profiler
return this.profiler;
}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 89f0914a2cc4e06363a0fb63774efc484ebcdab0..3adad35d0e63091a53e639c7027ec784d18bc4e7 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -91,6 +91,7 @@ import org.bukkit.craftbukkit.block.data.CraftBlockData;
import org.bukkit.craftbukkit.util.CraftSpawnCategory;
import org.bukkit.entity.SpawnCategory;
import org.bukkit.event.block.BlockPhysicsEvent;
+import org.galemc.gale.configuration.GaleGlobalConfiguration;
import org.galemc.gale.configuration.GaleWorldConfiguration;
// CraftBukkit end
@@ -1536,6 +1537,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
}
public ProfilerFiller getProfiler() {
+ // Gale start - Airplane - config to disable vanilla profiler
+ if (GaleGlobalConfiguration.get().smallOptimizations.disableVanillaProfiler) {
+ return net.minecraft.util.profiling.InactiveProfiler.INSTANCE;
+ }
+ // Gale end - Airplane - config to disable vanilla profiler
return (ProfilerFiller) this.profiler.get();
}
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index af4883f8939d017866a9b057491a8400b11fe009..5bf0c4d9cf136cd19d87ee04a834413240eec339 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
@@ -41,6 +41,8 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
}
+ public boolean disableVanillaProfiler = true; // Gale - Airplane - config to disable vanilla profiler
+
}
}

View File

@@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
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 3adad35d0e63091a53e639c7027ec784d18bc4e7..0ba38fddff7b3751d652d1148f993453164e2034 100644 index 860d398c2228b14000dcf8bf2460e7c2eaa56739..70a4cabf3cc5a1d2fb4db462374f8d3aaf17487e 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
@@ -271,6 +271,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -268,6 +268,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public abstract ResourceKey<LevelStem> getTypeKey(); public abstract ResourceKey<LevelStem> getTypeKey();
@@ -47,10 +47,10 @@ index 3adad35d0e63091a53e639c7027ec784d18bc4e7..0ba38fddff7b3751d652d1148f993453
+ @Override public final int getHeight() { return this.height; } + @Override public final int getHeight() { return this.height; }
+ // Gale end - Airplane - inline level height + // Gale end - Airplane - inline level height
+ +
protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.function.Function<org.spigotmc.SpigotWorldConfig, GaleWorldConfiguration> galeWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor // Gale - Gale configuration protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, Holder<DimensionType> holder, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.function.Function<org.spigotmc.SpigotWorldConfig, GaleWorldConfiguration> galeWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor // Gale - Gale configuration // Gale - Purpur - remove vanilla profiler
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper
@@ -294,6 +303,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -290,6 +299,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
}); });
final DimensionType dimensionmanager = (DimensionType) holder.value(); final DimensionType dimensionmanager = (DimensionType) holder.value();

View File

@@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
index 01b21f520ef1c834b9bafc3de85c1fa4fcf539d6..6c5ff935adb434a67a8425f3b8b7335fbad92a43 100644 index 88ae013bdb94c228860c6e7869608a2777d52f3e..969933ff94a1ae5a36d0550cd10d9e9803813136 100644
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java --- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java +++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
@@ -417,13 +417,14 @@ public final class NaturalSpawner { @@ -415,13 +415,14 @@ public final class NaturalSpawner {
} }
} }

View File

@@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
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 2212f9f48636357265d8e44aba415ea4f09f1fe7..eea6753afdd7e9d52746d0decb5cde63044012b5 100644 index d1e8123a114ea45846234535155df6cd039ba305..41140fbf32fc4db1b2460e453420e538290f4f99 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
@@ -1624,8 +1624,30 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1617,8 +1617,30 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
return ChunkMap.this.level.getServer().getScaledTrackingDistance(initialDistance); return ChunkMap.this.level.getServer().getScaledTrackingDistance(initialDistance);
} }
@@ -65,7 +65,7 @@ index 2212f9f48636357265d8e44aba415ea4f09f1fe7..eea6753afdd7e9d52746d0decb5cde63
Iterator iterator = this.entity.getIndirectPassengers().iterator(); Iterator iterator = this.entity.getIndirectPassengers().iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
@@ -1637,6 +1659,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1630,6 +1652,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
i = j; i = j;
} }
} }

View File

@@ -31,13 +31,13 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
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 aeaa5c08e8694b353b33f95e2973e6c38bc280a0..8924630ca5049f14e5e69323a2d4f7218e06a2aa 100644 index b589aeb3af47437a657bda806c99ef3fa95f22f8..5f3e3383f20b850720835fab948bb610978e4fe9 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
@@ -728,7 +728,20 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -711,7 +711,20 @@ public class ServerLevel extends Level implements WorldGenLevel {
entity.stopRiding();
} }
gameprofilerfiller.push("tick");
- this.guardEntityTick(this::tickNonPassenger, entity); - this.guardEntityTick(this::tickNonPassenger, entity);
+ // Gale start - Airplane - remove lambda from ticking guard - copied from guardEntityTick + // Gale start - Airplane - remove lambda from ticking guard - copied from guardEntityTick
+ try { + try {
@@ -53,14 +53,14 @@ index aeaa5c08e8694b353b33f95e2973e6c38bc280a0..8924630ca5049f14e5e69323a2d4f721
+ // Paper end + // Paper end
+ } + }
+ // Gale end - Airplane - remove lambda from ticking guard - copied from guardEntityTick + // Gale end - Airplane - remove lambda from ticking guard - copied from guardEntityTick
gameprofilerfiller.pop();
} }
} }
}
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 0ba38fddff7b3751d652d1148f993453164e2034..14c2e816e6bc5801846c296318afe223abf95c5d 100644 index 70a4cabf3cc5a1d2fb4db462374f8d3aaf17487e..95d8883fabc6a7ea6f9e6dfcff9e2f2fce917dfe 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
@@ -1020,13 +1020,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -1010,13 +1010,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
try { try {
tickConsumer.accept(entity); tickConsumer.accept(entity);
MinecraftServer.getServer().executeMidTickTasks(); // Paper - execute chunk tasks mid tick MinecraftServer.getServer().executeMidTickTasks(); // Paper - execute chunk tasks mid tick

View File

@@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index e00c6d14d33b0b32ee77f68d5fc4b6fbc15e024a..5295b32a2d0b758e878897aebdd8906680cd7bb5 100644 index a8d10092a990aa63c71846425aed261ecb845514..910724dce6b96a0359808f2311dbd1e9ccee47ea 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -4099,16 +4099,18 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -4082,16 +4082,18 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
} }
public boolean updateFluidHeightAndDoFluidPushing(TagKey<Fluid> tag, double speed) { public boolean updateFluidHeightAndDoFluidPushing(TagKey<Fluid> tag, double speed) {
@@ -60,7 +60,7 @@ index e00c6d14d33b0b32ee77f68d5fc4b6fbc15e024a..5295b32a2d0b758e878897aebdd89066
double d1 = 0.0D; double d1 = 0.0D;
boolean flag = this.isPushedByFluid(); boolean flag = this.isPushedByFluid();
boolean flag1 = false; boolean flag1 = false;
@@ -4116,14 +4118,61 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -4099,14 +4101,61 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
int k1 = 0; int k1 = 0;
BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos(); BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos();
@@ -128,7 +128,7 @@ index e00c6d14d33b0b32ee77f68d5fc4b6fbc15e024a..5295b32a2d0b758e878897aebdd89066
if (d2 >= axisalignedbb.minY) { if (d2 >= axisalignedbb.minY) {
flag1 = true; flag1 = true;
@@ -4145,9 +4194,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -4128,9 +4177,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
// CraftBukkit end // CraftBukkit end
} }
} }

View File

@@ -13,7 +13,7 @@ As part of: Pufferfish (https://github.com/pufferfish-gg/Pufferfish)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/build.gradle.kts b/build.gradle.kts diff --git a/build.gradle.kts b/build.gradle.kts
index 977edc4adb5414e83d289cca295baa6bfbadaa52..a63dce4a46a9df755a6dce8c959f3a0f1e151f67 100644 index ebe3f85542004002713dd327e8a423f2570695ed..f3287cea49ee7352a1065dc65927ab9922d0a9c4 100644
--- a/build.gradle.kts --- a/build.gradle.kts
+++ b/build.gradle.kts +++ b/build.gradle.kts
@@ -62,6 +62,7 @@ tasks.withType<JavaCompile> { @@ -62,6 +62,7 @@ tasks.withType<JavaCompile> {
@@ -68,12 +68,12 @@ index 9c3ccbbd657d1605b8fabb6e01c11ff31f39a17e..1d1db89362b78ac34d46cdd71b9ab274
this.setFlightAllowed(dedicatedserverproperties.allowFlight); this.setFlightAllowed(dedicatedserverproperties.allowFlight);
this.setMotd(dedicatedserverproperties.motd); this.setMotd(dedicatedserverproperties.motd);
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index 5bf0c4d9cf136cd19d87ee04a834413240eec339..a1d5197a5e7a00fad1025741ef8adcea45d42533 100644 index af4883f8939d017866a9b057491a8400b11fe009..9bdbd921acdbfdc8da49ce113d009b58749c1d5d 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
@@ -43,6 +43,14 @@ public class GaleGlobalConfiguration extends ConfigurationPart { @@ -41,6 +41,14 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
public boolean disableVanillaProfiler = true; // Gale - Airplane - config to disable vanilla profiler }
+ // Gale start - Pufferfish - SIMD support + // Gale start - Pufferfish - SIMD support
+ public Simd simd; + public Simd simd;

View File

@@ -28,10 +28,10 @@ but is so much cheaper than the suffocation check that it's worth
keeping it. keeping it.
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 1ef947f46f63589ce0e11c8db357cb817eecbbd2..b109c55a31a9e5a0813e360d8a3c1b13d1bfd416 100644 index 1ca43696e693c49279a2dd5f5bba557e0a2704fb..197c99b23584ef1aed1be821d9673bacabb561e5 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -402,7 +402,10 @@ public abstract class LivingEntity extends Entity { @@ -401,7 +401,10 @@ public abstract class LivingEntity extends Entity {
boolean flag = this instanceof net.minecraft.world.entity.player.Player; boolean flag = this instanceof net.minecraft.world.entity.player.Player;
if (!this.level.isClientSide) { if (!this.level.isClientSide) {
@@ -43,7 +43,7 @@ index 1ef947f46f63589ce0e11c8db357cb817eecbbd2..b109c55a31a9e5a0813e360d8a3c1b13
this.hurt(DamageSource.IN_WALL, 1.0F); this.hurt(DamageSource.IN_WALL, 1.0F);
} else if (flag && !this.level.getWorldBorder().isWithinBounds(this.getBoundingBox())) { } else if (flag && !this.level.getWorldBorder().isWithinBounds(this.getBoundingBox())) {
double d0 = this.level.getWorldBorder().getDistanceToBorder(this) + this.level.getWorldBorder().getDamageSafeZone(); double d0 = this.level.getWorldBorder().getDistanceToBorder(this) + this.level.getWorldBorder().getDamageSafeZone();
@@ -1327,6 +1330,15 @@ public abstract class LivingEntity extends Entity { @@ -1325,6 +1328,15 @@ public abstract class LivingEntity extends Entity {
return this.getHealth() <= 0.0F; return this.getHealth() <= 0.0F;
} }

View File

@@ -13,10 +13,10 @@ As part of: EmpireCraft (https://github.com/starlis/empirecraft)
Licensed under: MIT (https://opensource.org/licenses/MIT) Licensed under: MIT (https://opensource.org/licenses/MIT)
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 0c2255b6e2fb7752f85b0f83d4f84732758bd14d..4f828048114172c399c6ce7bfa4bead007473269 100644 index 757146c2b20d731577983375d34afaa80df639d8..ba408197c1d949800726bd08563c25033d84072b 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2330,6 +2330,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2328,6 +2328,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
} else if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales } else if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales
this.send(new ClientboundSystemChatPacket(Component.translatable("chat.disabled.options").withStyle(ChatFormatting.RED), false)); this.send(new ClientboundSystemChatPacket(Component.translatable("chat.disabled.options").withStyle(ChatFormatting.RED), false));
return Optional.empty(); return Optional.empty();

View File

@@ -44,10 +44,10 @@ index 72946e324c575ef39f3939225b96b68f724da460..75e2a7d19a7056b73c1524902e44cca0
} }
} }
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index a1d5197a5e7a00fad1025741ef8adcea45d42533..c67adaa664bfe2b371f14efa83ea200b0e1006f0 100644 index 9bdbd921acdbfdc8da49ce113d009b58749c1d5d..d407916de006a68318de63b81773e0dfe0d9c119 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
@@ -53,4 +53,11 @@ public class GaleGlobalConfiguration extends ConfigurationPart { @@ -51,4 +51,11 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
} }

View File

@@ -7,7 +7,7 @@ License: AGPL-3.0 (https://www.gnu.org/licenses/agpl-3.0.html)
Gale - https://galemc.org Gale - https://galemc.org
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 4f828048114172c399c6ce7bfa4bead007473269..e09c18580ca31644112bae38a4c52a9a51896aec 100644 index ba408197c1d949800726bd08563c25033d84072b..d98928904f74a86c72dbfc402723d50fb1b62f28 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -182,6 +182,8 @@ import net.minecraft.world.phys.Vec3; @@ -182,6 +182,8 @@ import net.minecraft.world.phys.Vec3;
@@ -19,7 +19,7 @@ index 4f828048114172c399c6ce7bfa4bead007473269..e09c18580ca31644112bae38a4c52a9a
import org.slf4j.Logger; import org.slf4j.Logger;
// CraftBukkit start // CraftBukkit start
@@ -2538,7 +2540,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2536,7 +2538,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
// CraftBukkit start // CraftBukkit start
String s = message.signedContent(); String s = message.signedContent();
if (s.isEmpty()) { if (s.isEmpty()) {
@@ -29,10 +29,10 @@ index 4f828048114172c399c6ce7bfa4bead007473269..e09c18580ca31644112bae38a4c52a9a
final String conversationInput = s; final String conversationInput = s;
this.server.processQueue.add(new Runnable() { this.server.processQueue.add(new Runnable() {
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index c67adaa664bfe2b371f14efa83ea200b0e1006f0..f292156b411b4c0f5db8fa15c92df395acb6e901 100644 index d407916de006a68318de63b81773e0dfe0d9c119..77a7a73c36ab84f5e889651795f9dd500096ca95 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
@@ -58,6 +58,11 @@ public class GaleGlobalConfiguration extends ConfigurationPart { @@ -56,6 +56,11 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
public boolean invalidStatistics = true; // Gale - EMC - do not log invalid statistics public boolean invalidStatistics = true; // Gale - EMC - do not log invalid statistics

View File

@@ -58,10 +58,10 @@ index a0c19503aabab5378d672a30163d35a5ba05b6c1..5ba0a756d45350dcda3caa5518c9a47a
// CraftBukkit end // CraftBukkit end
} else { } else {
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index f292156b411b4c0f5db8fa15c92df395acb6e901..ae00ec83b9ba545f56d606a5c9802aab97fdefcb 100644 index 77a7a73c36ab84f5e889651795f9dd500096ca95..a639a7a199adc4c7f15b6d678ca04c63ecd602cc 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
@@ -57,6 +57,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart { @@ -55,6 +55,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
public class LogToConsole extends ConfigurationPart { public class LogToConsole extends ConfigurationPart {
public boolean invalidStatistics = true; // Gale - EMC - do not log invalid statistics public boolean invalidStatistics = true; // Gale - EMC - do not log invalid statistics

View File

@@ -57,10 +57,10 @@ index 877498729c66de9aa6a27c9148f7494d7895615c..d2bbbb0e73dafd2294838137bfbd16ac
Util.logAndPauseIfInIde("Detected setBlock in a far chunk [" + i + ", " + j + "], pos: " + pos + ", status: " + this.generatingStatus + (this.currentlyGenerating == null ? "" : ", currently generating: " + (String) this.currentlyGenerating.get())); Util.logAndPauseIfInIde("Detected setBlock in a far chunk [" + i + ", " + j + "], pos: " + pos + ", status: " + this.generatingStatus + (this.currentlyGenerating == null ? "" : ", currently generating: " + (String) this.currentlyGenerating.get()));
hasSetFarWarned = true; hasSetFarWarned = true;
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index ae00ec83b9ba545f56d606a5c9802aab97fdefcb..242f39617ec5f146766c460ab65f4716f2847354 100644 index a639a7a199adc4c7f15b6d678ca04c63ecd602cc..c91ab97a879c74e2d3c1972c76a6dc42e1448113 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
@@ -58,6 +58,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart { @@ -56,6 +56,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
public boolean invalidStatistics = true; // Gale - EMC - do not log invalid statistics public boolean invalidStatistics = true; // Gale - EMC - do not log invalid statistics
public boolean ignoredAdvancements = true; // Gale - Purpur - do not log ignored advancements public boolean ignoredAdvancements = true; // Gale - Purpur - do not log ignored advancements

View File

@@ -58,10 +58,10 @@ index d13ed3069e944d138442ea440ac3eaf8d44c18d3..c89b8e5ea10a465160504f7364db4741
handler.accept((Recipe) optional.get()); handler.accept((Recipe) optional.get());
} }
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index 242f39617ec5f146766c460ab65f4716f2847354..ce5274e4093962a839f05063ffb7e2ab6244343b 100644 index c91ab97a879c74e2d3c1972c76a6dc42e1448113..efb7e3198ab4f327ec6816af143350460f8bd900 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
@@ -59,6 +59,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart { @@ -57,6 +57,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
public boolean invalidStatistics = true; // Gale - EMC - do not log invalid statistics public boolean invalidStatistics = true; // Gale - EMC - do not log invalid statistics
public boolean ignoredAdvancements = true; // Gale - Purpur - do not log ignored advancements public boolean ignoredAdvancements = true; // Gale - Purpur - do not log ignored advancements
public boolean setBlockInFarChunk = true; // Gale - Purpur - do not log setBlock in far chunks public boolean setBlockInFarChunk = true; // Gale - Purpur - do not log setBlock in far chunks

View File

@@ -37,7 +37,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
diff --git a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java diff --git a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java
index b2a15c986c7500a0ce227a54cb61ec3f5378f6f3..3ea9b877a563d2b7894cf59799d654ebaa1f9819 100644 index 6a083e269b828ef53f943cae56b029f2e0021ef1..8244810e9ac8aed6248cca71af3be31292cd99aa 100644
--- a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java --- a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java
+++ b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java +++ b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java
@@ -31,6 +31,7 @@ import org.bukkit.Material; @@ -31,6 +31,7 @@ import org.bukkit.Material;
@@ -58,10 +58,10 @@ index b2a15c986c7500a0ce227a54cb61ec3f5378f6f3..3ea9b877a563d2b7894cf59799d654eb
new Exception().printStackTrace(); new Exception().printStackTrace();
} }
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index ce5274e4093962a839f05063ffb7e2ab6244343b..0f276a6a3521e97afbb20ea5421a16180f626d45 100644 index efb7e3198ab4f327ec6816af143350460f8bd900..933c81e539e2da1901c9b7abf4f0c616d62f4cd6 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
@@ -60,6 +60,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart { @@ -58,6 +58,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
public boolean ignoredAdvancements = true; // Gale - Purpur - do not log ignored advancements public boolean ignoredAdvancements = true; // Gale - Purpur - do not log ignored advancements
public boolean setBlockInFarChunk = true; // Gale - Purpur - do not log setBlock in far chunks public boolean setBlockInFarChunk = true; // Gale - Purpur - do not log setBlock in far chunks
public boolean unrecognizedRecipes = false; // Gale - Purpur - do not log unrecognized recipes public boolean unrecognizedRecipes = false; // Gale - Purpur - do not log unrecognized recipes

View File

@@ -28,10 +28,10 @@ index c0a80824a0307ea673805015119cc834b268f0dc..d7c6e90ccf3a8ce58e5533c5158ce626
return playerChatMessage; return playerChatMessage;
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index 0f276a6a3521e97afbb20ea5421a16180f626d45..6c6f9fabb208baf5419c5dd6290b83a7d983c6d7 100644 index 933c81e539e2da1901c9b7abf4f0c616d62f4cd6..6547faacb4fcd7457a7cf22d894cf18a8d38e329 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
@@ -65,6 +65,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart { @@ -63,6 +63,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
public Chat chat; public Chat chat;
public class Chat extends ConfigurationPart { public class Chat extends ConfigurationPart {
public boolean emptyMessageWarning = false; // Gale - do not log empty message warnings public boolean emptyMessageWarning = false; // Gale - do not log empty message warnings

View File

@@ -49,10 +49,10 @@ index b348d33726b2b14ea2d12ce3430df2c0b94295f4..fe7037310e1a2b5fc2956b565982847e
boolean flag1 = false; boolean flag1 = false;
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index 6c6f9fabb208baf5419c5dd6290b83a7d983c6d7..ce8c7032dff4e119d018d42fa579f9231cf41961 100644 index 6547faacb4fcd7457a7cf22d894cf18a8d38e329..dbe60db4367270eb8041d39922b6b4eab6b709f7 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
@@ -66,6 +66,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart { @@ -64,6 +64,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
public class Chat extends ConfigurationPart { public class Chat extends ConfigurationPart {
public boolean emptyMessageWarning = false; // Gale - do not log empty message warnings public boolean emptyMessageWarning = false; // Gale - do not log empty message warnings
public boolean expiredMessageWarning = false; // Gale - do not log expired message warnings public boolean expiredMessageWarning = false; // Gale - do not log expired message warnings

View File

@@ -39,7 +39,7 @@ index d2b4654a9095a678bbc9e004af969cf54da0fcab..d797bac97ec1adec7a25a26c8e052e70
}); });
this.rotation = Rotation.valueOf(nbt.getString("rotation")); this.rotation = Rotation.valueOf(nbt.getString("rotation"));
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index ce8c7032dff4e119d018d42fa579f9231cf41961..24ed4fb7ddacba24873755edfa88912ffdf81cc8 100644 index dbe60db4367270eb8041d39922b6b4eab6b709f7..9881f69ff25f1eda31ee1f4667c4fa9a8f1d4c23 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
@@ -4,8 +4,12 @@ package org.galemc.gale.configuration; @@ -4,8 +4,12 @@ package org.galemc.gale.configuration;
@@ -55,7 +55,7 @@ index ce8c7032dff4e119d018d42fa579f9231cf41961..24ed4fb7ddacba24873755edfa88912f
@SuppressWarnings({"CanBeFinal", "FieldCanBeLocal", "FieldMayBeFinal", "NotNullFieldNotInitialized", "InnerClassMayBeStatic"}) @SuppressWarnings({"CanBeFinal", "FieldCanBeLocal", "FieldMayBeFinal", "NotNullFieldNotInitialized", "InnerClassMayBeStatic"})
public class GaleGlobalConfiguration extends ConfigurationPart { public class GaleGlobalConfiguration extends ConfigurationPart {
static final int CURRENT_VERSION = 1; static final int CURRENT_VERSION = 1;
@@ -54,7 +58,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart { @@ -52,7 +56,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
} }
public LogToConsole logToConsole; public LogToConsole logToConsole;
@@ -64,7 +64,7 @@ index ce8c7032dff4e119d018d42fa579f9231cf41961..24ed4fb7ddacba24873755edfa88912f
public boolean invalidStatistics = true; // Gale - EMC - do not log invalid statistics public boolean invalidStatistics = true; // Gale - EMC - do not log invalid statistics
public boolean ignoredAdvancements = true; // Gale - Purpur - do not log ignored advancements public boolean ignoredAdvancements = true; // Gale - Purpur - do not log ignored advancements
@@ -69,6 +73,21 @@ public class GaleGlobalConfiguration extends ConfigurationPart { @@ -67,6 +71,21 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
public boolean notSecureMarker = true; // Gale - do not log Not Secure marker public boolean notSecureMarker = true; // Gale - do not log Not Secure marker
} }

View File

@@ -131,10 +131,10 @@ index b9922b07cb105618390187d98acdf89e728e1f5a..a66d202749f243f6752df5027cb7c82f
+ +
} }
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index 24ed4fb7ddacba24873755edfa88912ffdf81cc8..0965f43068d12a85090906568e2c1b731730f015 100644 index 9881f69ff25f1eda31ee1f4667c4fa9a8f1d4c23..ef0a77ed85bf35f5d388cf28ac5d84e553ad1144 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
@@ -60,6 +60,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart { @@ -58,6 +58,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
public LogToConsole logToConsole; public LogToConsole logToConsole;
public class LogToConsole extends ConfigurationPart.Post { // Gale - EMC - softly log invalid pool element errors public class LogToConsole extends ConfigurationPart.Post { // Gale - EMC - softly log invalid pool element errors

View File

@@ -409,7 +409,7 @@ index 31faf2d6492696f7d0c99a48edbc0d6f15db1209..0c4c62674b4c7e8e3921c7eb3ef72675
OptionSpec<Integer> optionspec11 = optionparser.accepts("port").withRequiredArg().ofType(Integer.class).defaultsTo(-1, new Integer[0]); OptionSpec<Integer> optionspec11 = optionparser.accepts("port").withRequiredArg().ofType(Integer.class).defaultsTo(-1, new Integer[0]);
OptionSpec<String> optionspec12 = optionparser.accepts("serverId").withRequiredArg(); OptionSpec<String> optionspec12 = optionparser.accepts("serverId").withRequiredArg();
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 4e2cb2923d1d2a337ffda5b1990d5c9caf47b779..1307801779caa69bdf967134ecbfcb42764243ac 100644 index 56387ce4bfdfbfd25fe1349298499653b0dda1dc..81bb87b729f20be8ca4e5be0c2f5b1b6c1ce4422 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
@@ -49,6 +49,8 @@ import java.util.stream.Collectors; @@ -49,6 +49,8 @@ import java.util.stream.Collectors;
@@ -421,7 +421,7 @@ index 4e2cb2923d1d2a337ffda5b1990d5c9caf47b779..1307801779caa69bdf967134ecbfcb42
import net.minecraft.CrashReport; import net.minecraft.CrashReport;
import net.minecraft.ReportedException; import net.minecraft.ReportedException;
import net.minecraft.SharedConstants; import net.minecraft.SharedConstants;
@@ -1357,8 +1359,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1327,8 +1329,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
try { try {
BufferedImage bufferedimage = ImageIO.read(file); BufferedImage bufferedimage = ImageIO.read(file);
@@ -448,7 +448,7 @@ index 590b756842f5f9d1c2f0aed6517f9b46e3dc74db..ce7f36f38165a58e3fab7a98bece75df
for (int j = 0; j < i; ++j) { for (int j = 0; j < i; ++j) {
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 8924630ca5049f14e5e69323a2d4f7218e06a2aa..a980908087b47869cd9326dbc62974567ed3170a 100644 index 5f3e3383f20b850720835fab948bb610978e4fe9..7b9b2ac6f7b7413849c4a9144abdb8dcc80a22e3 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
@@ -38,6 +38,8 @@ import java.util.stream.Collectors; @@ -38,6 +38,8 @@ import java.util.stream.Collectors;
@@ -460,7 +460,7 @@ index 8924630ca5049f14e5e69323a2d4f7218e06a2aa..a980908087b47869cd9326dbc6297456
import net.minecraft.CrashReport; import net.minecraft.CrashReport;
import net.minecraft.Util; import net.minecraft.Util;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
@@ -927,7 +929,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -901,7 +903,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
BlockPos blockposition2 = blockposition.set(j + randomX, randomY, k + randomZ); BlockPos blockposition2 = blockposition.set(j + randomX, randomY, k + randomZ);
BlockState iblockdata = com.destroystokyo.paper.util.maplist.IBlockDataList.getBlockDataFromRaw(raw); BlockState iblockdata = com.destroystokyo.paper.util.maplist.IBlockDataList.getBlockDataFromRaw(raw);
@@ -469,7 +469,7 @@ index 8924630ca5049f14e5e69323a2d4f7218e06a2aa..a980908087b47869cd9326dbc6297456
// We drop the fluid tick since LAVA is ALREADY TICKED by the above method (See LiquidBlock). // We drop the fluid tick since LAVA is ALREADY TICKED by the above method (See LiquidBlock).
// TODO CHECK ON UPDATE (ping the Canadian) // TODO CHECK ON UPDATE (ping the Canadian)
} }
@@ -1182,7 +1184,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1155,7 +1157,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
public static List<Entity> getCurrentlyTickingEntities() { public static List<Entity> getCurrentlyTickingEntities() {
Entity ticking = currentlyTickingEntity.get(); Entity ticking = currentlyTickingEntity.get();
@@ -479,7 +479,7 @@ index 8924630ca5049f14e5e69323a2d4f7218e06a2aa..a980908087b47869cd9326dbc6297456
return ret; return ret;
} }
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index e09c18580ca31644112bae38a4c52a9a51896aec..8f23c46faf83c945516632824ba4e07c4597ad67 100644 index d98928904f74a86c72dbfc402723d50fb1b62f28..51a336fa29e92669ce48b7724de0134480ac6adb 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -28,6 +28,8 @@ import java.util.function.UnaryOperator; @@ -28,6 +28,8 @@ import java.util.function.UnaryOperator;
@@ -516,7 +516,7 @@ index e09c18580ca31644112bae38a4c52a9a51896aec..8f23c46faf83c945516632824ba4e07c
import org.bukkit.event.player.PlayerChatEvent; import org.bukkit.event.player.PlayerChatEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent; import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerInteractAtEntityEvent; import org.bukkit.event.player.PlayerInteractAtEntityEvent;
@@ -405,7 +403,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -404,7 +402,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
if (this.keepAlivePending) { if (this.keepAlivePending) {
if (!this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // check keepalive limit, don't fire if already disconnected if (!this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // check keepalive limit, don't fire if already disconnected
ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked due to keepalive timeout!", this.player.getScoreboardName()); // more info ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked due to keepalive timeout!", this.player.getScoreboardName()); // more info
@@ -525,7 +525,7 @@ index e09c18580ca31644112bae38a4c52a9a51896aec..8f23c46faf83c945516632824ba4e07c
} }
} else { } else {
if (elapsedTime >= 15000L) { // 15 seconds if (elapsedTime >= 15000L) { // 15 seconds
@@ -870,13 +868,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -868,13 +866,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
// PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); // Paper - run this async // PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); // Paper - run this async
// CraftBukkit start // CraftBukkit start
if (this.chatSpamTickCount.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamLimit && !this.server.getPlayerList().isOp(this.player.getGameProfile())) { // Paper start - split and make configurable if (this.chatSpamTickCount.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamLimit && !this.server.getPlayerList().isOp(this.player.getGameProfile())) { // Paper start - split and make configurable
@@ -541,7 +541,7 @@ index e09c18580ca31644112bae38a4c52a9a51896aec..8f23c46faf83c945516632824ba4e07c
return; return;
} }
// Paper end // Paper end
@@ -3257,7 +3255,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -3255,7 +3253,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
// Paper start // Paper start
if (!org.bukkit.Bukkit.isPrimaryThread()) { if (!org.bukkit.Bukkit.isPrimaryThread()) {
if (recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) { if (recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) {
@@ -697,10 +697,10 @@ index 97ff19efa0b3943ccb7a6e02cba6ed2fea61adac..b2ae2bd8bd4ff3cb6457e8c08172e348
private EquipmentSlot(EquipmentSlot.Type type, int entityId, int armorStandId, String name) { private EquipmentSlot(EquipmentSlot.Type type, int entityId, int armorStandId, String name) {
this.type = type; this.type = type;
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index b109c55a31a9e5a0813e360d8a3c1b13d1bfd416..46ad26f8f6680446718bb13158eca3f712f1986e 100644 index 197c99b23584ef1aed1be821d9673bacabb561e5..6ad1e6c4a20bec34b56276736ee616b5dcff0354 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3109,7 +3109,7 @@ public abstract class LivingEntity extends Entity { @@ -3103,7 +3103,7 @@ public abstract class LivingEntity extends Entity {
@Nullable @Nullable
private Map<EquipmentSlot, ItemStack> collectEquipmentChanges() { private Map<EquipmentSlot, ItemStack> collectEquipmentChanges() {
Map<EquipmentSlot, ItemStack> map = null; Map<EquipmentSlot, ItemStack> map = null;
@@ -710,10 +710,10 @@ index b109c55a31a9e5a0813e360d8a3c1b13d1bfd416..46ad26f8f6680446718bb13158eca3f7
for (int j = 0; j < i; ++j) { for (int j = 0; j < i; ++j) {
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index 49b983064ea810382b6112f5dc7f93ba4e5710bd..aa58adbd6dde51e6902ca9af1ae1a63e8a11bb34 100644 index c61b13268166f1f9f4a6f39391c3458410e62edc..2e98c0ad3776ec4bf71e686e856a8c445ee95b9b 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java --- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -1039,7 +1039,7 @@ public abstract class Mob extends LivingEntity { @@ -1015,7 +1015,7 @@ public abstract class Mob extends LivingEntity {
@Override @Override
protected void dropCustomDeathLoot(DamageSource source, int lootingMultiplier, boolean allowDrops) { protected void dropCustomDeathLoot(DamageSource source, int lootingMultiplier, boolean allowDrops) {
super.dropCustomDeathLoot(source, lootingMultiplier, allowDrops); super.dropCustomDeathLoot(source, lootingMultiplier, allowDrops);
@@ -722,7 +722,7 @@ index 49b983064ea810382b6112f5dc7f93ba4e5710bd..aa58adbd6dde51e6902ca9af1ae1a63e
int j = aenumitemslot.length; int j = aenumitemslot.length;
for (int k = 0; k < j; ++k) { for (int k = 0; k < j; ++k) {
@@ -1101,7 +1101,7 @@ public abstract class Mob extends LivingEntity { @@ -1077,7 +1077,7 @@ public abstract class Mob extends LivingEntity {
} }
boolean flag = true; boolean flag = true;
@@ -731,7 +731,7 @@ index 49b983064ea810382b6112f5dc7f93ba4e5710bd..aa58adbd6dde51e6902ca9af1ae1a63e
int j = aenumitemslot.length; int j = aenumitemslot.length;
for (int k = 0; k < j; ++k) { for (int k = 0; k < j; ++k) {
@@ -1188,7 +1188,7 @@ public abstract class Mob extends LivingEntity { @@ -1164,7 +1164,7 @@ public abstract class Mob extends LivingEntity {
float f = localDifficulty.getSpecialMultiplier(); float f = localDifficulty.getSpecialMultiplier();
this.enchantSpawnedWeapon(random, f); this.enchantSpawnedWeapon(random, f);
@@ -740,7 +740,7 @@ index 49b983064ea810382b6112f5dc7f93ba4e5710bd..aa58adbd6dde51e6902ca9af1ae1a63e
int i = aenumitemslot.length; int i = aenumitemslot.length;
for (int j = 0; j < i; ++j) { for (int j = 0; j < i; ++j) {
@@ -1405,7 +1405,7 @@ public abstract class Mob extends LivingEntity { @@ -1381,7 +1381,7 @@ public abstract class Mob extends LivingEntity {
t0.setInvulnerable(this.isInvulnerable()); t0.setInvulnerable(this.isInvulnerable());
if (flag) { if (flag) {
t0.setCanPickUpLoot(this.canPickUpLoot()); t0.setCanPickUpLoot(this.canPickUpLoot());
@@ -815,7 +815,7 @@ index 2bfbdaeb2b0d99dfd956cd5936403fe8b0eeae64..84f1c4c3ded4f201899f3c74e639349b
public Enchantments() {} public Enchantments() {}
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 14c2e816e6bc5801846c296318afe223abf95c5d..6fb3e25c7972c681284dd611eedb214c9335697e 100644 index 95d8883fabc6a7ea6f9e6dfcff9e2f2fce917dfe..0ab14271e6efebe49ed9fec904e47566691b9f40 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
@@ -12,6 +12,8 @@ import java.util.function.Consumer; @@ -12,6 +12,8 @@ import java.util.function.Consumer;
@@ -827,7 +827,7 @@ index 14c2e816e6bc5801846c296318afe223abf95c5d..6fb3e25c7972c681284dd611eedb214c
import net.minecraft.CrashReport; import net.minecraft.CrashReport;
import net.minecraft.CrashReportCategory; import net.minecraft.CrashReportCategory;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
@@ -1593,7 +1595,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -1568,7 +1570,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public org.bukkit.entity.Entity[] getChunkEntities(int chunkX, int chunkZ) { public org.bukkit.entity.Entity[] getChunkEntities(int chunkX, int chunkZ) {
io.papermc.paper.world.ChunkEntitySlices slices = ((ServerLevel)this).getEntityLookup().getChunk(chunkX, chunkZ); io.papermc.paper.world.ChunkEntitySlices slices = ((ServerLevel)this).getEntityLookup().getChunk(chunkX, chunkZ);
if (slices == null) { if (slices == null) {

View File

@@ -13,7 +13,7 @@ As part of: JettPack (https://gitlab.com/Titaniumtown/JettPack)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index b1bb14fc038df5631acf4c905876636230897077..23e4851fc7806820581b79931f10491fe9ceeec3 100644 index 4b64c6009d93b034b16b67d743050d2a634db6ff..660e8d27bb8733f01d7e60b841877ee14579ede4 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -290,7 +290,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -290,7 +290,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -25,7 +25,7 @@ index b1bb14fc038df5631acf4c905876636230897077..23e4851fc7806820581b79931f10491f
public BlockPos blockPosition; // Gale - Pufferfish - optimize entity coordinate key - private -> public public BlockPos blockPosition; // Gale - Pufferfish - optimize entity coordinate key - private -> public
private ChunkPos chunkPosition; private ChunkPos chunkPosition;
private Vec3 deltaMovement; private Vec3 deltaMovement;
@@ -1876,9 +1876,17 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -1866,9 +1866,17 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
/** @deprecated */ /** @deprecated */
@Deprecated @Deprecated
public float getLightLevelDependentMagicValue() { public float getLightLevelDependentMagicValue() {
@@ -45,10 +45,10 @@ index b1bb14fc038df5631acf4c905876636230897077..23e4851fc7806820581b79931f10491f
this.absMoveTo(x, y, z); this.absMoveTo(x, y, z);
this.setYRot(yaw % 360.0F); this.setYRot(yaw % 360.0F);
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index aa58adbd6dde51e6902ca9af1ae1a63e8a11bb34..e601b50935fc7212050e01fd31235149a33daf3b 100644 index 2e98c0ad3776ec4bf71e686e856a8c445ee95b9b..27fc50571305132c86497fcb1d5b1bb514610a4e 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java --- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -1667,13 +1667,29 @@ public abstract class Mob extends LivingEntity { @@ -1643,13 +1643,29 @@ public abstract class Mob extends LivingEntity {
} }

View File

@@ -13,7 +13,7 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html) Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
index b738ee2d3801fadfd09313f05ae24593e56b0ec6..b4bbd34d983e559dc2716520561cac61108c6d5c 100644 index ce2804271bb67803c60c9121aec6c8dc0e99a1d9..86fc528551c2c90c78783d4d46a4a2c52e4efe41 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java --- a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java +++ b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
@@ -11,6 +11,8 @@ import java.util.Set; @@ -11,6 +11,8 @@ import java.util.Set;
@@ -22,15 +22,15 @@ index b738ee2d3801fadfd09313f05ae24593e56b0ec6..b4bbd34d983e559dc2716520561cac61
import java.util.stream.Stream; import java.util.stream.Stream;
+ +
+import it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet; +import it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet;
import net.minecraft.util.profiling.ProfilerFiller;
import org.slf4j.Logger; import org.slf4j.Logger;
@@ -28,7 +30,7 @@ public class GoalSelector { public class GoalSelector {
@@ -27,7 +29,7 @@ public class GoalSelector {
} }
}; };
private final Map<Goal.Flag, WrappedGoal> lockedFlags = new EnumMap<>(Goal.Flag.class); private final Map<Goal.Flag, WrappedGoal> lockedFlags = new EnumMap<>(Goal.Flag.class);
- private final Set<WrappedGoal> availableGoals = Sets.newLinkedHashSet(); - private final Set<WrappedGoal> availableGoals = Sets.newLinkedHashSet();
+ private final Set<WrappedGoal> availableGoals = new ObjectLinkedOpenHashSet<>(); // Gale - Lithium - replace AI goal set with optimized collection + private final Set<WrappedGoal> availableGoals = new ObjectLinkedOpenHashSet<>(); // Gale - Lithium - replace AI goal set with optimized collection
private final Supplier<ProfilerFiller> profiler;
private final EnumSet<Goal.Flag> disabledFlags = EnumSet.noneOf(Goal.Flag.class); // Paper unused, but dummy to prevent plugins from crashing as hard. Theyll need to support paper in a special case if this is super important, but really doesn't seem like it would be. private final EnumSet<Goal.Flag> disabledFlags = EnumSet.noneOf(Goal.Flag.class); // Paper unused, but dummy to prevent plugins from crashing as hard. Theyll need to support paper in a special case if this is super important, but really doesn't seem like it would be.
private final com.destroystokyo.paper.util.set.OptimizedSmallEnumSet<net.minecraft.world.entity.ai.goal.Goal.Flag> goalTypes = new com.destroystokyo.paper.util.set.OptimizedSmallEnumSet<>(Goal.Flag.class); // Paper - remove streams from pathfindergoalselector private final com.destroystokyo.paper.util.set.OptimizedSmallEnumSet<net.minecraft.world.entity.ai.goal.Goal.Flag> goalTypes = new com.destroystokyo.paper.util.set.OptimizedSmallEnumSet<>(Goal.Flag.class); // Paper - remove streams from pathfindergoalselector
private int tickCount;

View File

@@ -13,10 +13,10 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html) Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 46ad26f8f6680446718bb13158eca3f712f1986e..f2814df6d715910a3c8101a0af5f3190355bcc52 100644 index 6ad1e6c4a20bec34b56276736ee616b5dcff0354..75ae119719cf566f66371606e70f19b6b36dc7cb 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -574,11 +574,10 @@ public abstract class LivingEntity extends Entity { @@ -572,11 +572,10 @@ public abstract class LivingEntity extends Entity {
} }
protected void tryAddFrost() { protected void tryAddFrost() {
@@ -29,7 +29,7 @@ index 46ad26f8f6680446718bb13158eca3f712f1986e..f2814df6d715910a3c8101a0af5f3190
if (attributemodifiable == null) { if (attributemodifiable == null) {
return; return;
@@ -588,7 +587,6 @@ public abstract class LivingEntity extends Entity { @@ -586,7 +585,6 @@ public abstract class LivingEntity extends Entity {
attributemodifiable.addTransientModifier(new AttributeModifier(LivingEntity.SPEED_MODIFIER_POWDER_SNOW_UUID, "Powder snow slow", (double) f, AttributeModifier.Operation.ADDITION)); attributemodifiable.addTransientModifier(new AttributeModifier(LivingEntity.SPEED_MODIFIER_POWDER_SNOW_UUID, "Powder snow slow", (double) f, AttributeModifier.Operation.ADDITION));
} }

View File

@@ -13,7 +13,7 @@ As part of: VMP (https://github.com/RelativityMC/VMP-fabric)
Licensed under: MIT (https://opensource.org/licenses/MIT) Licensed under: MIT (https://opensource.org/licenses/MIT)
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 23e4851fc7806820581b79931f10491fe9ceeec3..1a49b1f0c30c522190997653b04c61a2c439b793 100644 index 660e8d27bb8733f01d7e60b841877ee14579ede4..7841fd24b2f4e4310a6d34660e7c7cd265af835e 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -299,6 +299,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -299,6 +299,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -24,7 +24,7 @@ index 23e4851fc7806820581b79931f10491fe9ceeec3..1a49b1f0c30c522190997653b04c61a2
public boolean onGround; public boolean onGround;
public boolean horizontalCollision; public boolean horizontalCollision;
public boolean verticalCollision; public boolean verticalCollision;
@@ -1023,6 +1024,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -1021,6 +1022,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
// Paper end - detailed watchdog information // Paper end - detailed watchdog information
public void move(MoverType movementType, Vec3 movement) { public void move(MoverType movementType, Vec3 movement) {
@@ -36,7 +36,7 @@ index 23e4851fc7806820581b79931f10491fe9ceeec3..1a49b1f0c30c522190997653b04c61a2
// Paper start - detailed watchdog information // Paper start - detailed watchdog information
io.papermc.paper.util.TickThread.ensureTickThread("Cannot move an entity off-main"); io.papermc.paper.util.TickThread.ensureTickThread("Cannot move an entity off-main");
synchronized (this.posLock) { synchronized (this.posLock) {
@@ -3798,6 +3804,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -3781,6 +3787,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
} }
public final void setBoundingBox(AABB boundingBox) { public final void setBoundingBox(AABB boundingBox) {

View File

@@ -13,7 +13,7 @@ As part of: VMP (https://github.com/RelativityMC/VMP-fabric)
Licensed under: MIT (https://opensource.org/licenses/MIT) Licensed under: MIT (https://opensource.org/licenses/MIT)
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 eea6753afdd7e9d52746d0decb5cde63044012b5..20e4178b1ce6fc25d2fb25d0c02a06e33ac03d19 100644 index 41140fbf32fc4db1b2460e453420e538290f4f99..baa6aaa495c2a9d4d2f6a62527881b9442fcaeea 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
@@ -14,6 +14,7 @@ import com.mojang.datafixers.util.Either; @@ -14,6 +14,7 @@ import com.mojang.datafixers.util.Either;
@@ -24,7 +24,7 @@ index eea6753afdd7e9d52746d0decb5cde63044012b5..20e4178b1ce6fc25d2fb25d0c02a06e3
import it.unimi.dsi.fastutil.ints.Int2ObjectMap; import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
import it.unimi.dsi.fastutil.longs.Long2ByteMap; import it.unimi.dsi.fastutil.longs.Long2ByteMap;
@@ -295,7 +296,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -294,7 +295,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
// Paper - rewrite chunk system // Paper - rewrite chunk system
this.tickingGenerated = new AtomicInteger(); this.tickingGenerated = new AtomicInteger();
this.playerMap = new PlayerMap(); this.playerMap = new PlayerMap();

View File

@@ -13,10 +13,10 @@ As part of: Slice (https://github.com/Cryptite/Slice)
Licensed under: MIT (https://opensource.org/licenses/MIT) Licensed under: MIT (https://opensource.org/licenses/MIT)
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index f2814df6d715910a3c8101a0af5f3190355bcc52..91e5707efe39180811fbe78c7569baa5264dba2c 100644 index 75ae119719cf566f66371606e70f19b6b36dc7cb..88bfda2090a1f8c9368f5d6f98374d045c045150 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3154,7 +3154,7 @@ public abstract class LivingEntity extends Entity { @@ -3148,7 +3148,7 @@ public abstract class LivingEntity extends Entity {
} }
public boolean equipmentHasChanged(ItemStack stack, ItemStack stack2) { public boolean equipmentHasChanged(ItemStack stack, ItemStack stack2) {

View File

@@ -13,10 +13,10 @@ As part of: Slice (https://github.com/Cryptite/Slice)
Licensed under: MIT (https://opensource.org/licenses/MIT) Licensed under: MIT (https://opensource.org/licenses/MIT)
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index d6526c075bc82ae2d79e3e786bc469966f4cf92d..552198bd1a08d0967dba90104777105fafc67e35 100644 index 7841fd24b2f4e4310a6d34660e7c7cd265af835e..a5e2b9862358362f0c67683b0266ab846cab1fcf 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -869,7 +869,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -868,7 +868,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
this.checkOutOfWorld(); this.checkOutOfWorld();
if (!this.level.isClientSide) { if (!this.level.isClientSide) {

View File

@@ -37,10 +37,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
index 330f6c79417378da855326b4da665f9d240e748d..b111f4c0972f01832f9c03bf85a1989f1e782558 100644 index 6f7b5884a82cd3a3483fbbd478c0e92987f0d833..c7083450b3466d80611b5efdac78b31ac2e70cf5 100644
--- a/src/main/java/net/minecraft/commands/Commands.java --- a/src/main/java/net/minecraft/commands/Commands.java
+++ b/src/main/java/net/minecraft/commands/Commands.java +++ b/src/main/java/net/minecraft/commands/Commands.java
@@ -425,6 +425,7 @@ public class Commands { @@ -418,6 +418,7 @@ public class Commands {
private void runSync(ServerPlayer player, Collection<String> bukkit, RootCommandNode<SharedSuggestionProvider> rootcommandnode) { private void runSync(ServerPlayer player, Collection<String> bukkit, RootCommandNode<SharedSuggestionProvider> rootcommandnode) {
// Paper end - Async command map building // Paper end - Async command map building
new com.destroystokyo.paper.event.brigadier.AsyncPlayerSendCommandsEvent<CommandSourceStack>(player.getBukkitEntity(), (RootCommandNode) rootcommandnode, false).callEvent(); // Paper new com.destroystokyo.paper.event.brigadier.AsyncPlayerSendCommandsEvent<CommandSourceStack>(player.getBukkitEntity(), (RootCommandNode) rootcommandnode, false).callEvent(); // Paper
@@ -48,7 +48,7 @@ index 330f6c79417378da855326b4da665f9d240e748d..b111f4c0972f01832f9c03bf85a1989f
PlayerCommandSendEvent event = new PlayerCommandSendEvent(player.getBukkitEntity(), new LinkedHashSet<>(bukkit)); PlayerCommandSendEvent event = new PlayerCommandSendEvent(player.getBukkitEntity(), new LinkedHashSet<>(bukkit));
event.getPlayer().getServer().getPluginManager().callEvent(event); event.getPlayer().getServer().getPluginManager().callEvent(event);
@@ -435,6 +436,7 @@ public class Commands { @@ -428,6 +429,7 @@ public class Commands {
} }
} }
// CraftBukkit end // CraftBukkit end

View File

@@ -37,7 +37,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 8f23c46faf83c945516632824ba4e07c4597ad67..406c71f84201bff5e46d49aaec10ae7efc419ebc 100644 index 51a336fa29e92669ce48b7724de0134480ac6adb..f0648c94029796653c8c8a5bdd191cf99de7b58a 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -7,6 +7,8 @@ import com.mojang.brigadier.StringReader; @@ -7,6 +7,8 @@ import com.mojang.brigadier.StringReader;
@@ -69,7 +69,7 @@ index 8f23c46faf83c945516632824ba4e07c4597ad67..406c71f84201bff5e46d49aaec10ae7e
private static final int MAX_SIGN_LINE_LENGTH = Integer.getInteger("Paper.maxSignLength", 80); // Paper private static final int MAX_SIGN_LINE_LENGTH = Integer.getInteger("Paper.maxSignLength", 80); // Paper
private String clientBrandName = null; // Paper - Brand name private String clientBrandName = null; // Paper - Brand name
@@ -400,6 +406,21 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -399,6 +405,21 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
long currentTime = Util.getMillis(); long currentTime = Util.getMillis();
long elapsedTime = currentTime - this.keepAliveTime; long elapsedTime = currentTime - this.keepAliveTime;
@@ -91,7 +91,7 @@ index 8f23c46faf83c945516632824ba4e07c4597ad67..406c71f84201bff5e46d49aaec10ae7e
if (this.keepAlivePending) { if (this.keepAlivePending) {
if (!this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // check keepalive limit, don't fire if already disconnected if (!this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // check keepalive limit, don't fire if already disconnected
ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked due to keepalive timeout!", this.player.getScoreboardName()); // more info ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked due to keepalive timeout!", this.player.getScoreboardName()); // more info
@@ -3459,6 +3480,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -3457,6 +3478,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@Override @Override
public void handleKeepAlive(ServerboundKeepAlivePacket packet) { public void handleKeepAlive(ServerboundKeepAlivePacket packet) {
@@ -109,10 +109,10 @@ index 8f23c46faf83c945516632824ba4e07c4597ad67..406c71f84201bff5e46d49aaec10ae7e
if (this.keepAlivePending && packet.getId() == this.keepAliveChallenge) { if (this.keepAlivePending && packet.getId() == this.keepAliveChallenge) {
int i = (int) (Util.getMillis() - this.keepAliveTime); int i = (int) (Util.getMillis() - this.keepAliveTime);
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index 0965f43068d12a85090906568e2c1b731730f015..024cf924592999726458976b4d73df4b71843a2e 100644 index ef0a77ed85bf35f5d388cf28ac5d84e553ad1144..cf56844eb2292ff6add463689ee10b873d2ca664 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
@@ -91,4 +91,16 @@ public class GaleGlobalConfiguration extends ConfigurationPart { @@ -89,4 +89,16 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
} }

View File

@@ -59,10 +59,10 @@ index fa56cd09102a89692b42f1d14257990508c5c720..fac07dda413002c12276131efbe4ee38
setListData(vector); setListData(vector);
} }
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 1307801779caa69bdf967134ecbfcb42764243ac..481522ecd677c12e09121aa1eb54531e6d1fda3d 100644 index 81bb87b729f20be8ca4e5be0c2f5b1b6c1ce4422..1d45eefe9c791b742946cb162b0a7358226c2ea5 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
@@ -1053,6 +1053,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1034,6 +1034,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
private static final long MAX_CATCHUP_BUFFER = TICK_TIME * TPS * 60L; private static final long MAX_CATCHUP_BUFFER = TICK_TIME * TPS * 60L;
private long lastTick = 0; private long lastTick = 0;
private long catchupTime = 0; private long catchupTime = 0;
@@ -70,7 +70,7 @@ index 1307801779caa69bdf967134ecbfcb42764243ac..481522ecd677c12e09121aa1eb54531e
public final RollingAverage tps1 = new RollingAverage(60); public final RollingAverage tps1 = new RollingAverage(60);
public final RollingAverage tps5 = new RollingAverage(60 * 5); public final RollingAverage tps5 = new RollingAverage(60 * 5);
public final RollingAverage tps15 = new RollingAverage(60 * 15); public final RollingAverage tps15 = new RollingAverage(60 * 15);
@@ -1155,6 +1156,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1136,6 +1137,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
{ {
final long diff = curTime - tickSection; final long diff = curTime - tickSection;
java.math.BigDecimal currentTps = TPS_BASE.divide(new java.math.BigDecimal(diff), 30, java.math.RoundingMode.HALF_UP); java.math.BigDecimal currentTps = TPS_BASE.divide(new java.math.BigDecimal(diff), 30, java.math.RoundingMode.HALF_UP);

View File

@@ -23,10 +23,10 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/src/main/java/net/minecraft/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 481522ecd677c12e09121aa1eb54531e6d1fda3d..609d57dd7373531d35295152e543261e3b0fbe09 100644 index 1d45eefe9c791b742946cb162b0a7358226c2ea5..942cffa7e10b9d8022daeb2eff623a49c031d131 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
@@ -1103,6 +1103,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1084,6 +1084,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public static volatile RuntimeException chunkSystemCrash; // Paper - rewrite chunk system public static volatile RuntimeException chunkSystemCrash; // Paper - rewrite chunk system
@@ -38,17 +38,17 @@ index 481522ecd677c12e09121aa1eb54531e6d1fda3d..609d57dd7373531d35295152e543261e
protected void runServer() { protected void runServer() {
try { try {
long serverStartTime = Util.getNanos(); // Paper long serverStartTime = Util.getNanos(); // Paper
@@ -1179,7 +1184,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1153,7 +1158,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
//MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit // Paper - don't overwrite current tick time
lastTick = curTime;
this.nextTickTime += 50L; this.nextTickTime += 50L;
this.startMetricsRecordingTick();
this.profiler.push("tick");
+ long tickProperStart = System.nanoTime(); // Gale - YAPFA - last tick time + long tickProperStart = System.nanoTime(); // Gale - YAPFA - last tick time
this.tickServer(this::haveTime); this.tickServer(this::haveTime);
+ lastTickProperTime = (System.nanoTime() - tickProperStart) / 1000000L; // Gale - YAPFA - last tick time + lastTickProperTime = (System.nanoTime() - tickProperStart) / 1000000L; // Gale - YAPFA - last tick time
this.profiler.popPush("nextTickWait");
this.mayHaveDelayedTasks = true; this.mayHaveDelayedTasks = true;
this.delayedTasksMaxNextTickTime = Math.max(Util.getMillis() + 50L, this.nextTickTime); this.delayedTasksMaxNextTickTime = Math.max(Util.getMillis() + 50L, this.nextTickTime);
@@ -1295,9 +1302,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.waitUntilNextTick();
@@ -1266,9 +1273,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
protected void waitUntilNextTick() { protected void waitUntilNextTick() {
//this.executeAll(); // Paper - move this into the tick method for timings //this.executeAll(); // Paper - move this into the tick method for timings

View File

@@ -23,10 +23,10 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index 024cf924592999726458976b4d73df4b71843a2e..eb1a5b20810cbad9f47505a8534a42b20b8653d5 100644 index cf56844eb2292ff6add463689ee10b873d2ca664..8fc0095ec5bbb8245a528731741bad87da3bd937 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
@@ -101,6 +101,14 @@ public class GaleGlobalConfiguration extends ConfigurationPart { @@ -99,6 +99,14 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
} }

View File

@@ -87,7 +87,7 @@ index 6f071601266dff833270bbde9863cc0c4dcfa97d..529df114eb0ca3020bf8c699889b9a54
int i = 29999999; int i = 29999999;
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index eb1a5b20810cbad9f47505a8534a42b20b8653d5..8aaa6e3a6c475258bea5f026a7e07efde825f112 100644 index 8fc0095ec5bbb8245a528731741bad87da3bd937..3d0c6e754264fc864485eb01deec63f1b80c7044 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
@@ -43,6 +43,25 @@ public class GaleGlobalConfiguration extends ConfigurationPart { @@ -43,6 +43,25 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
@@ -115,4 +115,4 @@ index eb1a5b20810cbad9f47505a8534a42b20b8653d5..8aaa6e3a6c475258bea5f026a7e07efd
+ +
} }
public boolean disableVanillaProfiler = true; // Gale - Airplane - config to disable vanilla profiler // Gale start - Pufferfish - SIMD support

View File

@@ -16,10 +16,10 @@ As part of: Akarin (https://github.com/Akarin-project/Akarin)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index e4e78d4d7d9e2f2b6ad2e9f605c2ffc3bbe23dca..7c06b37201eaf0fd5c1af912c095c4e218d7a3bb 100644 index a5e2b9862358362f0c67683b0266ab846cab1fcf..83f48e8e9c48b67ac7aa0c790cdf1c43391cabe7 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1993,8 +1993,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -1983,8 +1983,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
public void playerTouch(Player player) {} public void playerTouch(Player player) {}
public void push(Entity entity) { public void push(Entity entity) {

View File

@@ -7,10 +7,10 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org Gale - https://galemc.org
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index f6b9c9c55effdc169d8226308b3163bc5c54b3ed..dbba8559117287932e7e400f03cd80ac7418c004 100644 index 83f48e8e9c48b67ac7aa0c790cdf1c43391cabe7..5adb379fdb4bae14b143b5fd9adfe983b3e75419 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1195,9 +1195,18 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -1187,9 +1187,18 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
} }
this.tryCheckInsideBlocks(); this.tryCheckInsideBlocks();

View File

@@ -7,10 +7,10 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org Gale - https://galemc.org
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 609d57dd7373531d35295152e543261e3b0fbe09..d3210128894a8e70919972e60c62bf34338e5fa2 100644 index 942cffa7e10b9d8022daeb2eff623a49c031d131..cfdc9ebe5e2271dea15e1dd8aa44bb2aea542943 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
@@ -195,6 +195,8 @@ import co.aikar.timings.MinecraftTimings; // Paper @@ -194,6 +194,8 @@ import co.aikar.timings.MinecraftTimings; // Paper
public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements CommandSource, AutoCloseable { public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements CommandSource, AutoCloseable {
@@ -19,7 +19,7 @@ index 609d57dd7373531d35295152e543261e3b0fbe09..d3210128894a8e70919972e60c62bf34
private static MinecraftServer SERVER; // Paper private static MinecraftServer SERVER; // Paper
public static final Logger LOGGER = LogUtils.getLogger(); public static final Logger LOGGER = LogUtils.getLogger();
public static final String VANILLA_BRAND = "vanilla"; public static final String VANILLA_BRAND = "vanilla";
@@ -326,7 +328,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -317,7 +319,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
S s0 = serverFactory.apply(thread); // CraftBukkit - decompile error S s0 = serverFactory.apply(thread); // CraftBukkit - decompile error
atomicreference.set(s0); atomicreference.set(s0);

View File

@@ -45,10 +45,10 @@ index 41013054b6046a17a94d3e181b3ffbc7a3824cd2..c2ad33e5fbce8a16498dde2bfd555012
import org.yaml.snakeyaml.constructor.SafeConstructor; import org.yaml.snakeyaml.constructor.SafeConstructor;
import org.yaml.snakeyaml.error.MarkedYAMLException; import org.yaml.snakeyaml.error.MarkedYAMLException;
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index 8aaa6e3a6c475258bea5f026a7e07efde825f112..6f6b96fe499f1b1888a141b60bd3773ba45e75f6 100644 index 3d0c6e754264fc864485eb01deec63f1b80c7044..30416b4622214ebc71956541af76ed1567e36f73 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
@@ -85,6 +85,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart { @@ -83,6 +83,7 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
public boolean setBlockInFarChunk = true; // Gale - Purpur - do not log setBlock in far chunks public boolean setBlockInFarChunk = true; // Gale - Purpur - do not log setBlock in far chunks
public boolean unrecognizedRecipes = false; // Gale - Purpur - do not log unrecognized recipes public boolean unrecognizedRecipes = false; // Gale - Purpur - do not log unrecognized recipes
public boolean legacyMaterialInitialization = false; // Gale - Purpur - do not log legacy Material initialization public boolean legacyMaterialInitialization = false; // Gale - Purpur - do not log legacy Material initialization

View File

@@ -485,7 +485,7 @@ index 0c4c62674b4c7e8e3921c7eb3ef726759ac75075..31b488a3c1b81b99bf5bda9f90c3cf69
WorldLoader.InitConfig worldloader_c = Main.loadOrCreateConfig(dedicatedserversettings.getProperties(), convertable_conversionsession, flag, resourcepackrepository); WorldLoader.InitConfig worldloader_c = Main.loadOrCreateConfig(dedicatedserversettings.getProperties(), convertable_conversionsession, flag, resourcepackrepository);
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 d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471cd9cdfc60 100644 index cfdc9ebe5e2271dea15e1dd8aa44bb2aea542943..2175b1ecb8b1e4bc0459b8a8d7689a0ca46b4a68 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
@@ -40,7 +40,6 @@ import java.util.Optional; @@ -40,7 +40,6 @@ import java.util.Optional;
@@ -504,13 +504,12 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
import net.minecraft.world.Difficulty; import net.minecraft.world.Difficulty;
import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.ai.village.VillageSiege; import net.minecraft.world.entity.ai.village.VillageSiege;
@@ -161,8 +159,16 @@ import net.minecraft.world.level.storage.loot.PredicateManager; @@ -161,7 +159,15 @@ import net.minecraft.world.level.storage.loot.PredicateManager;
import net.minecraft.world.phys.Vec2; import net.minecraft.world.phys.Vec2;
import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.Vec3;
import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.Validate;
+import org.galemc.gale.executor.MinecraftServerBlockableEventLoop; +import org.galemc.gale.executor.MinecraftServerBlockableEventLoop;
import org.galemc.gale.configuration.GaleConfigurations; import org.galemc.gale.configuration.GaleConfigurations;
import org.galemc.gale.configuration.GaleGlobalConfiguration;
+import org.galemc.gale.executor.annotation.thread.OriginalServerThreadOnly; +import org.galemc.gale.executor.annotation.thread.OriginalServerThreadOnly;
+import org.galemc.gale.executor.queue.BaseTaskQueues; +import org.galemc.gale.executor.queue.BaseTaskQueues;
+import org.galemc.gale.executor.queue.ScheduledServerThreadTaskQueues; +import org.galemc.gale.executor.queue.ScheduledServerThreadTaskQueues;
@@ -521,7 +520,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
import org.slf4j.Logger; import org.slf4j.Logger;
// CraftBukkit start // CraftBukkit start
@@ -193,11 +199,19 @@ import org.bukkit.event.server.ServerLoadEvent; @@ -192,11 +198,19 @@ import org.bukkit.event.server.ServerLoadEvent;
import co.aikar.timings.MinecraftTimings; // Paper import co.aikar.timings.MinecraftTimings; // Paper
@@ -543,7 +542,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
public static final Logger LOGGER = LogUtils.getLogger(); public static final Logger LOGGER = LogUtils.getLogger();
public static final String VANILLA_BRAND = "vanilla"; public static final String VANILLA_BRAND = "vanilla";
private static final float AVERAGE_TICK_TIME_SMOOTHING = 0.8F; private static final float AVERAGE_TICK_TIME_SMOOTHING = 0.8F;
@@ -235,6 +249,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -226,6 +240,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
private int port; private int port;
private final LayeredRegistryAccess<RegistryLayer> registries; private final LayeredRegistryAccess<RegistryLayer> registries;
private Map<ResourceKey<Level>, ServerLevel> levels; private Map<ResourceKey<Level>, ServerLevel> levels;
@@ -554,7 +553,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
private PlayerList playerList; private PlayerList playerList;
private volatile boolean running; private volatile boolean running;
private volatile boolean isRestarting = false; // Paper - flag to signify we're attempting to restart private volatile boolean isRestarting = false; // Paper - flag to signify we're attempting to restart
@@ -264,10 +282,115 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -255,10 +273,115 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
private long lastOverloadWarning; private long lastOverloadWarning;
protected final Services services; protected final Services services;
private long lastServerStatus; private long lastServerStatus;
@@ -674,7 +673,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
private final PackRepository packRepository; private final PackRepository packRepository;
private final ServerScoreboard scoreboard; private final ServerScoreboard scoreboard;
@Nullable @Nullable
@@ -296,7 +419,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -287,7 +410,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public java.util.Queue<Runnable> processQueue = new java.util.concurrent.ConcurrentLinkedQueue<Runnable>(); public java.util.Queue<Runnable> processQueue = new java.util.concurrent.ConcurrentLinkedQueue<Runnable>();
public int autosavePeriod; public int autosavePeriod;
public Commands vanillaCommandDispatcher; public Commands vanillaCommandDispatcher;
@@ -683,7 +682,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
// CraftBukkit end // CraftBukkit end
// Spigot start // Spigot start
public static final int TPS = 20; public static final int TPS = 20;
@@ -312,9 +435,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -303,9 +426,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public volatile boolean abnormalExit = false; // Paper public volatile boolean abnormalExit = false; // Paper
public boolean isIteratingOverLevels = false; // Paper public boolean isIteratingOverLevels = false; // Paper
@@ -695,7 +694,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
((MinecraftServer) atomicreference.get()).runServer(); ((MinecraftServer) atomicreference.get()).runServer();
}, "Server thread"); }, "Server thread");
@@ -333,9 +456,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -324,16 +447,19 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
return s0; return s0;
} }
@@ -707,10 +706,9 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
+ // Gale end - base thread pools + // Gale end - base thread pools
SERVER = this; // Paper - better singleton SERVER = this; // Paper - better singleton
+ isConstructed = true; // Gale - base thread pools + isConstructed = true; // Gale - base thread pools
this.metricsRecorder = InactiveMetricsRecorder.INSTANCE; this.status = new ServerStatus();
this.profiler = this.metricsRecorder.getProfiler(); this.random = RandomSource.create();
this.onMetricsRecordingStopped = (methodprofilerresults) -> { this.port = -1;
@@ -349,7 +475,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.levels = Maps.newLinkedHashMap(); this.levels = Maps.newLinkedHashMap();
this.running = true; this.running = true;
this.tickTimes = new long[100]; this.tickTimes = new long[100];
@@ -719,7 +717,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
this.scoreboard = new ServerScoreboard(this); this.scoreboard = new ServerScoreboard(this);
this.customBossEvents = new CustomBossEvents(); this.customBossEvents = new CustomBossEvents();
this.frameTimer = new FrameTimer(); this.frameTimer = new FrameTimer();
@@ -375,7 +501,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -359,7 +485,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
HolderGetter<Block> holdergetter = this.registries.compositeAccess().registryOrThrow(Registries.BLOCK).asLookup().filterFeatures(this.worldData.enabledFeatures()); HolderGetter<Block> holdergetter = this.registries.compositeAccess().registryOrThrow(Registries.BLOCK).asLookup().filterFeatures(this.worldData.enabledFeatures());
this.structureTemplateManager = new StructureTemplateManager(worldstem.resourceManager(), convertable_conversionsession, datafixer, holdergetter); this.structureTemplateManager = new StructureTemplateManager(worldstem.resourceManager(), convertable_conversionsession, datafixer, holdergetter);
@@ -731,7 +729,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
this.executor = Util.backgroundExecutor(); this.executor = Util.backgroundExecutor();
} }
// CraftBukkit start // CraftBukkit start
@@ -615,7 +744,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -599,7 +728,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
} }
this.forceDifficulty(); this.forceDifficulty();
@@ -740,7 +738,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
this.prepareLevels(worldserver.getChunkSource().chunkMap.progressListener, worldserver); this.prepareLevels(worldserver.getChunkSource().chunkMap.progressListener, worldserver);
//worldserver.entityManager.tick(); // SPIGOT-6526: Load pending entities so they are available to the API // Paper - rewrite chunk system, not required to "tick" anything //worldserver.entityManager.tick(); // SPIGOT-6526: Load pending entities so they are available to the API // Paper - rewrite chunk system, not required to "tick" anything
this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(worldserver.getWorld())); this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(worldserver.getWorld()));
@@ -774,7 +903,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -758,7 +887,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
//ChunkProviderServer chunkproviderserver = worldserver.getChunkProvider(); // Paper - move up //ChunkProviderServer chunkproviderserver = worldserver.getChunkProvider(); // Paper - move up
chunkproviderserver.getLightEngine().setTaskPerBatch(500); chunkproviderserver.getLightEngine().setTaskPerBatch(500);
@@ -749,7 +747,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
// Paper start - configurable spawn reason // Paper start - configurable spawn reason
int radiusBlocks = worldserver.paperConfig().spawn.keepSpawnLoadedRange * 16; int radiusBlocks = worldserver.paperConfig().spawn.keepSpawnLoadedRange * 16;
int radiusChunks = radiusBlocks / 16 + ((radiusBlocks & 15) != 0 ? 1 : 0); int radiusChunks = radiusBlocks / 16 + ((radiusBlocks & 15) != 0 ? 1 : 0);
@@ -818,6 +947,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -802,6 +931,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
worldserver.setSpawnSettings(worldserver.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && ((DedicatedServer) this).settings.getProperties().spawnMonsters, this.isSpawningAnimals()); // Paper - per level difficulty (from setDifficulty(ServerLevel, Difficulty, boolean)) worldserver.setSpawnSettings(worldserver.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && ((DedicatedServer) this).settings.getProperties().spawnMonsters, this.isSpawningAnimals()); // Paper - per level difficulty (from setDifficulty(ServerLevel, Difficulty, boolean))
this.forceTicks = false; this.forceTicks = false;
@@ -761,7 +759,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
// CraftBukkit end // CraftBukkit end
} }
@@ -844,8 +978,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -828,8 +962,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Paper end - rewrite chunk system - add close param // Paper end - rewrite chunk system - add close param
boolean flag3 = false; boolean flag3 = false;
@@ -776,7 +774,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
if (!suppressLogs) { if (!suppressLogs) {
MinecraftServer.LOGGER.info("Saving chunks for level '{}'/{}", worldserver, worldserver.dimension().location()); MinecraftServer.LOGGER.info("Saving chunks for level '{}'/{}", worldserver, worldserver.dimension().location());
@@ -869,14 +1007,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -853,14 +991,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
*/ */
// CraftBukkit end // CraftBukkit end
if (flush) { if (flush) {
@@ -791,7 +789,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
MinecraftServer.LOGGER.info("ThreadedAnvilChunkStorage: All dimensions are saved"); MinecraftServer.LOGGER.info("ThreadedAnvilChunkStorage: All dimensions are saved");
} }
@@ -903,7 +1033,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -887,7 +1017,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
// CraftBukkit start // CraftBukkit start
@@ -800,7 +798,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
public volatile boolean hasFullyShutdown = false; // Paper public volatile boolean hasFullyShutdown = false; // Paper
private boolean hasLoggedStop = false; // Paper private boolean hasLoggedStop = false; // Paper
private final Object stopLock = new Object(); private final Object stopLock = new Object();
@@ -932,8 +1062,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -916,8 +1046,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
*/ */
MinecraftServer.LOGGER.info("Stopping main thread (Ignore any thread death message you see! - DO NOT REPORT THREAD DEATH TO PAPER - If you think this is a Gale bug, please report it at https://github.com/GaleMC/Gale/issues )"); MinecraftServer.LOGGER.info("Stopping main thread (Ignore any thread death message you see! - DO NOT REPORT THREAD DEATH TO PAPER - If you think this is a Gale bug, please report it at https://github.com/GaleMC/Gale/issues )");
// Gale end - branding changes // Gale end - branding changes
@@ -813,7 +811,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
try { try {
Thread.sleep(1); Thread.sleep(1);
} catch (InterruptedException e) {} } catch (InterruptedException e) {}
@@ -967,12 +1099,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -948,12 +1080,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
MinecraftServer.LOGGER.info("Saving worlds"); MinecraftServer.LOGGER.info("Saving worlds");
@@ -827,7 +825,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
if (worldserver != null) { if (worldserver != null) {
worldserver.noSave = false; worldserver.noSave = false;
} }
@@ -989,9 +1116,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -970,9 +1097,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
MinecraftServer.LOGGER.error("Failed to unlock level {}", this.storageSource.getLevelId(), ioexception1); MinecraftServer.LOGGER.error("Failed to unlock level {}", this.storageSource.getLevelId(), ioexception1);
} }
// Spigot start // Spigot start
@@ -837,7 +835,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
if (org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) { if (org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) {
MinecraftServer.LOGGER.info("Saving usercache.json"); MinecraftServer.LOGGER.info("Saving usercache.json");
this.getProfileCache().save(false); // Paper this.getProfileCache().save(false); // Paper
@@ -1001,6 +1125,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -982,6 +1106,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
LOGGER.info("Flushing Chunk IO"); LOGGER.info("Flushing Chunk IO");
io.papermc.paper.chunk.system.io.RegionFileIOThread.close(true); // Paper // Paper - rewrite chunk system io.papermc.paper.chunk.system.io.RegionFileIOThread.close(true); // Paper // Paper - rewrite chunk system
LOGGER.info("Closing Thread Pool"); LOGGER.info("Closing Thread Pool");
@@ -851,7 +849,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
Util.shutdownExecutors(); // Paper Util.shutdownExecutors(); // Paper
LOGGER.info("Closing Server"); LOGGER.info("Closing Server");
try { try {
@@ -1036,7 +1167,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1017,7 +1148,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.running = false; this.running = false;
if (waitForShutdown) { if (waitForShutdown) {
try { try {
@@ -860,7 +858,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
} catch (InterruptedException interruptedexception) { } catch (InterruptedException interruptedexception) {
MinecraftServer.LOGGER.error("Error while shutting down", interruptedexception); MinecraftServer.LOGGER.error("Error while shutting down", interruptedexception);
} }
@@ -1110,6 +1241,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1091,6 +1222,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public static long lastTickOversleepTime; public static long lastTickOversleepTime;
// Gale end - YAPFA - last tick time // Gale end - YAPFA - last tick time
@@ -868,7 +866,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
protected void runServer() { protected void runServer() {
try { try {
long serverStartTime = Util.getNanos(); // Paper long serverStartTime = Util.getNanos(); // Paper
@@ -1117,7 +1249,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1098,7 +1230,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
throw new IllegalStateException("Failed to initialize server"); throw new IllegalStateException("Failed to initialize server");
} }
@@ -877,7 +875,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
this.status.setDescription(Component.literal(this.motd)); this.status.setDescription(Component.literal(this.motd));
this.status.setVersion(new ServerStatus.Version(SharedConstants.getCurrentVersion().getName(), SharedConstants.getCurrentVersion().getProtocolVersion())); this.status.setVersion(new ServerStatus.Version(SharedConstants.getCurrentVersion().getName(), SharedConstants.getCurrentVersion().getProtocolVersion()));
this.status.setEnforcesSecureChat(this.enforceSecureProfile()); this.status.setEnforcesSecureChat(this.enforceSecureProfile());
@@ -1154,7 +1286,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1135,7 +1267,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
if (this.server.getWarnOnOverload()) // CraftBukkit if (this.server.getWarnOnOverload()) // CraftBukkit
MinecraftServer.LOGGER.warn("Can't keep up! Is the server overloaded? Running {}ms or {} ticks behind", i, j); MinecraftServer.LOGGER.warn("Can't keep up! Is the server overloaded? Running {}ms or {} ticks behind", i, j);
@@ -886,25 +884,22 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
this.lastOverloadWarning = this.nextTickTime; this.lastOverloadWarning = this.nextTickTime;
} }
@@ -1183,15 +1315,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1159,12 +1291,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
//MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit // Paper - don't overwrite current tick time //MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit // Paper - don't overwrite current tick time
lastTick = curTime; lastTick = curTime;
- this.nextTickTime += 50L; - this.nextTickTime += 50L;
+ this.setNextTickTime(this.nextTickTime + 50L); // Gale - base thread pools + this.setNextTickTime(this.nextTickTime + 50L); // Gale - base thread pools
this.startMetricsRecordingTick();
this.profiler.push("tick");
long tickProperStart = System.nanoTime(); // Gale - YAPFA - last tick time long tickProperStart = System.nanoTime(); // Gale - YAPFA - last tick time
this.tickServer(this::haveTime); this.tickServer(this::haveTime);
lastTickProperTime = (System.nanoTime() - tickProperStart) / 1000000L; // Gale - YAPFA - last tick time lastTickProperTime = (System.nanoTime() - tickProperStart) / 1000000L; // Gale - YAPFA - last tick time
this.profiler.popPush("nextTickWait");
- this.mayHaveDelayedTasks = true; - this.mayHaveDelayedTasks = true;
- this.delayedTasksMaxNextTickTime = Math.max(Util.getMillis() + 50L, this.nextTickTime); - this.delayedTasksMaxNextTickTime = Math.max(Util.getMillis() + 50L, this.nextTickTime);
+ this.setDelayedTasksMaxNextTickTime(Math.max(Util.getMillis() + 50L, this.nextTickTime)); // Gale - base thread pools + this.setDelayedTasksMaxNextTickTime(Math.max(Util.getMillis() + 50L, this.nextTickTime)); // Gale - base thread pools
this.waitUntilNextTick(); this.waitUntilNextTick();
this.profiler.pop(); this.isReady = true;
this.endMetricsRecordingTick(); JvmProfiler.INSTANCE.onServerTick(this.averageTickTime);
@@ -1274,7 +1405,47 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1245,7 +1376,47 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
return crashreport; return crashreport;
} }
@@ -953,7 +948,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
// Paper start // Paper start
if (this.forceTicks) { if (this.forceTicks) {
return true; return true;
@@ -1282,13 +1453,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1253,13 +1424,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Paper end // Paper end
// CraftBukkit start // CraftBukkit start
if (isOversleep) return canOversleep();// Paper - because of our changes, this logic is broken if (isOversleep) return canOversleep();// Paper - because of our changes, this logic is broken
@@ -970,7 +965,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
} }
private boolean canSleepForTickNoOversleep() { private boolean canSleepForTickNoOversleep() {
@@ -1297,7 +1468,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1268,7 +1439,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Paper end // Paper end
private void executeModerately() { private void executeModerately() {
@@ -979,7 +974,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
java.util.concurrent.locks.LockSupport.parkNanos("executing tasks", 1000L); java.util.concurrent.locks.LockSupport.parkNanos("executing tasks", 1000L);
} }
// CraftBukkit end // CraftBukkit end
@@ -1305,62 +1476,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1276,61 +1447,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
protected void waitUntilNextTick() { protected void waitUntilNextTick() {
//this.executeAll(); // Paper - move this into the tick method for timings //this.executeAll(); // Paper - move this into the tick method for timings
long tickOversleepStart = System.nanoTime(); // Gale - YAPFA - last tick time long tickOversleepStart = System.nanoTime(); // Gale - YAPFA - last tick time
@@ -1043,14 +1038,13 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
- } - }
- -
- public void doRunTask(TickTask ticktask) { // CraftBukkit - decompile error - public void doRunTask(TickTask ticktask) { // CraftBukkit - decompile error
- this.getProfiler().incrementCounter("runTask");
- super.doRunTask(ticktask); - super.doRunTask(ticktask);
- } - }
- -
private void updateStatusIcon(ServerStatus metadata) { private void updateStatusIcon(ServerStatus metadata) {
Optional<File> optional = Optional.of(this.getFile("server-icon.png")).filter(File::isFile); Optional<File> optional = Optional.of(this.getFile("server-icon.png")).filter(File::isFile);
@@ -1408,14 +1537,19 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1378,14 +1508,19 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Paper start - move oversleep into full server tick // Paper start - move oversleep into full server tick
isOversleep = true;MinecraftTimings.serverOversleep.startTiming(); isOversleep = true;MinecraftTimings.serverOversleep.startTiming();
@@ -1070,7 +1064,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
this.tickChildren(shouldKeepTicking); this.tickChildren(shouldKeepTicking);
if (i - this.lastServerStatus >= 5000000000L) { if (i - this.lastServerStatus >= 5000000000L) {
this.lastServerStatus = i; this.lastServerStatus = i;
@@ -1451,7 +1585,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1420,7 +1555,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
if (playerSaveInterval > 0) { if (playerSaveInterval > 0) {
this.playerList.saveAll(playerSaveInterval); this.playerList.saveAll(playerSaveInterval);
} }
@@ -1079,7 +1073,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
if (level.paperConfig().chunks.autoSaveInterval.value() > 0) { if (level.paperConfig().chunks.autoSaveInterval.value() > 0) {
level.saveIncrementally(fullSave); level.saveIncrementally(fullSave);
} }
@@ -1464,7 +1598,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1432,7 +1567,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
io.papermc.paper.util.CachedLists.reset(); // Paper io.papermc.paper.util.CachedLists.reset(); // Paper
// Paper start - move executeAll() into full server tick timing // Paper start - move executeAll() into full server tick timing
try (co.aikar.timings.Timing ignored = MinecraftTimings.processTasksTimer.startTiming()) { try (co.aikar.timings.Timing ignored = MinecraftTimings.processTasksTimer.startTiming()) {
@@ -1088,7 +1082,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
} }
// Paper end // Paper end
// Paper start // Paper start
@@ -1512,7 +1646,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1476,7 +1611,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
MinecraftTimings.timeUpdateTimer.startTiming(); // Spigot // Paper MinecraftTimings.timeUpdateTimer.startTiming(); // Spigot // Paper
// Send time updates to everyone, it will get the right time from the world the player is in. // Send time updates to everyone, it will get the right time from the world the player is in.
// Paper start - optimize time updates // Paper start - optimize time updates
@@ -1097,7 +1091,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
final boolean doDaylight = world.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT); final boolean doDaylight = world.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT);
final long dayTime = world.getDayTime(); final long dayTime = world.getDayTime();
long worldTime = world.getGameTime(); long worldTime = world.getGameTime();
@@ -1532,9 +1666,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1496,9 +1631,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
MinecraftTimings.timeUpdateTimer.stopTiming(); // Spigot // Paper MinecraftTimings.timeUpdateTimer.stopTiming(); // Spigot // Paper
this.isIteratingOverLevels = true; // Paper this.isIteratingOverLevels = true; // Paper
@@ -1108,7 +1102,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper
worldserver.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper worldserver.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper
net.minecraft.world.level.block.entity.HopperBlockEntity.skipHopperEvents = worldserver.paperConfig().hopper.disableMoveEvent || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper net.minecraft.world.level.block.entity.HopperBlockEntity.skipHopperEvents = worldserver.paperConfig().hopper.disableMoveEvent || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper
@@ -1618,7 +1750,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1569,7 +1702,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
public boolean isShutdown() { public boolean isShutdown() {
@@ -1117,7 +1111,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
} }
public File getFile(String path) { public File getFile(String path) {
@@ -1626,7 +1758,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1577,7 +1710,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
public final ServerLevel overworld() { public final ServerLevel overworld() {
@@ -1131,7 +1125,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
} }
@Nullable @Nullable
@@ -1640,6 +1777,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1591,6 +1729,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
Map<ResourceKey<Level>, ServerLevel> newLevels = Maps.newLinkedHashMap(oldLevels); Map<ResourceKey<Level>, ServerLevel> newLevels = Maps.newLinkedHashMap(oldLevels);
newLevels.put(level.dimension(), level); newLevels.put(level.dimension(), level);
this.levels = Collections.unmodifiableMap(newLevels); this.levels = Collections.unmodifiableMap(newLevels);
@@ -1145,7 +1139,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
} }
public void removeLevel(ServerLevel level) { public void removeLevel(ServerLevel level) {
@@ -1647,6 +1791,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1598,6 +1743,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
Map<ResourceKey<Level>, ServerLevel> newLevels = Maps.newLinkedHashMap(oldLevels); Map<ResourceKey<Level>, ServerLevel> newLevels = Maps.newLinkedHashMap(oldLevels);
newLevels.remove(level.dimension()); newLevels.remove(level.dimension());
this.levels = Collections.unmodifiableMap(newLevels); this.levels = Collections.unmodifiableMap(newLevels);
@@ -1160,7 +1154,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
} }
// CraftBukkit end // CraftBukkit end
@@ -1654,8 +1806,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1605,8 +1758,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
return this.levels.keySet(); return this.levels.keySet();
} }
@@ -1176,7 +1170,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
} }
public String getServerVersion() { public String getServerVersion() {
@@ -1775,10 +1933,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1726,10 +1885,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
private void updateMobSpawningFlags() { private void updateMobSpawningFlags() {
@@ -1188,7 +1182,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
worldserver.setSpawnSettings(worldserver.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && ((DedicatedServer) this).settings.getProperties().spawnMonsters, this.isSpawningAnimals()); // Paper - per level difficulty (from setDifficulty(ServerLevel, Difficulty, boolean)) worldserver.setSpawnSettings(worldserver.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && ((DedicatedServer) this).settings.getProperties().spawnMonsters, this.isSpawningAnimals()); // Paper - per level difficulty (from setDifficulty(ServerLevel, Difficulty, boolean))
} }
@@ -1977,25 +2132,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1928,25 +2084,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
return 29999984; return 29999984;
} }
@@ -1214,7 +1208,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
public int getCompressionThreshold() { public int getCompressionThreshold() {
return 256; return 256;
} }
@@ -2062,7 +2198,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -2013,7 +2150,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
net.minecraft.world.item.alchemy.PotionBrewing.reload(); // Paper net.minecraft.world.item.alchemy.PotionBrewing.reload(); // Paper
new io.papermc.paper.event.server.ServerResourcesReloadedEvent(cause).callEvent(); // Paper new io.papermc.paper.event.server.ServerResourcesReloadedEvent(cause).callEvent(); // Paper
// Paper start // Paper start
@@ -1223,7 +1217,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
return; return;
} }
// this.getPlayerList().saveAll(); // Paper - we don't need to save everything, just advancements // this.getPlayerList().saveAll(); // Paper - we don't need to save everything, just advancements
@@ -2304,7 +2440,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -2246,7 +2383,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
BufferedWriter bufferedwriter = Files.newBufferedWriter(path); BufferedWriter bufferedwriter = Files.newBufferedWriter(path);
try { try {
@@ -1232,7 +1226,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
bufferedwriter.write(String.format(Locale.ROOT, "average_tick_time: %f\n", this.getAverageTickTime())); bufferedwriter.write(String.format(Locale.ROOT, "average_tick_time: %f\n", this.getAverageTickTime()));
bufferedwriter.write(String.format(Locale.ROOT, "tick_times: %s\n", Arrays.toString(this.tickTimes))); bufferedwriter.write(String.format(Locale.ROOT, "tick_times: %s\n", Arrays.toString(this.tickTimes)));
bufferedwriter.write(String.format(Locale.ROOT, "queue: %s\n", Util.backgroundExecutor())); bufferedwriter.write(String.format(Locale.ROOT, "queue: %s\n", Util.backgroundExecutor()));
@@ -2490,7 +2626,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -2432,7 +2569,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
// CraftBukkit start // CraftBukkit start
@@ -1240,7 +1234,7 @@ index d3210128894a8e70919972e60c62bf34338e5fa2..b2f611d8768f293820c52a8ab515471c
public boolean isSameThread() { public boolean isSameThread() {
return io.papermc.paper.util.TickThread.isTickThread(); // Paper - rewrite chunk system return io.papermc.paper.util.TickThread.isTickThread(); // Paper - rewrite chunk system
} }
@@ -2744,7 +2879,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -2570,7 +2706,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// give all worlds a fair chance at by targetting them all. // give all worlds a fair chance at by targetting them all.
// if we execute too many tasks, that's fine - we have logic to correctly handle overuse of allocated time. // if we execute too many tasks, that's fine - we have logic to correctly handle overuse of allocated time.
boolean executed = false; boolean executed = false;
@@ -1305,7 +1299,7 @@ index eed9f125df46b616b7234a2d669971bc51bc231b..396258cb21a8e5488f0f456b65dc629f
// CraftBukkit end // CraftBukkit end
this.settings = dedicatedserversettings; this.settings = dedicatedserversettings;
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 5b8260b6a309bd1aba2286e8c1f8cfc44326adbd..e064398e0fdb8e7e0600b6993a70f6c87de7f357 100644 index 8ed18a158a13dceca7cd342125c09e52ac0d013c..d513245ec5fadfa511895feeef73d2a57bd21160 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -11,7 +11,6 @@ import java.util.Collections; @@ -11,7 +11,6 @@ import java.util.Collections;
@@ -1323,8 +1317,8 @@ index 5b8260b6a309bd1aba2286e8c1f8cfc44326adbd..e064398e0fdb8e7e0600b6993a70f6c8
+import net.minecraft.server.MinecraftServer; +import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.progress.ChunkProgressListener; import net.minecraft.server.level.progress.ChunkProgressListener;
import net.minecraft.util.VisibleForDebug; import net.minecraft.util.VisibleForDebug;
import net.minecraft.util.profiling.ProfilerFiller; import net.minecraft.util.thread.BlockableEventLoop;
@@ -49,6 +49,7 @@ import net.minecraft.world.level.storage.DimensionDataStorage; @@ -48,6 +48,7 @@ import net.minecraft.world.level.storage.DimensionDataStorage;
import net.minecraft.world.level.storage.LevelData; import net.minecraft.world.level.storage.LevelData;
import net.minecraft.world.level.storage.LevelStorageSource; import net.minecraft.world.level.storage.LevelStorageSource;
import it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet; // Paper import it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet; // Paper
@@ -1332,7 +1326,7 @@ index 5b8260b6a309bd1aba2286e8c1f8cfc44326adbd..e064398e0fdb8e7e0600b6993a70f6c8
public class ServerChunkCache extends ChunkSource { public class ServerChunkCache extends ChunkSource {
@@ -999,6 +1000,14 @@ public class ServerChunkCache extends ChunkSource { @@ -977,6 +978,14 @@ public class ServerChunkCache extends ChunkSource {
super.doRunTask(task); super.doRunTask(task);
} }
@@ -1348,7 +1342,7 @@ index 5b8260b6a309bd1aba2286e8c1f8cfc44326adbd..e064398e0fdb8e7e0600b6993a70f6c8
// CraftBukkit start - process pending Chunk loadCallback() and unloadCallback() after each run task // CraftBukkit start - process pending Chunk loadCallback() and unloadCallback() after each run task
public boolean pollTask() { public boolean pollTask() {
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 a980908087b47869cd9326dbc62974567ed3170a..dce257dadb12cae5d6bc280c7ee4815055160258 100644 index 7b9b2ac6f7b7413849c4a9144abdb8dcc80a22e3..b1885dbccf3b0b52cc048eb93849f60484a751ed 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
@@ -22,6 +22,8 @@ import java.io.Writer; @@ -22,6 +22,8 @@ import java.io.Writer;
@@ -1360,7 +1354,7 @@ index a980908087b47869cd9326dbc62974567ed3170a..dce257dadb12cae5d6bc280c7ee48150
import java.util.Comparator; import java.util.Comparator;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
@@ -158,6 +160,8 @@ import net.minecraft.world.phys.shapes.BooleanOp; @@ -157,6 +159,8 @@ import net.minecraft.world.phys.shapes.BooleanOp;
import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.ticks.LevelTicks; import net.minecraft.world.ticks.LevelTicks;
@@ -1369,7 +1363,7 @@ index a980908087b47869cd9326dbc62974567ed3170a..dce257dadb12cae5d6bc280c7ee48150
import org.slf4j.Logger; import org.slf4j.Logger;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
@@ -191,6 +195,10 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -190,6 +194,10 @@ public class ServerLevel extends Level implements WorldGenLevel {
private static final int MAX_SCHEDULED_TICKS_PER_TICK = 65536; private static final int MAX_SCHEDULED_TICKS_PER_TICK = 65536;
final List<ServerPlayer> players; final List<ServerPlayer> players;
public final ServerChunkCache chunkSource; public final ServerChunkCache chunkSource;
@@ -1380,7 +1374,7 @@ index a980908087b47869cd9326dbc62974567ed3170a..dce257dadb12cae5d6bc280c7ee48150
private final MinecraftServer server; private final MinecraftServer server;
public final PrimaryLevelData serverLevelData; // CraftBukkit - type public final PrimaryLevelData serverLevelData; // CraftBukkit - type
final EntityTickList entityTickList; final EntityTickList entityTickList;
@@ -2590,7 +2598,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -2550,7 +2558,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Spigot start // Spigot start
if ( entity instanceof Player ) if ( entity instanceof Player )
{ {
@@ -1390,7 +1384,7 @@ index a980908087b47869cd9326dbc62974567ed3170a..dce257dadb12cae5d6bc280c7ee48150
for (Object o : worldData.cache.values() ) for (Object o : worldData.cache.values() )
{ {
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 406c71f84201bff5e46d49aaec10ae7efc419ebc..264086df2718c7ca188a2ea69a332ba563ce55c8 100644 index f0648c94029796653c8c8a5bdd191cf99de7b58a..a4731aba0022f4b2a38a41bfe41a21a86389d6fe 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -186,6 +186,8 @@ import net.minecraft.world.phys.shapes.Shapes; @@ -186,6 +186,8 @@ import net.minecraft.world.phys.shapes.Shapes;
@@ -1402,7 +1396,7 @@ index 406c71f84201bff5e46d49aaec10ae7efc419ebc..264086df2718c7ca188a2ea69a332ba5
import org.slf4j.Logger; import org.slf4j.Logger;
// CraftBukkit start // CraftBukkit start
@@ -550,7 +552,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -548,7 +550,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
Objects.requireNonNull(this.connection); Objects.requireNonNull(this.connection);
// CraftBukkit - Don't wait // CraftBukkit - Don't wait
@@ -1411,7 +1405,7 @@ index 406c71f84201bff5e46d49aaec10ae7efc419ebc..264086df2718c7ca188a2ea69a332ba5
} }
private <T, R> CompletableFuture<R> filterTextPacket(T text, BiFunction<TextFilter, T, CompletableFuture<R>> filterer) { private <T, R> CompletableFuture<R> filterTextPacket(T text, BiFunction<TextFilter, T, CompletableFuture<R>> filterer) {
@@ -881,21 +883,20 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -879,21 +881,20 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
} }
// Paper start // Paper start
@@ -1436,7 +1430,7 @@ index 406c71f84201bff5e46d49aaec10ae7efc419ebc..264086df2718c7ca188a2ea69a332ba5
return; return;
} }
// Paper end // Paper end
@@ -920,7 +921,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -918,7 +919,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
if (!event.isHandled()) { if (!event.isHandled()) {
if (!event.isCancelled()) { if (!event.isCancelled()) {
@@ -1445,7 +1439,7 @@ index 406c71f84201bff5e46d49aaec10ae7efc419ebc..264086df2718c7ca188a2ea69a332ba5
ParseResults<CommandSourceStack> parseresults = this.server.getCommands().getDispatcher().parse(stringreader, this.player.createCommandSourceStack()); ParseResults<CommandSourceStack> parseresults = this.server.getCommands().getDispatcher().parse(stringreader, this.player.createCommandSourceStack());
this.server.getCommands().getDispatcher().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> { this.server.getCommands().getDispatcher().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> {
@@ -931,7 +932,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -929,7 +930,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
this.connection.send(new ClientboundCommandSuggestionsPacket(packet.getId(), suggestEvent.getSuggestions())); this.connection.send(new ClientboundCommandSuggestionsPacket(packet.getId(), suggestEvent.getSuggestions()));
// Paper end - Brigadier API // Paper end - Brigadier API
}); });
@@ -1454,7 +1448,7 @@ index 406c71f84201bff5e46d49aaec10ae7efc419ebc..264086df2718c7ca188a2ea69a332ba5
} }
} else if (!completions.isEmpty()) { } else if (!completions.isEmpty()) {
final com.mojang.brigadier.suggestion.SuggestionsBuilder builder0 = new com.mojang.brigadier.suggestion.SuggestionsBuilder(command, stringreader.getTotalLength()); final com.mojang.brigadier.suggestion.SuggestionsBuilder builder0 = new com.mojang.brigadier.suggestion.SuggestionsBuilder(command, stringreader.getTotalLength());
@@ -1240,7 +1241,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -1238,7 +1239,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
int byteLength = testString.getBytes(java.nio.charset.StandardCharsets.UTF_8).length; int byteLength = testString.getBytes(java.nio.charset.StandardCharsets.UTF_8).length;
if (byteLength > 256 * 4) { if (byteLength > 256 * 4) {
ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send a book with with a page too large!"); ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send a book with with a page too large!");
@@ -1463,7 +1457,7 @@ index 406c71f84201bff5e46d49aaec10ae7efc419ebc..264086df2718c7ca188a2ea69a332ba5
return; return;
} }
byteTotal += byteLength; byteTotal += byteLength;
@@ -1263,14 +1264,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -1261,14 +1262,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
if (byteTotal > byteAllowed) { if (byteTotal > byteAllowed) {
ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send too large of a book. Book Size: " + byteTotal + " - Allowed: "+ byteAllowed + " - Pages: " + pageList.size()); ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send too large of a book. Book Size: " + byteTotal + " - Allowed: "+ byteAllowed + " - Pages: " + pageList.size());
@@ -1480,7 +1474,7 @@ index 406c71f84201bff5e46d49aaec10ae7efc419ebc..264086df2718c7ca188a2ea69a332ba5
return; return;
} }
this.lastBookTick = MinecraftServer.currentTick; this.lastBookTick = MinecraftServer.currentTick;
@@ -2074,10 +2075,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2072,10 +2073,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
public void handleTeleportToEntityPacket(ServerboundTeleportToEntityPacket packet) { public void handleTeleportToEntityPacket(ServerboundTeleportToEntityPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
if (this.player.isSpectator()) { if (this.player.isSpectator()) {
@@ -1492,7 +1486,7 @@ index 406c71f84201bff5e46d49aaec10ae7efc419ebc..264086df2718c7ca188a2ea69a332ba5
Entity entity = packet.getEntity(worldserver); Entity entity = packet.getEntity(worldserver);
if (entity != null) { if (entity != null) {
@@ -2226,9 +2224,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2224,9 +2222,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
} }
// CraftBukkit end // CraftBukkit end
if (ServerGamePacketListenerImpl.isChatMessageIllegal(packet.message())) { if (ServerGamePacketListenerImpl.isChatMessageIllegal(packet.message())) {
@@ -1504,7 +1498,7 @@ index 406c71f84201bff5e46d49aaec10ae7efc419ebc..264086df2718c7ca188a2ea69a332ba5
} else { } else {
Optional<LastSeenMessages> optional = this.tryHandleChat(packet.message(), packet.timeStamp(), packet.lastSeenMessages()); Optional<LastSeenMessages> optional = this.tryHandleChat(packet.message(), packet.timeStamp(), packet.lastSeenMessages());
@@ -2262,9 +2260,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2260,9 +2258,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@Override @Override
public void handleChatCommand(ServerboundChatCommandPacket packet) { public void handleChatCommand(ServerboundChatCommandPacket packet) {
if (ServerGamePacketListenerImpl.isChatMessageIllegal(packet.command())) { if (ServerGamePacketListenerImpl.isChatMessageIllegal(packet.command())) {
@@ -1516,7 +1510,7 @@ index 406c71f84201bff5e46d49aaec10ae7efc419ebc..264086df2718c7ca188a2ea69a332ba5
} else { } else {
Optional<LastSeenMessages> optional = this.tryHandleChat(packet.command(), packet.timeStamp(), packet.lastSeenMessages()); Optional<LastSeenMessages> optional = this.tryHandleChat(packet.command(), packet.timeStamp(), packet.lastSeenMessages());
@@ -2344,9 +2342,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2342,9 +2340,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
private Optional<LastSeenMessages> tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) { private Optional<LastSeenMessages> tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) {
if (!this.updateChatOrder(timestamp)) { if (!this.updateChatOrder(timestamp)) {
ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}': {} > {}", this.player.getName().getString(), message, this.lastChatTimeStamp.get().getEpochSecond(), timestamp.getEpochSecond()); // Paper ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}': {} > {}", this.player.getName().getString(), message, this.lastChatTimeStamp.get().getEpochSecond(), timestamp.getEpochSecond()); // Paper
@@ -1529,7 +1523,7 @@ index 406c71f84201bff5e46d49aaec10ae7efc419ebc..264086df2718c7ca188a2ea69a332ba5
return Optional.empty(); return Optional.empty();
} else if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales } else if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales
this.send(new ClientboundSystemChatPacket(Component.translatable("chat.disabled.options").withStyle(ChatFormatting.RED), false)); this.send(new ClientboundSystemChatPacket(Component.translatable("chat.disabled.options").withStyle(ChatFormatting.RED), false));
@@ -3276,7 +3274,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -3274,7 +3272,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
// Paper start // Paper start
if (!org.bukkit.Bukkit.isPrimaryThread()) { if (!org.bukkit.Bukkit.isPrimaryThread()) {
if (recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) { if (recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) {
@@ -1864,7 +1858,7 @@ index 69acbab61a79c24312359a63086f9353d740113f..49ace73d901b6f55545bb21a93d026a0
} }
} catch (Exception ex) { } catch (Exception ex) {
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
index 6f6b96fe499f1b1888a141b60bd3773ba45e75f6..5bf0246e5b2991db5c590701d562ff973ecb788a 100644 index 30416b4622214ebc71956541af76ed1567e36f73..751ddcdc3898dccf5c94ba4044b8398a8f23613e 100644
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java --- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java +++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
@@ -2,11 +2,14 @@ @@ -2,11 +2,14 @@
@@ -1882,7 +1876,7 @@ index 6f6b96fe499f1b1888a141b60bd3773ba45e75f6..5bf0246e5b2991db5c590701d562ff97
import java.util.Locale; import java.util.Locale;
import java.util.function.Consumer; import java.util.function.Consumer;
@@ -74,6 +77,223 @@ public class GaleGlobalConfiguration extends ConfigurationPart { @@ -72,6 +75,223 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
} }
// Gale end - Pufferfish - SIMD support // Gale end - Pufferfish - SIMD support
@@ -2134,10 +2128,10 @@ index 0000000000000000000000000000000000000000..e73bf57a9777488dc00efe671cee955e
+} +}
diff --git a/src/main/java/org/galemc/gale/executor/MinecraftServerBlockableEventLoop.java b/src/main/java/org/galemc/gale/executor/MinecraftServerBlockableEventLoop.java diff --git a/src/main/java/org/galemc/gale/executor/MinecraftServerBlockableEventLoop.java b/src/main/java/org/galemc/gale/executor/MinecraftServerBlockableEventLoop.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..cf7254e2610cd0c04e7ea236a949160cfeeed6a8 index 0000000000000000000000000000000000000000..f249ef5a23e85770db224ed0b6f27598e78c5746
--- /dev/null --- /dev/null
+++ b/src/main/java/org/galemc/gale/executor/MinecraftServerBlockableEventLoop.java +++ b/src/main/java/org/galemc/gale/executor/MinecraftServerBlockableEventLoop.java
@@ -0,0 +1,191 @@ @@ -0,0 +1,188 @@
+// Gale - base thread pools +// Gale - base thread pools
+ +
+package org.galemc.gale.executor; +package org.galemc.gale.executor;
@@ -2218,9 +2212,6 @@ index 0000000000000000000000000000000000000000..cf7254e2610cd0c04e7ea236a949160c
+ @Override + @Override
+ public void tell(@NotNull Runnable message) { + public void tell(@NotNull Runnable message) {
+ ScheduledServerThreadTaskQueues.add(() -> { + ScheduledServerThreadTaskQueues.add(() -> {
+ if (Thread.currentThread() != WatchdogThread.instance) {
+ MinecraftServer.SERVER.getProfiler().incrementCounter("runTask");
+ }
+ //noinspection NonAtomicOperationOnVolatileField + //noinspection NonAtomicOperationOnVolatileField
+ ++reentrantCount; + ++reentrantCount;
+ try { + try {