mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-21 16:09:19 +00:00
Updated Upstream (Gale/Purpur/Leaves)
This commit is contained in:
@@ -2,7 +2,7 @@ group = cn.dreeam.leaf
|
||||
mcVersion = 1.21
|
||||
version = 1.21-R0.1-SNAPSHOT
|
||||
|
||||
galeCommit = 563d92dc6a4aa4f85ead0afdfd2181d7578eaddb
|
||||
galeCommit = 067f12d97f0c44b8bb71f7cd1040fdbbf82d39ca
|
||||
|
||||
org.gradle.caching = true
|
||||
org.gradle.parallel = true
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: [PATCH] Purpur API Changes
|
||||
Original license: MIT
|
||||
Original project: https://github.com/PurpurMC/Purpur
|
||||
|
||||
Commit: b3709b1f4d64277182029b176e2c74bd7cfe3e23
|
||||
Commit: 14136b85d13ca7235ad6e53a574aca392406deac
|
||||
|
||||
Patches below are removed in this patch:
|
||||
Pufferfish-API-Changes.patch
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: [PATCH] Purpur generated-api Changes
|
||||
Original license: MIT
|
||||
Original project: https://github.com/PurpurMC/Purpur
|
||||
|
||||
Commit: b3709b1f4d64277182029b176e2c74bd7cfe3e23
|
||||
Commit: 14136b85d13ca7235ad6e53a574aca392406deac
|
||||
|
||||
diff --git a/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/com/destroystokyo/paper/entity/ai/VanillaGoal.java
|
||||
index 3add91218dd3f07052aa932f0503d1f10ac3799b..3e41a4141095bce989c75e989293deb3f47e8e6d 100644
|
||||
|
||||
@@ -150,10 +150,10 @@ index b24265573fdef5d9a964bcd76146f34542c420cf..aa25fd3ee043003f359b2c67a6d0f670
|
||||
|
||||
public SystemReport getSystemReport() {
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 603c50248cf8ea5b1d55cdd1c84c7d49b1c5f8ff..dd5e21e737ebcec7a69ef66908c50a959786b17e 100644
|
||||
index d76d6a3b9ce126d588e5dca0fdc21059914d84f9..63d7678bf7eb847b3340b138a629cc93430d5540 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1018,7 +1018,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1019,7 +1019,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
We do not want people to report thread issues to Paper,
|
||||
but we do want people to report thread issues to Gale.
|
||||
*/
|
||||
@@ -228,10 +228,10 @@ index 3d674eca7d20202d8f811c5c3e3946a12046028a..6fae3dedda0ce742e33040c7b85b5a59
|
||||
|
||||
}
|
||||
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
index ddfdd4db7643fddbc626a525923707d2be980005..bdc4e2e99f0a489aa58f8ccddad75647379c2b3c 100644
|
||||
index 06a7c4b4e327bf8b43b396e561778c74f1d990bd..2dc38d0e7d1ee41f8112a292bce3e427003c823b 100644
|
||||
--- a/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
@@ -24,7 +24,7 @@ public class WatchdogThread extends Thread
|
||||
@@ -96,7 +96,7 @@ public class WatchdogThread extends Thread
|
||||
|
||||
private WatchdogThread(long timeoutTime, boolean restart)
|
||||
{
|
||||
@@ -240,7 +240,7 @@ index ddfdd4db7643fddbc626a525923707d2be980005..bdc4e2e99f0a489aa58f8ccddad75647
|
||||
this.timeoutTime = timeoutTime;
|
||||
this.restart = restart;
|
||||
earlyWarningEvery = Math.min(io.papermc.paper.configuration.GlobalConfiguration.get().watchdog.earlyWarningEvery, timeoutTime); // Paper
|
||||
@@ -88,15 +88,15 @@ public class WatchdogThread extends Thread
|
||||
@@ -160,15 +160,15 @@ public class WatchdogThread extends Thread
|
||||
We do not want people to report thread issues to Paper,
|
||||
but we do want people to report thread issues to Gale.
|
||||
*/
|
||||
@@ -259,7 +259,7 @@ index ddfdd4db7643fddbc626a525923707d2be980005..bdc4e2e99f0a489aa58f8ccddad75647
|
||||
//
|
||||
if ( net.minecraft.world.level.Level.lastPhysicsProblem != null )
|
||||
{
|
||||
@@ -123,13 +123,13 @@ public class WatchdogThread extends Thread
|
||||
@@ -195,13 +195,13 @@ public class WatchdogThread extends Thread
|
||||
We do not want people to report thread issues to Paper,
|
||||
but we do want people to report thread issues to Gale.
|
||||
*/
|
||||
@@ -273,9 +273,9 @@ index ddfdd4db7643fddbc626a525923707d2be980005..bdc4e2e99f0a489aa58f8ccddad75647
|
||||
- log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Gale!):" ); // Paper // Gale - branding changes
|
||||
+ log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Leaf!):" ); // Paper // Gale - branding changes // Leaf
|
||||
ca.spottedleaf.moonrise.patches.chunk_system.scheduling.ChunkTaskScheduler.dumpAllChunkLoadInfo(MinecraftServer.getServer(), isLongTimeout); // Paper - rewrite chunk system
|
||||
this.dumpTickingInfo(); // Paper - log detailed tick information
|
||||
WatchdogThread.dumpThread( ManagementFactory.getThreadMXBean().getThreadInfo( MinecraftServer.getServer().serverThread.getId(), Integer.MAX_VALUE ), log );
|
||||
log.log( Level.SEVERE, "------------------------------" );
|
||||
@@ -149,7 +149,7 @@ public class WatchdogThread extends Thread
|
||||
@@ -222,7 +222,7 @@ public class WatchdogThread extends Thread
|
||||
We do not want people to report thread issues to Paper,
|
||||
but we do want people to report thread issues to Gale.
|
||||
*/
|
||||
|
||||
@@ -41,10 +41,10 @@ index f76ca394169d844a263a53c31c30e57de4381e0d..d2ea951c7e5899d0e2edb52064e35c23
|
||||
DedicatedServerSettings dedicatedserversettings = new DedicatedServerSettings(optionset); // CraftBukkit - CLI argument support
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index dd5e21e737ebcec7a69ef66908c50a959786b17e..2793a1a620fa519e0a7a08c9a1b2ecc77b8a59f4 100644
|
||||
index 63d7678bf7eb847b3340b138a629cc93430d5540..208b9558d9019cd00f7ed270d2a36f9a28464e65 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1230,6 +1230,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1231,6 +1231,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
LOGGER.info("Done ({})! For help, type \"help\"", doneTime);
|
||||
// Paper end
|
||||
|
||||
|
||||
@@ -32,10 +32,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/>.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 8777b99bdf4071f6b91c7a0fa8f2c552428cf777..04b8702ad51e6720b761e98a6fd1a6e463eb25bd 100644
|
||||
index cbe5bd9902fa948a9c928c75961a6525404708b5..ef3d830c08c508cebd158c29ecaba11ad510d354 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -723,6 +723,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -734,6 +734,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
org.spigotmc.ActivationRange.activateEntities(this); // Spigot
|
||||
this.timings.entityTick.startTiming(); // Spigot
|
||||
this.entityTickList.forEach((entity) -> {
|
||||
@@ -44,7 +44,7 @@ index 8777b99bdf4071f6b91c7a0fa8f2c552428cf777..04b8702ad51e6720b761e98a6fd1a6e4
|
||||
if (false && this.shouldDiscardEntity(entity)) { // CraftBukkit - We prevent spawning in general, so this butchering is not needed
|
||||
entity.discard();
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 73b13f630fc22c504b966ee5a96f0162a1af2699..e4081783fb55ee1d804af3947be76d400f2834d4 100644
|
||||
index 092074acfc53d422b92efbe16e492c26f43db1f9..bdd61610c9f1c380a8e5e068a5ad85dea86c26b9 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -431,6 +431,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
|
||||
@@ -8,7 +8,7 @@ TODO - Dreeam: Check Fix-pufferfish-issues.patch
|
||||
Original license: MIT
|
||||
Original project: https://github.com/PurpurMC/Purpur
|
||||
|
||||
Commit: b3709b1f4d64277182029b176e2c74bd7cfe3e23
|
||||
Commit: 14136b85d13ca7235ad6e53a574aca392406deac
|
||||
|
||||
Patches below are removed in this patch:
|
||||
Brand changes in Rebrand.patch
|
||||
@@ -644,7 +644,7 @@ index 44b79a7c2f8b95a484d1999fa2167ce588f7985b..68632372c8704058f35f12e0ae6cdd98
|
||||
// Paper end - Add drops to shear events
|
||||
continue;
|
||||
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
|
||||
index 9bfbbcafce95bfd48d519fc6b0b3ed900c361be7..631c2cb8e4cb3d3f5adfa45398cc1e4818554033 100644
|
||||
index ee4172ab8a0df871f509aeaee8d32f325c148fee..9691bba7715e8fca6be69f883b4940c5447d4df5 100644
|
||||
--- a/src/main/java/net/minecraft/network/Connection.java
|
||||
+++ b/src/main/java/net/minecraft/network/Connection.java
|
||||
@@ -617,11 +617,20 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
@@ -699,7 +699,7 @@ index d2ea951c7e5899d0e2edb52064e35c23965c4230..b929842514a97ca993ead608d355a4af
|
||||
Bootstrap.bootStrap();
|
||||
Bootstrap.validate();
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 2793a1a620fa519e0a7a08c9a1b2ecc77b8a59f4..c816045353920cf927fdf3141ae95318dd868079 100644
|
||||
index 208b9558d9019cd00f7ed270d2a36f9a28464e65..7f12e6fc9ff0c6f0e2659886f2cf1efb117f78d6 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -289,6 +289,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -719,7 +719,7 @@ index 2793a1a620fa519e0a7a08c9a1b2ecc77b8a59f4..c816045353920cf927fdf3141ae95318
|
||||
|
||||
public volatile Thread shutdownThread; // Paper
|
||||
public volatile boolean abnormalExit = false; // Paper
|
||||
@@ -1033,6 +1036,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1034,6 +1037,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
MinecraftServer.LOGGER.info("Stopping server");
|
||||
Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Perf: Async command map building; Shutdown and don't bother finishing
|
||||
MinecraftTimings.stopServer(); // Paper
|
||||
@@ -734,7 +734,7 @@ index 2793a1a620fa519e0a7a08c9a1b2ecc77b8a59f4..c816045353920cf927fdf3141ae95318
|
||||
// CraftBukkit start
|
||||
if (this.server != null) {
|
||||
this.server.disablePlugins();
|
||||
@@ -1128,6 +1139,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1129,6 +1140,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.safeShutdown(waitForShutdown, false);
|
||||
}
|
||||
public void safeShutdown(boolean waitForShutdown, boolean isRestarting) {
|
||||
@@ -743,7 +743,7 @@ index 2793a1a620fa519e0a7a08c9a1b2ecc77b8a59f4..c816045353920cf927fdf3141ae95318
|
||||
this.isRestarting = isRestarting;
|
||||
this.hasLoggedStop = true; // Paper - Debugging
|
||||
if (isDebugging()) io.papermc.paper.util.TraceUtil.dumpTraceForThread("Server stopped"); // Paper - Debugging
|
||||
@@ -1249,6 +1262,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1250,6 +1263,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
// Paper end - Add onboarding message for initial server start
|
||||
|
||||
@@ -760,7 +760,7 @@ index 2793a1a620fa519e0a7a08c9a1b2ecc77b8a59f4..c816045353920cf927fdf3141ae95318
|
||||
while (this.running) {
|
||||
long i;
|
||||
|
||||
@@ -1285,6 +1308,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1286,6 +1309,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.recentTps[0] = tps1.getAverage();
|
||||
this.recentTps[1] = tps5.getAverage();
|
||||
this.recentTps[2] = tps15.getAverage();
|
||||
@@ -768,7 +768,7 @@ index 2793a1a620fa519e0a7a08c9a1b2ecc77b8a59f4..c816045353920cf927fdf3141ae95318
|
||||
tickSection = currentTime;
|
||||
}
|
||||
// Paper end - further improve server tick loop
|
||||
@@ -1309,6 +1333,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1310,6 +1334,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
// Paper end - rewrite chunk system
|
||||
this.mayHaveDelayedTasks = true;
|
||||
this.delayedTasksMaxNextTickTimeNanos = Math.max(Util.getNanos() + i, this.nextTickTimeNanos);
|
||||
@@ -781,7 +781,7 @@ index 2793a1a620fa519e0a7a08c9a1b2ecc77b8a59f4..c816045353920cf927fdf3141ae95318
|
||||
this.startMeasuringTaskExecutionTime();
|
||||
this.waitUntilNextTick();
|
||||
this.finishMeasuringTaskExecutionTime();
|
||||
@@ -1739,7 +1769,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1740,7 +1770,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
long worldTime = level.getGameTime();
|
||||
final ClientboundSetTimePacket worldPacket = new ClientboundSetTimePacket(worldTime, dayTime, doDaylight);
|
||||
for (Player entityhuman : level.players()) {
|
||||
@@ -790,10 +790,10 @@ index 2793a1a620fa519e0a7a08c9a1b2ecc77b8a59f4..c816045353920cf927fdf3141ae95318
|
||||
continue;
|
||||
}
|
||||
ServerPlayer entityplayer = (ServerPlayer) entityhuman;
|
||||
@@ -1759,6 +1789,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - BlockPhysicsEvent
|
||||
@@ -1761,6 +1791,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
worldserver.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - Add EntityMoveEvent
|
||||
net.minecraft.world.level.block.entity.HopperBlockEntity.skipHopperEvents = worldserver.paperConfig().hopper.disableMoveEvent || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper - Perf: Optimize Hoppers
|
||||
worldserver.updateLagCompensationTick(); // Paper - lag compensation
|
||||
+ worldserver.hasRidableMoveEvent = org.purpurmc.purpur.event.entity.RidableMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Purpur
|
||||
|
||||
/* Drop global time updates
|
||||
@@ -1085,7 +1085,7 @@ index 759062d219ff490a3cb19e710c4d18e3e08288e0..8f74c2ec5252b6265549589310d74233
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
index 54d4c648660808692ae998b6f93da90341a394c4..f9d4366ec28a628fc03e93f66efd4d798f10662d 100644
|
||||
index c80be65d190c85e7f0ea8233ebbbdbc1ea67f276..97e793c971614299504605aeb4f99cadbcc2abf0 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
@@ -77,7 +77,7 @@ public class ServerEntity {
|
||||
@@ -1098,7 +1098,7 @@ index 54d4c648660808692ae998b6f93da90341a394c4..f9d4366ec28a628fc03e93f66efd4d79
|
||||
public ServerEntity(ServerLevel worldserver, Entity entity, int i, boolean flag, Consumer<Packet<?>> consumer, Set<ServerPlayerConnection> trackedPlayers) {
|
||||
this.trackedPlayers = trackedPlayers;
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 04b8702ad51e6720b761e98a6fd1a6e463eb25bd..c25d45b5bebca2c1c5fa4b90b07a21fe5e35207d 100644
|
||||
index ef3d830c08c508cebd158c29ecaba11ad510d354..0e97393e90e239628782d52851c55a429bdce771 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -220,6 +220,8 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -1118,7 +1118,7 @@ index 04b8702ad51e6720b761e98a6fd1a6e463eb25bd..c25d45b5bebca2c1c5fa4b90b07a21fe
|
||||
|
||||
public LevelChunk getChunkIfLoaded(int x, int z) {
|
||||
return this.chunkSource.getChunkAtIfLoadedImmediately(x, z); // Paper - Use getChunkIfLoadedImmediately
|
||||
@@ -542,7 +545,24 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -553,7 +556,24 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
this.dragonParts = new Int2ObjectOpenHashMap();
|
||||
this.tickTime = flag1;
|
||||
this.server = minecraftserver;
|
||||
@@ -1144,7 +1144,7 @@ index 04b8702ad51e6720b761e98a6fd1a6e463eb25bd..c25d45b5bebca2c1c5fa4b90b07a21fe
|
||||
this.serverLevelData = iworlddataserver;
|
||||
ChunkGenerator chunkgenerator = worlddimension.generator();
|
||||
// CraftBukkit start
|
||||
@@ -613,6 +633,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -624,6 +644,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
this.chunkTaskScheduler = new ca.spottedleaf.moonrise.patches.chunk_system.scheduling.ChunkTaskScheduler((ServerLevel)(Object)this, ca.spottedleaf.moonrise.common.util.MoonriseCommon.WORKER_POOL);
|
||||
// Paper end - rewrite chunk system
|
||||
this.getCraftServer().addWorld(this.getWorld()); // CraftBukkit
|
||||
@@ -1152,7 +1152,7 @@ index 04b8702ad51e6720b761e98a6fd1a6e463eb25bd..c25d45b5bebca2c1c5fa4b90b07a21fe
|
||||
}
|
||||
|
||||
// Paper start
|
||||
@@ -659,7 +680,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -670,7 +691,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
int i = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE);
|
||||
long j;
|
||||
|
||||
@@ -1161,7 +1161,7 @@ index 04b8702ad51e6720b761e98a6fd1a6e463eb25bd..c25d45b5bebca2c1c5fa4b90b07a21fe
|
||||
// CraftBukkit start
|
||||
j = this.levelData.getDayTime() + 24000L;
|
||||
TimeSkipEvent event = new TimeSkipEvent(this.getWorld(), TimeSkipEvent.SkipReason.NIGHT_SKIP, (j - j % 24000L) - this.getDayTime());
|
||||
@@ -781,6 +802,13 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -792,6 +813,13 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
this.serverLevelData.setGameTime(i);
|
||||
this.serverLevelData.getScheduledEvents().tick(this.server, i);
|
||||
if (this.levelData.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT)) {
|
||||
@@ -1175,7 +1175,7 @@ index 04b8702ad51e6720b761e98a6fd1a6e463eb25bd..c25d45b5bebca2c1c5fa4b90b07a21fe
|
||||
this.setDayTime(this.levelData.getDayTime() + 1L);
|
||||
}
|
||||
|
||||
@@ -789,8 +817,22 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -800,8 +828,22 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
|
||||
public void setDayTime(long timeOfDay) {
|
||||
this.serverLevelData.setDayTime(timeOfDay);
|
||||
@@ -1198,7 +1198,7 @@ index 04b8702ad51e6720b761e98a6fd1a6e463eb25bd..c25d45b5bebca2c1c5fa4b90b07a21fe
|
||||
public void tickCustomSpawners(boolean spawnMonsters, boolean spawnAnimals) {
|
||||
Iterator iterator = this.customSpawners.iterator();
|
||||
|
||||
@@ -834,10 +876,18 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -838,10 +880,18 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
boolean flag1 = this.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.getEffectiveDifficulty() * this.paperConfig().entities.spawning.skeletonHorseThunderSpawnChance.or(0.01D) && !this.getBlockState(blockposition.below()).is(Blocks.LIGHTNING_ROD); // Paper - Configurable spawn chances for skeleton horses
|
||||
|
||||
if (flag1) {
|
||||
@@ -1219,7 +1219,7 @@ index 04b8702ad51e6720b761e98a6fd1a6e463eb25bd..c25d45b5bebca2c1c5fa4b90b07a21fe
|
||||
entityhorseskeleton.setAge(0);
|
||||
entityhorseskeleton.setPos((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ());
|
||||
this.addFreshEntity(entityhorseskeleton, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit
|
||||
@@ -957,7 +1007,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -946,7 +996,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
return holder.is(PoiTypes.LIGHTNING_ROD);
|
||||
}, (blockposition1) -> {
|
||||
return blockposition1.getY() == this.getHeight(Heightmap.Types.WORLD_SURFACE, blockposition1.getX(), blockposition1.getZ()) - 1;
|
||||
@@ -1228,7 +1228,7 @@ index 04b8702ad51e6720b761e98a6fd1a6e463eb25bd..c25d45b5bebca2c1c5fa4b90b07a21fe
|
||||
|
||||
return optional.map((blockposition1) -> {
|
||||
return blockposition1.above(1);
|
||||
@@ -1006,11 +1056,27 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -995,11 +1045,27 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
if (this.canSleepThroughNights()) {
|
||||
if (!this.getServer().isSingleplayer() || this.getServer().isPublished()) {
|
||||
int i = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE);
|
||||
@@ -1257,7 +1257,7 @@ index 04b8702ad51e6720b761e98a6fd1a6e463eb25bd..c25d45b5bebca2c1c5fa4b90b07a21fe
|
||||
ichatmutablecomponent = Component.translatable("sleep.players_sleeping", this.sleepStatus.amountSleeping(), this.sleepStatus.sleepersNeeded(i));
|
||||
}
|
||||
|
||||
@@ -1150,6 +1216,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -1139,6 +1205,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@VisibleForTesting
|
||||
public void resetWeatherCycle() {
|
||||
// CraftBukkit start
|
||||
@@ -1265,7 +1265,7 @@ index 04b8702ad51e6720b761e98a6fd1a6e463eb25bd..c25d45b5bebca2c1c5fa4b90b07a21fe
|
||||
this.serverLevelData.setRaining(false, org.bukkit.event.weather.WeatherChangeEvent.Cause.SLEEP); // Paper - Add cause to Weather/ThunderChangeEvents
|
||||
// If we stop due to everyone sleeping we should reset the weather duration to some other random value.
|
||||
// Not that everyone ever manages to get the whole server to sleep at the same time....
|
||||
@@ -1157,6 +1224,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -1146,6 +1213,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
this.serverLevelData.setRainTime(0);
|
||||
}
|
||||
// CraftBukkit end
|
||||
@@ -1273,7 +1273,7 @@ index 04b8702ad51e6720b761e98a6fd1a6e463eb25bd..c25d45b5bebca2c1c5fa4b90b07a21fe
|
||||
this.serverLevelData.setThundering(false, org.bukkit.event.weather.ThunderChangeEvent.Cause.SLEEP); // Paper - Add cause to Weather/ThunderChangeEvents
|
||||
// CraftBukkit start
|
||||
// If we stop due to everyone sleeping we should reset the weather duration to some other random value.
|
||||
@@ -2541,7 +2609,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -2555,7 +2623,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
// Spigot Start
|
||||
if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message
|
||||
// Paper start - Fix merchant inventory not closing on entity removal
|
||||
@@ -1552,7 +1552,7 @@ index 3993b360455361acf6c49495283285992d71d927..250b23672ff509f9972ad6c91112d161
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
index 24b1715397ba8e6f5e9841a030d0e3d964356f89..89eef5b3c964668e3be53cce6551a6faa8f1cca9 100644
|
||||
index cc01ead133cc6859ca5d7a1d0ac3c12955e590da..7c06b284a6cc74c0b31f8921706c7796dcc4e402 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
@@ -405,6 +405,7 @@ public class ServerPlayerGameMode {
|
||||
@@ -2228,7 +2228,7 @@ index f43bf280999ff3860cc702def50cc62b131eb1bd..66d9e99a351f5fc6cf58be3bee4397d9
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index e8b651e628e8ab2033dbf2ee3eb5d38ff22c9f45..c5758dcfc84610671d4d6d6b6d126b3e4a390265 100644
|
||||
index 109106fb93dd2b05363a1d89d38a9ccf09ae5195..1ee16b9102aea1248f10a41b4bd4cddf5dc12928 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -169,6 +169,7 @@ import org.bukkit.plugin.PluginManager;
|
||||
@@ -2315,7 +2315,7 @@ index e8b651e628e8ab2033dbf2ee3eb5d38ff22c9f45..c5758dcfc84610671d4d6d6b6d126b3e
|
||||
this.onBelowWorld();
|
||||
}
|
||||
|
||||
@@ -1784,7 +1810,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -1867,7 +1893,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
|
||||
public boolean fireImmune() {
|
||||
@@ -2324,7 +2324,7 @@ index e8b651e628e8ab2033dbf2ee3eb5d38ff22c9f45..c5758dcfc84610671d4d6d6b6d126b3e
|
||||
}
|
||||
|
||||
public boolean causeFallDamage(float fallDistance, float damageMultiplier, DamageSource damageSource) {
|
||||
@@ -1857,7 +1883,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -1940,7 +1966,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
return this.isInWater() || flag;
|
||||
}
|
||||
|
||||
@@ -2333,7 +2333,7 @@ index e8b651e628e8ab2033dbf2ee3eb5d38ff22c9f45..c5758dcfc84610671d4d6d6b6d126b3e
|
||||
Entity entity = this.getVehicle();
|
||||
|
||||
if (entity instanceof Boat entityboat) {
|
||||
@@ -2503,6 +2529,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -2586,6 +2612,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
nbttagcompound.putBoolean("Paper.FreezeLock", true);
|
||||
}
|
||||
// Paper end
|
||||
@@ -2345,7 +2345,7 @@ index e8b651e628e8ab2033dbf2ee3eb5d38ff22c9f45..c5758dcfc84610671d4d6d6b6d126b3e
|
||||
return nbttagcompound;
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT");
|
||||
@@ -2650,6 +2681,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -2733,6 +2764,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
freezeLocked = nbt.getBoolean("Paper.FreezeLock");
|
||||
}
|
||||
// Paper end
|
||||
@@ -2357,7 +2357,7 @@ index e8b651e628e8ab2033dbf2ee3eb5d38ff22c9f45..c5758dcfc84610671d4d6d6b6d126b3e
|
||||
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Loading entity NBT");
|
||||
@@ -2811,6 +2847,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -2951,6 +2987,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
if (this.isAlive() && this instanceof Leashable leashable) {
|
||||
if (leashable.getLeashHolder() == player) {
|
||||
if (!this.level().isClientSide()) {
|
||||
@@ -2365,7 +2365,7 @@ index e8b651e628e8ab2033dbf2ee3eb5d38ff22c9f45..c5758dcfc84610671d4d6d6b6d126b3e
|
||||
// CraftBukkit start - fire PlayerUnleashEntityEvent
|
||||
// Paper start - Expand EntityUnleashEvent
|
||||
org.bukkit.event.player.PlayerUnleashEntityEvent event = CraftEventFactory.callPlayerUnleashEntityEvent(this, player, hand, !player.hasInfiniteMaterials());
|
||||
@@ -3014,6 +3051,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -3154,6 +3191,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
this.passengers = ImmutableList.copyOf(list);
|
||||
}
|
||||
|
||||
@@ -2379,7 +2379,7 @@ index e8b651e628e8ab2033dbf2ee3eb5d38ff22c9f45..c5758dcfc84610671d4d6d6b6d126b3e
|
||||
this.gameEvent(GameEvent.ENTITY_MOUNT, passenger);
|
||||
}
|
||||
}
|
||||
@@ -3053,6 +3097,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -3193,6 +3237,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
return false;
|
||||
}
|
||||
// CraftBukkit end
|
||||
@@ -2394,7 +2394,7 @@ index e8b651e628e8ab2033dbf2ee3eb5d38ff22c9f45..c5758dcfc84610671d4d6d6b6d126b3e
|
||||
if (this.passengers.size() == 1 && this.passengers.get(0) == entity) {
|
||||
this.passengers = ImmutableList.of();
|
||||
} else {
|
||||
@@ -3131,13 +3183,16 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -3271,13 +3323,16 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
return Vec3.directionFromRotation(this.getRotationVector());
|
||||
}
|
||||
|
||||
@@ -2411,7 +2411,7 @@ index e8b651e628e8ab2033dbf2ee3eb5d38ff22c9f45..c5758dcfc84610671d4d6d6b6d126b3e
|
||||
} else {
|
||||
this.portalProcess = new PortalProcessor(portal, pos.immutable());
|
||||
}
|
||||
@@ -3345,7 +3400,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -3485,7 +3540,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
|
||||
public int getMaxAirSupply() {
|
||||
@@ -2420,7 +2420,7 @@ index e8b651e628e8ab2033dbf2ee3eb5d38ff22c9f45..c5758dcfc84610671d4d6d6b6d126b3e
|
||||
}
|
||||
|
||||
public int getAirSupply() {
|
||||
@@ -4075,6 +4130,20 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -4215,6 +4270,20 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
return SlotAccess.NULL;
|
||||
}
|
||||
|
||||
@@ -2441,7 +2441,7 @@ index e8b651e628e8ab2033dbf2ee3eb5d38ff22c9f45..c5758dcfc84610671d4d6d6b6d126b3e
|
||||
@Override
|
||||
public void sendSystemMessage(Component message) {}
|
||||
|
||||
@@ -4346,6 +4415,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -4486,6 +4555,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
return Mth.lerp(delta, this.yRotO, this.yRot);
|
||||
}
|
||||
|
||||
@@ -2454,7 +2454,7 @@ index e8b651e628e8ab2033dbf2ee3eb5d38ff22c9f45..c5758dcfc84610671d4d6d6b6d126b3e
|
||||
public boolean updateFluidHeightAndDoFluidPushing(TagKey<Fluid> tag, double speed) {
|
||||
if (false && this.touchingUnloadedChunk()) { // Gale - Airplane - reduce entity fluid lookups if no fluids - cost of a lookup here is the same cost as below, so skip
|
||||
return false;
|
||||
@@ -4753,7 +4828,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -4897,7 +4972,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
|
||||
public float maxUpStep() {
|
||||
@@ -2463,7 +2463,7 @@ index e8b651e628e8ab2033dbf2ee3eb5d38ff22c9f45..c5758dcfc84610671d4d6d6b6d126b3e
|
||||
}
|
||||
|
||||
public void onExplosionHit(@Nullable Entity entity) {}
|
||||
@@ -4945,4 +5020,44 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -5089,4 +5164,44 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
return ((net.minecraft.server.level.ServerChunkCache) level.getChunkSource()).isPositionTicking(this);
|
||||
}
|
||||
// Paper end - Expose entity id counter
|
||||
@@ -2647,7 +2647,7 @@ index 09fdea983772612ef3fff6b2da3cf469a34e4ec0..b69d924fa8034eabbf4aab8d3434f4f4
|
||||
protected ParticleOptions getInkParticle() {
|
||||
return ParticleTypes.GLOW_SQUID_INK;
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 0dc93599a89c58dba6116a2a9f7f0d7f6ed93fbb..c17b50c246e4588160c61cbdd9168bb963730599 100644
|
||||
index da8c5d45f50091946309afa4130f410e40c69a50..65d475803716ea30453ec2397403581def8939fb 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -236,9 +236,9 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -2806,7 +2806,7 @@ index 0dc93599a89c58dba6116a2a9f7f0d7f6ed93fbb..c17b50c246e4588160c61cbdd9168bb9
|
||||
+ // Purpur end
|
||||
+
|
||||
this.noActionTime = 0;
|
||||
float f1 = amount;
|
||||
float f1 = amount; final float originalAmount = f1; // Paper - revert to vanilla #hurt - OBFHELPER
|
||||
boolean flag = amount > 0.0F && this.isDamageSourceBlocked(source); // Copied from below
|
||||
@@ -1521,13 +1571,13 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
if (entity1 instanceof net.minecraft.world.entity.player.Player) {
|
||||
@@ -2974,7 +2974,7 @@ index 0dc93599a89c58dba6116a2a9f7f0d7f6ed93fbb..c17b50c246e4588160c61cbdd9168bb9
|
||||
}
|
||||
|
||||
this.gameEvent(GameEvent.ELYTRA_GLIDE);
|
||||
@@ -4557,6 +4676,12 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -4575,6 +4694,12 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
return EquipmentSlot.MAINHAND;
|
||||
}
|
||||
|
||||
@@ -6262,7 +6262,7 @@ index 3d03ffe2e12eca82dfa2f414471d12bb362d4552..2d04addd17d2c358fff598012b323cd7
|
||||
return "entity.minecraft.tropical_fish.predefined." + variant;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Turtle.java b/src/main/java/net/minecraft/world/entity/animal/Turtle.java
|
||||
index caf4120721be8f2f7e2d737abbf73296cbe170b5..15a8c4e2772e1529204e3892914e49f9a17852aa 100644
|
||||
index 4bfa947531c4a67989e18032754dabf4c69e989c..55d83c57d76e73d73dca1400f4c0c18661d49a94 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Turtle.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Turtle.java
|
||||
@@ -87,6 +87,44 @@ public class Turtle extends Animal {
|
||||
@@ -6308,7 +6308,7 @@ index caf4120721be8f2f7e2d737abbf73296cbe170b5..15a8c4e2772e1529204e3892914e49f9
|
||||
+ }
|
||||
+
|
||||
public void setHomePos(BlockPos pos) {
|
||||
this.entityData.set(Turtle.HOME_POS, pos.immutable()); // Paper - called with mutablepos...
|
||||
this.entityData.set(Turtle.HOME_POS, pos);
|
||||
}
|
||||
@@ -189,6 +227,7 @@ public class Turtle extends Animal {
|
||||
|
||||
@@ -8226,7 +8226,7 @@ index d3b4d492aee380dc17f4232d90eaae4f07bb9f86..a4995d114fd844e0d39726537a2e4076
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
|
||||
index 2f398750bfee5758ad8b1367b6fc14364e4de776..ad1ec2578fa428baa6b172c44b6c17e52daa5792 100644
|
||||
index c292f58ba4b29395484dbbf8591e455f449581d8..c0383771b08e1d89dfa4996b979248da1de8aca1 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
|
||||
@@ -102,10 +102,12 @@ public class ArmorStand extends LivingEntity {
|
||||
@@ -13999,7 +13999,7 @@ index 06497b5141e611cc7a1b6030a7b9c54b5c4eda06..28df1b3230762e52b5458ac93a85c9a5
|
||||
return InteractionResult.PASS;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
index 6a4f9ba317c88a263533ae2c5c71165fc7f56f71..58493186d2fa4917f7eda30d34f634a18fc475f5 100644
|
||||
index fd939864da9f79c56c8cbfa3c521e2d12e6e33cd..cbb97a6f3d8b003e4b90431bbe4ac4c633d50203 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
@@ -497,6 +497,7 @@ public final class ItemStack implements DataComponentHolder {
|
||||
@@ -14045,7 +14045,7 @@ index 6a4f9ba317c88a263533ae2c5c71165fc7f56f71..58493186d2fa4917f7eda30d34f634a1
|
||||
public int getDamageValue() {
|
||||
return Mth.clamp((Integer) this.getOrDefault(DataComponents.DAMAGE, 0), 0, this.getMaxDamage());
|
||||
}
|
||||
@@ -1229,6 +1251,12 @@ public final class ItemStack implements DataComponentHolder {
|
||||
@@ -1231,6 +1253,12 @@ public final class ItemStack implements DataComponentHolder {
|
||||
return !((ItemEnchantments) this.getOrDefault(DataComponents.ENCHANTMENTS, ItemEnchantments.EMPTY)).isEmpty();
|
||||
}
|
||||
|
||||
@@ -14438,10 +14438,10 @@ index f57e1b78204dff661ad5d3ee93a88a00330af2dc..967af8771ff8564c715d89f4b4b69b16
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/EntityGetter.java b/src/main/java/net/minecraft/world/level/EntityGetter.java
|
||||
index 70c2017400168d4fef3c14462798edcfed58d4bf..3c84722c1075290b5301aa5122936d5e4dac3c43 100644
|
||||
index 141b748abe80402731cdaf14a3d36aa7cef4f4bd..d5d2a6467b48bcf8e5322dd5938f6e4fb37ca467 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/EntityGetter.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/EntityGetter.java
|
||||
@@ -153,7 +153,7 @@ public interface EntityGetter extends ca.spottedleaf.moonrise.patches.chunk_syst
|
||||
@@ -187,7 +187,7 @@ public interface EntityGetter extends ca.spottedleaf.moonrise.patches.chunk_syst
|
||||
|
||||
default boolean hasNearbyAlivePlayer(double x, double y, double z, double range) {
|
||||
for (Player player : this.players()) {
|
||||
@@ -14451,10 +14451,10 @@ index 70c2017400168d4fef3c14462798edcfed58d4bf..3c84722c1075290b5301aa5122936d5e
|
||||
if (range < 0.0 || d < range * range) {
|
||||
return true;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||
index 26d5440007db5c820405e4184ededb1ffabf2934..3e2d1f0429a44e1d87319454194be182dea88768 100644
|
||||
index d6e43a9b061a45c8e785ab93bafc8a9721fca7d0..8c79bbd7dde436915f1aeedef1b71379674c8e25 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||
@@ -99,7 +99,7 @@ public class Explosion {
|
||||
@@ -340,7 +340,7 @@ public class Explosion {
|
||||
this.hitPlayers = Maps.newHashMap();
|
||||
this.level = world;
|
||||
this.source = entity;
|
||||
@@ -14463,7 +14463,7 @@ index 26d5440007db5c820405e4184ededb1ffabf2934..3e2d1f0429a44e1d87319454194be182
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
@@ -162,10 +162,29 @@ public class Explosion {
|
||||
@@ -403,10 +403,29 @@ public class Explosion {
|
||||
|
||||
public void explode() {
|
||||
// CraftBukkit start
|
||||
@@ -14492,13 +14492,13 @@ index 26d5440007db5c820405e4184ededb1ffabf2934..3e2d1f0429a44e1d87319454194be182
|
||||
+ //Purpur end
|
||||
+
|
||||
this.level.gameEvent(this.source, (Holder) GameEvent.EXPLODE, new Vec3(this.x, this.y, this.z));
|
||||
Set<BlockPos> set = Sets.newHashSet();
|
||||
boolean flag = true;
|
||||
|
||||
// Paper start - collision optimisations
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 3b94e292881f631656450638592e69b91ae0a39f..2465cc1ea98b48ed8d4564e5f01b1df5c9f9185e 100644
|
||||
index 336c96a331c893a81509672d9898669061d545bb..0d1a3ceae8e7a464bf2adf9c71ad22683aad772b 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -175,6 +175,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -176,6 +176,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
// Gale end - Gale configuration
|
||||
|
||||
public final com.destroystokyo.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray
|
||||
@@ -14506,9 +14506,9 @@ index 3b94e292881f631656450638592e69b91ae0a39f..2465cc1ea98b48ed8d4564e5f01b1df5
|
||||
public final co.aikar.timings.WorldTimingsHandler timings; // Paper
|
||||
public static BlockPos lastPhysicsProblem; // Spigot
|
||||
private org.spigotmc.TickLimiter entityLimiter;
|
||||
@@ -185,6 +186,49 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
|
||||
public final io.papermc.paper.util.math.ThreadUnsafeRandom randomTickRandom = new io.papermc.paper.util.math.ThreadUnsafeRandom(this.random.nextLong()); // Gale - Pufferfish - move random tick random
|
||||
@@ -184,6 +185,49 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
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 - Faster redstone torch rapid clock removal; Move from Map in BlockRedstoneTorch to here
|
||||
|
||||
+ // Purpur start
|
||||
+ private com.google.common.cache.Cache<BreedingCooldownPair, Object> playerBreedingCooldowns;
|
||||
@@ -14556,7 +14556,7 @@ index 3b94e292881f631656450638592e69b91ae0a39f..2465cc1ea98b48ed8d4564e5f01b1df5
|
||||
public CraftWorld getWorld() {
|
||||
return this.world;
|
||||
}
|
||||
@@ -279,6 +323,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -654,6 +698,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
|
||||
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config
|
||||
this.galeConfig = galeWorldConfigCreator.apply(this.spigotConfig); // Gale - Gale configuration
|
||||
@@ -14565,7 +14565,7 @@ index 3b94e292881f631656450638592e69b91ae0a39f..2465cc1ea98b48ed8d4564e5f01b1df5
|
||||
this.generator = gen;
|
||||
this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env);
|
||||
|
||||
@@ -1612,4 +1658,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -1990,4 +2036,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
return null;
|
||||
}
|
||||
// Paper end - optimize redstone (Alternate Current)
|
||||
@@ -14580,7 +14580,7 @@ index 3b94e292881f631656450638592e69b91ae0a39f..2465cc1ea98b48ed8d4564e5f01b1df5
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||
index d0383cef6e204cc806903666d296287e1c530ed3..27fccd091535f7587aaaa1621361dc1835381b89 100644
|
||||
index 7e707fe1d800debf1eef8800fe98eb4e1dbd800b..d490429ddbb8cd82aeda5e03540075c9167b095e 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||
@@ -251,7 +251,7 @@ public final class NaturalSpawner {
|
||||
@@ -14732,10 +14732,10 @@ index 8240c32d676a88aa23dcd052ee0136767e54fb0d..372c4ab9d390d5afd98947f21c79aae0
|
||||
if (i != -1) {
|
||||
world.scheduleTick(blockposition, (Block) this, i);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
index ac0da3d2d1b83dd0fb3db170141a6b105476d8e6..c9c255283dab251de150c65b121919cc827ab02a 100644
|
||||
index 94246e6e05a83758059e933a036558eb47d2e84b..d9afbfb23536e180e2af5658de0bd1d4673f4251 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
@@ -89,6 +89,10 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
@@ -88,6 +88,10 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
public static final int UPDATE_LIMIT = 512;
|
||||
protected final StateDefinition<Block, BlockState> stateDefinition;
|
||||
private BlockState defaultBlockState;
|
||||
@@ -16519,7 +16519,7 @@ index 205e223c356634bd6bc6bd58c6f0b7fda61a6f5f..bea05cb928d540a2f19b51bb7352d032
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
index a768b07dae4bf75b68e3bc1d3de4b68fc7d23842..155a099eb9b0196385947f5765fad4e5c5b74b44 100644
|
||||
index 0f289d8f9bda2fb2ca2cd2dfd667a975529b3e4c..ef2a3ed8e95de4cbbe85803f0146ab3901b26947 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
@@ -85,7 +85,7 @@ public abstract class BlockBehaviour implements FeatureElement {
|
||||
@@ -16722,7 +16722,7 @@ index d86189bd446c7cd7215cfbcef72b2125a064e3d1..53608b9dbb81c58819b9ae6bc676ffb3
|
||||
return stack;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/phys/AABB.java b/src/main/java/net/minecraft/world/phys/AABB.java
|
||||
index c8f7c43134e7c51ce8af5b3c1a28c11db67715a2..5b98889715bf62eb4f15c0b45ada2c701491d324 100644
|
||||
index 29123f3a2f211c08d1a9ccf62ca9bc9822f90111..db78616676ba021ee0f03cfea932f2912f4ec987 100644
|
||||
--- a/src/main/java/net/minecraft/world/phys/AABB.java
|
||||
+++ b/src/main/java/net/minecraft/world/phys/AABB.java
|
||||
@@ -508,4 +508,10 @@ public class AABB {
|
||||
|
||||
@@ -27,7 +27,7 @@ index e94224ed280247ee69dfdff8dc960f2b8729be33..5b9725a9a81c0850dc2809c150529e5f
|
||||
|
||||
for (Component component : formatProviders(spigotPlugins, sender)) { // Purpur
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index c816045353920cf927fdf3141ae95318dd868079..24052ffae73cee9aff1e19bbff43c706f5ece1a6 100644
|
||||
index 7f12e6fc9ff0c6f0e2659886f2cf1efb117f78d6..ff2e76176e0c49aae4115d5c2f764dbf2926e33c 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -300,7 +300,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -39,16 +39,16 @@ index c816045353920cf927fdf3141ae95318dd868079..24052ffae73cee9aff1e19bbff43c706
|
||||
// Spigot end
|
||||
public final io.papermc.paper.configuration.PaperConfigurations paperConfigurations; // Paper - add paper configuration files
|
||||
public final GaleConfigurations galeConfigurations; // Gale - Gale configuration
|
||||
@@ -312,6 +312,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
public volatile Thread shutdownThread; // Paper
|
||||
@@ -313,6 +313,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
public volatile boolean abnormalExit = false; // Paper
|
||||
public static final long SERVER_INIT = System.nanoTime(); // Paper - Lag compensation
|
||||
|
||||
+ //public gg.pufferfish.pufferfish.util.AsyncExecutor mobSpawnExecutor = new gg.pufferfish.pufferfish.util.AsyncExecutor("pufferfish-async-mob-spawning"); // Pufferfish - optimize mob spawning // Leaf - Unify thread name // Dreeam TODO
|
||||
+
|
||||
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
|
||||
AtomicReference<S> atomicreference = new AtomicReference();
|
||||
Thread thread = new io.papermc.paper.util.TickThread(() -> { // Paper - rewrite chunk system
|
||||
@@ -1044,6 +1046,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1045,6 +1047,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
LOGGER.error("[UPnP] Failed to close port {}", this.getPort());
|
||||
}
|
||||
}
|
||||
@@ -56,7 +56,7 @@ index c816045353920cf927fdf3141ae95318dd868079..24052ffae73cee9aff1e19bbff43c706
|
||||
// CraftBukkit start
|
||||
if (this.server != null) {
|
||||
this.server.disablePlugins();
|
||||
@@ -1305,9 +1308,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1306,9 +1309,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
tps15.add(currentTps, diff);
|
||||
|
||||
// Backwards compat with bad plugins
|
||||
@@ -86,10 +86,10 @@ index 096c89bd01cec2abd151bf6fffc4847d1bcd548f..cd0a8a6a1be75cab8bbb8ee3ac17bb73
|
||||
this.values[this.vp++ & 0xFF] = (int)(l * 100L / Runtime.getRuntime().maxMemory());
|
||||
this.repaint();
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
index ed53e5698e2217c7b6847fd8369bff93e7b32f4d..730affea063da4d35e0e11fb88dfdf75fd23a3b0 100644
|
||||
index fe96ee6b36d38a7da61c80715716365d2a33f07d..2474c0b4eec44dda25f389feff7c71cec99d7483 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
@@ -460,7 +460,8 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
@@ -466,7 +466,8 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
this.lastSpawnState = spawnercreature_d;
|
||||
// Gale start - MultiPaper - skip unnecessary mob spawning computations
|
||||
} else {
|
||||
@@ -100,10 +100,10 @@ index ed53e5698e2217c7b6847fd8369bff93e7b32f4d..730affea063da4d35e0e11fb88dfdf75
|
||||
// Gale end - MultiPaper - skip unnecessary mob spawning computations
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index c25d45b5bebca2c1c5fa4b90b07a21fe5e35207d..aa0dd417c13ff490c453098d89c7d9a2aaa489c8 100644
|
||||
index 0e97393e90e239628782d52851c55a429bdce771..cb3e583ae2f5a7619455932ad1d8ee5c9e131ac1 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -680,7 +680,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -691,7 +691,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
int i = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE);
|
||||
long j;
|
||||
|
||||
@@ -113,7 +113,7 @@ index c25d45b5bebca2c1c5fa4b90b07a21fe5e35207d..aa0dd417c13ff490c453098d89c7d9a2
|
||||
j = this.levelData.getDayTime() + 24000L;
|
||||
TimeSkipEvent event = new TimeSkipEvent(this.getWorld(), TimeSkipEvent.SkipReason.NIGHT_SKIP, (j - j % 24000L) - this.getDayTime());
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index c5758dcfc84610671d4d6d6b6d126b3e4a390265..ad52f705caec3c1bac6fd3719f8d3087d239e334 100644
|
||||
index 1ee16b9102aea1248f10a41b4bd4cddf5dc12928..95d246ec3fded53f325bbeb8bf3244576aa9ca04 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -565,13 +565,29 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -159,7 +159,7 @@ index c5758dcfc84610671d4d6d6b6d126b3e4a390265..ad52f705caec3c1bac6fd3719f8d3087
|
||||
}
|
||||
// Pufferfish end - entity TTL
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index c17b50c246e4588160c61cbdd9168bb963730599..1236d18388cac8bc68771a4d1eca792f1d8b2974 100644
|
||||
index 65d475803716ea30453ec2397403581def8939fb..41a2254c5665b1a1ef770fe9f08271136cec2983 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -1044,17 +1044,19 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -260,7 +260,7 @@ index 9419f230910d0338fc4ac6e2e7b749ee7d5ee362..f80af9174e33a2407d12f37575464a27
|
||||
ResourceKey<Level> resourceKey = world.dimension();
|
||||
BlockPos blockPos = entity.blockPosition();
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
|
||||
index ad1ec2578fa428baa6b172c44b6c17e52daa5792..e2ac7e911eb2f46479a9666135894acad0649103 100644
|
||||
index c0383771b08e1d89dfa4996b979248da1de8aca1..3bb46ed871fd56bbbe52cfd2575f9e853e03cd73 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
|
||||
@@ -687,7 +687,7 @@ public class ArmorStand extends LivingEntity {
|
||||
|
||||
@@ -7,10 +7,10 @@ Original license: MIT
|
||||
Original project: https://github.com/PurpurMC/Purpur
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 24052ffae73cee9aff1e19bbff43c706f5ece1a6..c4b931fe03c6e4002d5ad3bc9545c1d17600f847 100644
|
||||
index ff2e76176e0c49aae4115d5c2f764dbf2926e33c..e0ab4b524d5a0d4b3ddaba48b581a90adcfc1833 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1933,7 +1933,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1935,7 +1935,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
@DontObfuscate
|
||||
public String getServerModName() {
|
||||
|
||||
@@ -893,11 +893,11 @@ index 097500a59336db1bbfffcd1aa4cff7a8586e46ec..f06076864582ed153c6154fd7f3e9101
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/network/protocol/PacketUtils.java b/src/main/java/net/minecraft/network/protocol/PacketUtils.java
|
||||
index d0d36a57ec4896bcb74970f8fb24d8f3e17db133..f7197f1347251a37dd0f6d9ffa2f09bc3a4e1233 100644
|
||||
index e2c24813f59c2fd075c740ac1842a38f20ed8554..1f7f68aad97ee73763c042837f239bdc7167db55 100644
|
||||
--- a/src/main/java/net/minecraft/network/protocol/PacketUtils.java
|
||||
+++ b/src/main/java/net/minecraft/network/protocol/PacketUtils.java
|
||||
@@ -31,8 +31,7 @@ public class PacketUtils {
|
||||
engine.executeIfPossible(() -> {
|
||||
@@ -51,8 +51,7 @@ public class PacketUtils {
|
||||
try { // Paper - detailed watchdog information
|
||||
if (listener instanceof ServerCommonPacketListenerImpl serverCommonPacketListener && serverCommonPacketListener.processedDisconnect) return; // CraftBukkit - Don't handle sync packets for kicked players
|
||||
if (listener.shouldHandleMessage(packet)) {
|
||||
- co.aikar.timings.Timing timing = co.aikar.timings.MinecraftTimings.getPacketTiming(packet); // Paper - timings
|
||||
@@ -907,7 +907,7 @@ index d0d36a57ec4896bcb74970f8fb24d8f3e17db133..f7197f1347251a37dd0f6d9ffa2f09bc
|
||||
} catch (Exception exception) {
|
||||
if (exception instanceof ReportedException) {
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index c4b931fe03c6e4002d5ad3bc9545c1d17600f847..c4062c8cb66c862787b98d4ebe66ee22f4cad770 100644
|
||||
index e0ab4b524d5a0d4b3ddaba48b581a90adcfc1833..65d89562f96c20e20649c049370dca0ef3f059b5 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -187,8 +187,6 @@ import org.bukkit.craftbukkit.CraftRegistry;
|
||||
@@ -919,7 +919,7 @@ index c4b931fe03c6e4002d5ad3bc9545c1d17600f847..c4062c8cb66c862787b98d4ebe66ee22
|
||||
public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements ServerInfo, ChunkIOErrorReporter, CommandSource, AutoCloseable, ca.spottedleaf.moonrise.patches.chunk_system.server.ChunkSystemMinecraftServer { // Paper - rewrite chunk system
|
||||
|
||||
public static final int SERVER_THREAD_PRIORITY = Integer.getInteger("gale.thread.priority.server", -1); // Gale - server thread priority environment variable
|
||||
@@ -1037,7 +1035,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1038,7 +1036,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
MinecraftServer.LOGGER.info("Stopping server");
|
||||
Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Perf: Async command map building; Shutdown and don't bother finishing
|
||||
@@ -927,7 +927,7 @@ index c4b931fe03c6e4002d5ad3bc9545c1d17600f847..c4062c8cb66c862787b98d4ebe66ee22
|
||||
// Purpur start
|
||||
if (upnp) {
|
||||
if (dev.omega24.upnp4j.UPnP4J.close(this.getPort(), dev.omega24.upnp4j.util.Protocol.TCP)) {
|
||||
@@ -1498,7 +1495,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1499,7 +1496,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
|
||||
protected void waitUntilNextTick() {
|
||||
@@ -935,7 +935,7 @@ index c4b931fe03c6e4002d5ad3bc9545c1d17600f847..c4062c8cb66c862787b98d4ebe66ee22
|
||||
long tickOversleepStart = System.nanoTime(); // Gale - YAPFA - last tick time
|
||||
this.managedBlock(() -> {
|
||||
return !this.canSleepForTickNoOversleep(); // Paper - move oversleep into full server tick
|
||||
@@ -1610,15 +1606,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1611,15 +1607,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
|
||||
public void tickServer(BooleanSupplier shouldKeepTicking) {
|
||||
@@ -953,7 +953,7 @@ index c4b931fe03c6e4002d5ad3bc9545c1d17600f847..c4062c8cb66c862787b98d4ebe66ee22
|
||||
// Paper end
|
||||
new com.destroystokyo.paper.event.server.ServerTickStartEvent(this.tickCount+1).callEvent(); // Paper - Server Tick Events
|
||||
|
||||
@@ -1640,11 +1635,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1641,11 +1636,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
MinecraftServer.LOGGER.debug("Autosave finished");
|
||||
}
|
||||
io.papermc.paper.util.CachedLists.reset(); // Paper
|
||||
@@ -966,7 +966,7 @@ index c4b931fe03c6e4002d5ad3bc9545c1d17600f847..c4062c8cb66c862787b98d4ebe66ee22
|
||||
// Paper start - Server Tick Events
|
||||
long endTime = System.nanoTime();
|
||||
long remaining = (TICK_TIME - (endTime - lastTick)) - catchupTime;
|
||||
@@ -1664,7 +1655,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1665,7 +1656,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
// Paper end - Add tick times API and /mspt command
|
||||
this.logTickMethodTime(i);
|
||||
org.spigotmc.WatchdogThread.tick(); // Spigot
|
||||
@@ -974,7 +974,7 @@ index c4b931fe03c6e4002d5ad3bc9545c1d17600f847..c4062c8cb66c862787b98d4ebe66ee22
|
||||
}
|
||||
|
||||
private void logTickMethodTime(long tickStartTime) {
|
||||
@@ -1735,9 +1725,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1736,9 +1726,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.getPlayerList().getPlayers().forEach((entityplayer) -> {
|
||||
entityplayer.connection.suspendFlushing();
|
||||
});
|
||||
@@ -984,7 +984,7 @@ index c4b931fe03c6e4002d5ad3bc9545c1d17600f847..c4062c8cb66c862787b98d4ebe66ee22
|
||||
// Paper start - Folia scheduler API
|
||||
((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick();
|
||||
getAllLevels().forEach(level -> {
|
||||
@@ -1753,20 +1741,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1754,20 +1742,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
});
|
||||
// Paper end - Folia scheduler API
|
||||
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.CALLBACK_MANAGER.handleQueue(this.tickCount); // Paper
|
||||
@@ -1005,7 +1005,7 @@ index c4b931fe03c6e4002d5ad3bc9545c1d17600f847..c4062c8cb66c862787b98d4ebe66ee22
|
||||
// Send time updates to everyone, it will get the right time from the world the player is in.
|
||||
// Paper start - Perf: Optimize time updates
|
||||
for (final ServerLevel level : this.getAllLevels()) {
|
||||
@@ -1786,7 +1769,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1787,7 +1770,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
}
|
||||
// Paper end - Perf: Optimize time updates
|
||||
@@ -1013,7 +1013,7 @@ index c4b931fe03c6e4002d5ad3bc9545c1d17600f847..c4062c8cb66c862787b98d4ebe66ee22
|
||||
|
||||
this.isIteratingOverLevels = true; // Paper - Throw exception on world create while being ticked
|
||||
Iterator iterator = this.getAllLevels().iterator(); // Paper - Throw exception on world create while being ticked; move down
|
||||
@@ -1804,9 +1786,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1806,9 +1788,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
// CraftBukkit end */
|
||||
|
||||
try {
|
||||
@@ -1023,7 +1023,7 @@ index c4b931fe03c6e4002d5ad3bc9545c1d17600f847..c4062c8cb66c862787b98d4ebe66ee22
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Exception ticking world");
|
||||
|
||||
@@ -1818,21 +1798,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1820,21 +1800,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
this.isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
|
||||
|
||||
@@ -1136,7 +1136,7 @@ index 3af290825bbbc461354c6d76b61a0ebf8c8a3ee7..138bb26241ce67d1dd8447a7f1c737ba
|
||||
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
index 730affea063da4d35e0e11fb88dfdf75fd23a3b0..32a615f4d1098963c4e22a2e3ed5ae4ce31d74b8 100644
|
||||
index 2474c0b4eec44dda25f389feff7c71cec99d7483..6216eded6cbe3c98c706f3a51b379e023df1f044 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
@@ -356,9 +356,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
@@ -1149,7 +1149,7 @@ index 730affea063da4d35e0e11fb88dfdf75fd23a3b0..32a615f4d1098963c4e22a2e3ed5ae4c
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -382,24 +380,18 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
@@ -389,24 +387,18 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
|
||||
@Override
|
||||
public void tick(BooleanSupplier shouldKeepTicking, boolean tickChunks) {
|
||||
@@ -1174,7 +1174,7 @@ index 730affea063da4d35e0e11fb88dfdf75fd23a3b0..32a615f4d1098963c4e22a2e3ed5ae4c
|
||||
this.clearCache();
|
||||
}
|
||||
|
||||
@@ -412,7 +404,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
@@ -419,7 +411,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
if (!this.level.isDebug()) {
|
||||
List<ServerChunkCache.ChunkAndHolder> list = Lists.newArrayListWithCapacity(this.chunkMap.size());
|
||||
Iterator iterator = this.chunkMap.getChunks().iterator();
|
||||
@@ -1182,7 +1182,7 @@ index 730affea063da4d35e0e11fb88dfdf75fd23a3b0..32a615f4d1098963c4e22a2e3ed5ae4c
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
ChunkHolder playerchunk = (ChunkHolder) iterator.next();
|
||||
@@ -431,7 +422,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
@@ -437,7 +428,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
boolean flagAndHasNaturalSpawn = flag && this.anySpawnCategoryIsSpawnedThisTick();
|
||||
if (flagAndHasNaturalSpawn) {
|
||||
// Gale end - MultiPaper - skip unnecessary mob spawning computations
|
||||
@@ -1190,7 +1190,7 @@ index 730affea063da4d35e0e11fb88dfdf75fd23a3b0..32a615f4d1098963c4e22a2e3ed5ae4c
|
||||
int k = this.distanceManager.getNaturalSpawnChunkCount();
|
||||
// Paper start - Optional per player mob spawns
|
||||
int naturalSpawnChunkCount = k;
|
||||
@@ -455,7 +445,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
@@ -461,7 +451,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
spawnercreature_d = NaturalSpawner.createState(naturalSpawnChunkCount, this.level.getAllEntities(), this::getFullChunk, !this.level.paperConfig().entities.spawning.perPlayerMobSpawns ? new LocalMobCapCalculator(this.chunkMap) : null, false);
|
||||
}
|
||||
// Paper end - Optional per player mob spawns
|
||||
@@ -1198,7 +1198,7 @@ index 730affea063da4d35e0e11fb88dfdf75fd23a3b0..32a615f4d1098963c4e22a2e3ed5ae4c
|
||||
|
||||
this.lastSpawnState = spawnercreature_d;
|
||||
// Gale start - MultiPaper - skip unnecessary mob spawning computations
|
||||
@@ -500,19 +489,14 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
@@ -506,19 +495,14 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1219,7 +1219,7 @@ index 730affea063da4d35e0e11fb88dfdf75fd23a3b0..32a615f4d1098963c4e22a2e3ed5ae4c
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index aa0dd417c13ff490c453098d89c7d9a2aaa489c8..65b1e9a62e8a0b950ba0828dc9fca02c69fc132d 100644
|
||||
index cb3e583ae2f5a7619455932ad1d8ee5c9e131ac1..86af09319462b58f2ec97caf7a1033b2a3ae961d 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1,7 +1,6 @@
|
||||
@@ -1230,7 +1230,7 @@ index aa0dd417c13ff490c453098d89c7d9a2aaa489c8..65b1e9a62e8a0b950ba0828dc9fca02c
|
||||
import com.google.common.collect.Lists;
|
||||
import com.mojang.datafixers.DataFixer;
|
||||
import com.mojang.datafixers.util.Pair;
|
||||
@@ -705,27 +704,19 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -716,27 +715,19 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
this.tickTime();
|
||||
}
|
||||
|
||||
@@ -1258,7 +1258,7 @@ index aa0dd417c13ff490c453098d89c7d9a2aaa489c8..65b1e9a62e8a0b950ba0828dc9fca02c
|
||||
}
|
||||
|
||||
this.handlingTick = false;
|
||||
@@ -736,13 +727,11 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -747,13 +738,11 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
}
|
||||
|
||||
if (flag1 || this.emptyTime++ < 300) {
|
||||
@@ -1272,7 +1272,7 @@ index aa0dd417c13ff490c453098d89c7d9a2aaa489c8..65b1e9a62e8a0b950ba0828dc9fca02c
|
||||
this.entityTickList.forEach((entity) -> {
|
||||
entity.activatedPriorityReset = false; // Pufferfish - DAB
|
||||
if (!entity.isRemoved()) {
|
||||
@@ -779,8 +768,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -790,8 +779,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -1281,27 +1281,27 @@ index aa0dd417c13ff490c453098d89c7d9a2aaa489c8..65b1e9a62e8a0b950ba0828dc9fca02c
|
||||
this.tickBlockEntities();
|
||||
}
|
||||
|
||||
@@ -915,7 +902,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -916,7 +903,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
}
|
||||
} // Paper - Option to disable ice and snow
|
||||
|
||||
- timings.chunkTicksBlocks.startTiming(); // Paper
|
||||
if (randomTickSpeed > 0) {
|
||||
// Paper start - optimize random block ticking
|
||||
LevelChunkSection[] sections = chunk.getSections();
|
||||
@@ -948,8 +934,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
LevelChunkSection[] achunksection = chunk.getSections();
|
||||
|
||||
@@ -946,8 +932,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
}
|
||||
}
|
||||
}
|
||||
// Paper end - optimise random block ticking
|
||||
-
|
||||
- timings.chunkTicksBlocks.stopTiming(); // Paper
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
@@ -1268,31 +1252,21 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -1276,31 +1260,21 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
currentlyTickingEntity.lazySet(entity);
|
||||
}
|
||||
|
||||
public void tickNonPassenger(Entity entity) {
|
||||
// Paper end - log detailed entity tick information
|
||||
- ++TimingHistory.entityTicks; // Paper - timings
|
||||
// Spigot start
|
||||
- co.aikar.timings.Timing timer; // Paper
|
||||
@@ -1330,16 +1330,7 @@ index aa0dd417c13ff490c453098d89c7d9a2aaa489c8..65b1e9a62e8a0b950ba0828dc9fca02c
|
||||
Iterator iterator = entity.getPassengers().iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -1300,8 +1274,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
|
||||
this.tickPassenger(entity, entity1);
|
||||
}
|
||||
- // } finally { timer.stopTiming(); } // Paper - timings - move up
|
||||
-
|
||||
}
|
||||
|
||||
private void tickPassenger(Entity vehicle, Entity passenger) {
|
||||
@@ -1309,9 +1281,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -1323,9 +1297,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
if (passenger instanceof Player || this.entityTickList.contains(passenger)) {
|
||||
// Paper - EAR 2
|
||||
final boolean isActive = org.spigotmc.ActivationRange.checkIfActive(passenger);
|
||||
@@ -1349,7 +1340,7 @@ index aa0dd417c13ff490c453098d89c7d9a2aaa489c8..65b1e9a62e8a0b950ba0828dc9fca02c
|
||||
passenger.setOldPosAndRot();
|
||||
++passenger.tickCount;
|
||||
|
||||
@@ -1333,8 +1302,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -1347,8 +1318,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
|
||||
this.tickPassenger(passenger, entity2);
|
||||
}
|
||||
@@ -1358,7 +1349,7 @@ index aa0dd417c13ff490c453098d89c7d9a2aaa489c8..65b1e9a62e8a0b950ba0828dc9fca02c
|
||||
}
|
||||
} else {
|
||||
passenger.stopRiding();
|
||||
@@ -1356,7 +1323,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -1370,7 +1339,6 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
|
||||
if (!savingDisabled) {
|
||||
org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(this.getWorld())); // CraftBukkit
|
||||
@@ -1366,7 +1357,7 @@ index aa0dd417c13ff490c453098d89c7d9a2aaa489c8..65b1e9a62e8a0b950ba0828dc9fca02c
|
||||
if (progressListener != null) {
|
||||
progressListener.progressStartNoAbort(Component.translatable("menu.savingLevel"));
|
||||
}
|
||||
@@ -1366,10 +1332,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -1380,10 +1348,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
progressListener.progressStage(Component.translatable("menu.savingChunks"));
|
||||
}
|
||||
|
||||
@@ -1541,10 +1532,10 @@ index 85b4b24361e785acf75571ff98f924c00ae80748..ac67dd7a30616fe70f73426e332972b7
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 2465cc1ea98b48ed8d4564e5f01b1df5c9f9185e..61d2244031e4cf3116683acc88b0d84b5acf52cb 100644
|
||||
index 0d1a3ceae8e7a464bf2adf9c71ad22683aad772b..d6cce299882833452ada600ddd2e164312442143 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -176,7 +176,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -177,7 +177,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
|
||||
public final com.destroystokyo.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray
|
||||
public final org.purpurmc.purpur.PurpurWorldConfig purpurConfig; // Purpur
|
||||
@@ -1552,7 +1543,7 @@ index 2465cc1ea98b48ed8d4564e5f01b1df5c9f9185e..61d2244031e4cf3116683acc88b0d84b
|
||||
public static BlockPos lastPhysicsProblem; // Spigot
|
||||
private org.spigotmc.TickLimiter entityLimiter;
|
||||
private org.spigotmc.TickLimiter tileLimiter;
|
||||
@@ -407,7 +406,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -782,7 +781,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
public void onBorderSetDamageSafeZOne(WorldBorder border, double safeZoneRadius) {}
|
||||
});
|
||||
// CraftBukkit end
|
||||
@@ -1560,7 +1551,7 @@ index 2465cc1ea98b48ed8d4564e5f01b1df5c9f9185e..61d2244031e4cf3116683acc88b0d84b
|
||||
this.entityLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.entityMaxTickTime);
|
||||
this.tileLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.tileMaxTickTime);
|
||||
this.entityLookup = new ca.spottedleaf.moonrise.patches.chunk_system.level.entity.dfl.DefaultEntityLookup(this); // Paper - rewrite chunk system
|
||||
@@ -1006,15 +1004,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -1385,15 +1383,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
}
|
||||
|
||||
protected void tickBlockEntities() {
|
||||
@@ -1576,7 +1567,7 @@ index 2465cc1ea98b48ed8d4564e5f01b1df5c9f9185e..61d2244031e4cf3116683acc88b0d84b
|
||||
// Spigot start
|
||||
// Iterator<TickingBlockEntity> iterator = this.blockEntityTickers.iterator();
|
||||
boolean flag = this.tickRateManager().runsNormally();
|
||||
@@ -1045,9 +1040,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -1424,9 +1419,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
}
|
||||
this.blockEntityTickers.removeAll(toRemove); // Paper - Fix MC-117075
|
||||
|
||||
@@ -1587,7 +1578,7 @@ index 2465cc1ea98b48ed8d4564e5f01b1df5c9f9185e..61d2244031e4cf3116683acc88b0d84b
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||
index 27fccd091535f7587aaaa1621361dc1835381b89..885d7c9ef96dd3c7576c28606e5ab83d2a75de71 100644
|
||||
index d490429ddbb8cd82aeda5e03540075c9167b095e..d556089907bb695a9d87df1961ef0b0ae4382cad 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||
@@ -127,7 +127,6 @@ public final class NaturalSpawner {
|
||||
@@ -1608,7 +1599,7 @@ index 27fccd091535f7587aaaa1621361dc1835381b89..885d7c9ef96dd3c7576c28606e5ab83d
|
||||
|
||||
// Paper start - Add mobcaps commands
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
index c9c255283dab251de150c65b121919cc827ab02a..7248b72430d5ff047e3150a57f26592b76e99fa5 100644
|
||||
index d9afbfb23536e180e2af5658de0bd1d4673f4251..64f96850cad67c64c9c71b2c5d1cc68d2db4fafc 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
@@ -107,13 +107,6 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
@@ -1645,10 +1636,10 @@ index cd0e43f4c53a746dd6183a8406269f9b11ad3571..54657ac895fb2fa9c58910d5421f0082
|
||||
private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry();
|
||||
public CraftPersistentDataContainer persistentDataContainer;
|
||||
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 f15b81fd738825543eecf6eb4afc007fe828090d..873bc6b74b631982eb9ff2e7ce64fe8cfe6d5503 100644
|
||||
index b07763aa7b3b92e24891b4ba346334ba8984ed67..db16be7db9d1df323f150dfd6f3d893b79d79838 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
@@ -635,7 +635,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
@@ -644,7 +644,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemServerLevel)this.level).moonrise$getChunkTaskScheduler().chunkHolderManager.getChunkHolder(this.locX, this.locZ).getEntityChunk().callEntitiesLoadEvent(); // Paper - rewrite chunk system
|
||||
|
||||
if (this.needsDecoration) {
|
||||
@@ -1656,7 +1647,7 @@ index f15b81fd738825543eecf6eb4afc007fe828090d..873bc6b74b631982eb9ff2e7ce64fe8c
|
||||
this.needsDecoration = false;
|
||||
java.util.Random random = new java.util.Random();
|
||||
random.setSeed(this.level.getSeed());
|
||||
@@ -655,7 +654,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
@@ -664,7 +663,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
}
|
||||
}
|
||||
server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkPopulateEvent(bukkitChunk));
|
||||
@@ -1664,7 +1655,7 @@ index f15b81fd738825543eecf6eb4afc007fe828090d..873bc6b74b631982eb9ff2e7ce64fe8c
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -992,7 +990,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
@@ -1001,7 +999,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
|
||||
if (LevelChunk.this.isTicking(blockposition)) {
|
||||
try {
|
||||
@@ -1672,7 +1663,7 @@ index f15b81fd738825543eecf6eb4afc007fe828090d..873bc6b74b631982eb9ff2e7ce64fe8c
|
||||
BlockState iblockdata = LevelChunk.this.getBlockState(blockposition);
|
||||
|
||||
if (this.blockEntity.getType().isValid(iblockdata)) {
|
||||
@@ -1015,14 +1012,9 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
@@ -1024,14 +1021,9 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
net.minecraft.world.level.chunk.LevelChunk.this.level.getCraftServer().getPluginManager().callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerInternalException(msg, throwable))); // Paper - ServerExceptionEvent
|
||||
LevelChunk.this.removeBlockEntity(this.getPos());
|
||||
// Paper end - Prevent block entity and entity crashes
|
||||
|
||||
@@ -9,7 +9,7 @@ and change store way to sql maybe?
|
||||
Original license: GPLv3
|
||||
Original project: https://github.com/LeavesMC/Leaves
|
||||
|
||||
Commit: eb7eadd0a0f5e4020df690898ba21a0bbb983957
|
||||
Commit: a872cd0de5ea02a7abf6174842b7ba4b530bb025
|
||||
|
||||
diff --git a/src/main/java/org/leavesmc/leaves/LeavesLogger.java b/src/main/java/org/leavesmc/leaves/LeavesLogger.java
|
||||
new file mode 100644
|
||||
|
||||
@@ -51,10 +51,10 @@ index 1967c43ee3a12e63365cc40ee6565307e2fd73cf..6e376d0db5321d8e9b6e0b54617ffd17
|
||||
|
||||
assert isValidPath(path);
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index c4062c8cb66c862787b98d4ebe66ee22f4cad770..c28be00e390be74322744e9a3581ee0ef7849670 100644
|
||||
index 65d89562f96c20e20649c049370dca0ef3f059b5..36940bc192088233842d8fa7a37b84657552ceff 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1804,6 +1804,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1806,6 +1806,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
GameTestTicker.SINGLETON.tick();
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ index a74732902c0494c67e6acf2fc04581ff9c46b832..8b60c922750e71f526976782a1f156e9
|
||||
LivingEntity entityliving1 = deadEntity.getLastHurtByMob();
|
||||
|
||||
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 873bc6b74b631982eb9ff2e7ce64fe8cfe6d5503..353f33b9562f87498ba6d0e303774c67bcf56189 100644
|
||||
index db16be7db9d1df323f150dfd6f3d893b79d79838..a71d4b363eec79c55267d97549c5c8715459b95e 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
@@ -81,7 +81,18 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
@@ -61,7 +61,7 @@ index 873bc6b74b631982eb9ff2e7ce64fe8cfe6d5503..353f33b9562f87498ba6d0e303774c67
|
||||
private final LevelChunkTicks<Block> blockTicks;
|
||||
private final LevelChunkTicks<Fluid> fluidTicks;
|
||||
|
||||
@@ -105,7 +116,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
@@ -93,7 +104,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
super(pos, upgradeData, world, net.minecraft.server.MinecraftServer.getServer().registryAccess().registryOrThrow(Registries.BIOME), inhabitedTime, sectionArrayInitializer, blendingData); // Paper - Anti-Xray - The world isn't ready yet, use server singleton for registry
|
||||
this.tickersInLevel = Maps.newHashMap();
|
||||
this.level = (ServerLevel) world; // CraftBukkit - type
|
||||
@@ -70,7 +70,7 @@ index 873bc6b74b631982eb9ff2e7ce64fe8cfe6d5503..353f33b9562f87498ba6d0e303774c67
|
||||
Heightmap.Types[] aheightmap_type = Heightmap.Types.values();
|
||||
int j = aheightmap_type.length;
|
||||
|
||||
@@ -210,9 +221,23 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
@@ -219,9 +230,23 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
Level world = this.level;
|
||||
|
||||
if (world instanceof ServerLevel worldserver) {
|
||||
@@ -97,7 +97,7 @@ index 873bc6b74b631982eb9ff2e7ce64fe8cfe6d5503..353f33b9562f87498ba6d0e303774c67
|
||||
} else {
|
||||
return super.getListenerRegistry(ySectionCoord);
|
||||
}
|
||||
@@ -596,7 +621,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
@@ -605,7 +630,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
|
||||
}
|
||||
|
||||
private void removeGameEventListenerRegistry(int ySectionCoord) {
|
||||
|
||||
@@ -7,10 +7,10 @@ Co-authored by: Martijn Muijsers <martijnmuijsers@live.nl>
|
||||
Co-authored by: MachineBreaker <machinebreaker>
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 61d2244031e4cf3116683acc88b0d84b5acf52cb..0d7ee7ab6cf9f91a46a03d8741917282fe2b966f 100644
|
||||
index d6cce299882833452ada600ddd2e164312442143..3c01a14e08d6a401692cefef42796aaf89519889 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -431,17 +431,19 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -810,17 +810,19 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
for (int i = 0, len = entities.size(); i < len; ++i) {
|
||||
Entity entity = entities.get(i);
|
||||
|
||||
@@ -36,7 +36,7 @@ index 61d2244031e4cf3116683acc88b0d84b5acf52cb..0d7ee7ab6cf9f91a46a03d8741917282
|
||||
if (net.minecraft.world.phys.shapes.Shapes.joinIsNotEmpty(voxelshape, net.minecraft.world.phys.shapes.Shapes.create(entity.getBoundingBox()), net.minecraft.world.phys.shapes.BooleanOp.AND)) {
|
||||
return false;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index cf85b3af38258fa34e8f67d1f002a521cc59c81b..14b3069756c6e317ad10e75116973e4059c3ac21 100644
|
||||
index 9325d2c676899fcedc360ea9183339c91af026dc..56c02c4e6ad55cc5757f1b227189ada513b2d560 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -638,6 +638,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
||||
@@ -22,10 +22,10 @@ index 9c6f5b55b1f1376fa75e216cd366ee47c79fafc4..7762c8186035fdf60e11d9f1844516b6
|
||||
static RandomSource createThreadSafe() {
|
||||
return new ThreadSafeLegacyRandomSource(RandomSupport.generateUniqueSeed());
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 0d7ee7ab6cf9f91a46a03d8741917282fe2b966f..e3c7627e69679d50c3b288d9993f02ba57079b29 100644
|
||||
index 3c01a14e08d6a401692cefef42796aaf89519889..562d0d4f7d253be10f1804f0d5d668d5c0f4bf2f 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -127,6 +127,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -128,6 +128,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
protected float oThunderLevel;
|
||||
public float thunderLevel;
|
||||
public final RandomSource random = RandomSource.create();
|
||||
@@ -34,27 +34,25 @@ index 0d7ee7ab6cf9f91a46a03d8741917282fe2b966f..e3c7627e69679d50c3b288d9993f02ba
|
||||
@Deprecated
|
||||
private final RandomSource threadSafeRandom = RandomSource.createThreadSafe();
|
||||
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||
index 885d7c9ef96dd3c7576c28606e5ab83d2a75de71..455e7958ddec5f6c2f3090aa3d6994385e9482bc 100644
|
||||
index d556089907bb695a9d87df1961ef0b0ae4382cad..66244a2dd3e32ab4fd61f7a42243f967eb7f268d 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||
@@ -405,12 +405,14 @@ public final class NaturalSpawner {
|
||||
@@ -405,10 +405,12 @@ public final class NaturalSpawner {
|
||||
|
||||
private static BlockPos getRandomPosWithin(ServerLevel world, LevelChunk chunk) { // Gale - Airplane - Use ThreadUnsafeRandom for mob spawning - accept ServerLevel
|
||||
private static BlockPos getRandomPosWithin(Level world, LevelChunk chunk) {
|
||||
ChunkPos chunkcoordintpair = chunk.getPos();
|
||||
- int i = chunkcoordintpair.getMinBlockX() + world.random.nextInt(16);
|
||||
- int j = chunkcoordintpair.getMinBlockZ() + world.random.nextInt(16);
|
||||
+ // Leaf start - Generate random seed faster
|
||||
// Gale start - Airplane - Use ThreadUnsafeRandom for mob spawning - use ThreadUnsafeRandom
|
||||
- int i = chunkcoordintpair.getMinBlockX() + world.randomTickRandom.nextInt(16);
|
||||
- int j = chunkcoordintpair.getMinBlockZ() + world.randomTickRandom.nextInt(16);
|
||||
+ int i = chunkcoordintpair.getMinBlockX() + world.randomFaster.nextInt(16);
|
||||
+ int j = chunkcoordintpair.getMinBlockZ() + world.randomFaster.nextInt(16);
|
||||
// Gale end - Airplane - Use ThreadUnsafeRandom for mob spawning - use ThreadUnsafeRandom
|
||||
int k = chunk.getHeight(Heightmap.Types.WORLD_SURFACE, i, j) + 1;
|
||||
- int l = Mth.randomBetweenInclusive(world.randomTickRandom, world.getMinBuildHeight(), k); // Gale - Airplane - Use ThreadUnsafeRandom for mob spawning - use ThreadUnsafeRandom
|
||||
+ int l = Mth.randomBetweenInclusive(world.randomFaster, world.getMinBuildHeight(), k); // Gale - Airplane - Use ThreadUnsafeRandom for mob spawning - use ThreadUnsafeRandom
|
||||
- int l = Mth.randomBetweenInclusive(world.random, world.getMinBuildHeight(), k);
|
||||
+ int l = Mth.randomBetweenInclusive(world.randomFaster, world.getMinBuildHeight(), k);
|
||||
+ // Leaf end - Generate random seed faster
|
||||
|
||||
return new BlockPos(i, l, j);
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/levelgen/RandomSupport.java b/src/main/java/net/minecraft/world/level/levelgen/RandomSupport.java
|
||||
index 4327bee689e986561d126d6018d3fee7d2623176..267a28724ea0aea926c51c37e1172a2c34b47375 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/levelgen/RandomSupport.java
|
||||
|
||||
@@ -16,10 +16,10 @@ now is just updating dirty map/decoration data.
|
||||
When no bukkit renderers are added to the map, we also re-use the same packet for all players who are tracking it which avoids a lot of work.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
index f9d4366ec28a628fc03e93f66efd4d798f10662d..7fdc90245ab93bc9910b224ceed74820f6e7b5dd 100644
|
||||
index 97e793c971614299504605aeb4f99cadbcc2abf0..8721a93e184354727b439c794ce0aea5321b6675 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
@@ -119,27 +119,40 @@ public class ServerEntity {
|
||||
@@ -124,27 +124,40 @@ public class ServerEntity {
|
||||
|
||||
Entity entity = this.entity;
|
||||
|
||||
@@ -65,7 +65,7 @@ index f9d4366ec28a628fc03e93f66efd4d798f10662d..7fdc90245ab93bc9910b224ceed74820
|
||||
}
|
||||
}
|
||||
|
||||
@@ -380,6 +393,19 @@ public class ServerEntity {
|
||||
@@ -385,6 +398,19 @@ public class ServerEntity {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,10 +11,10 @@ The "distanceToSqr" call is a bit expensive, so avoiding it is pretty nice, arou
|
||||
We could also check if the x,y,z coordinates are equal, but for now, let's just keep the identity check, which also helps us since Minecraft's code does reuse the original delta movement Vec3 object
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
index 7fdc90245ab93bc9910b224ceed74820f6e7b5dd..e3efedd0e474867b4e1330c63b1b89320d0ad9af 100644
|
||||
index 8721a93e184354727b439c794ce0aea5321b6675..573c380e123473e35c0b72c44b32c8d6ba8e61c6 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
@@ -226,6 +226,7 @@ public class ServerEntity {
|
||||
@@ -231,6 +231,7 @@ public class ServerEntity {
|
||||
|
||||
if ((this.trackDelta || this.entity.hasImpulse || this.entity instanceof LivingEntity && ((LivingEntity) this.entity).isFallFlying()) && this.tickCount > 0) {
|
||||
Vec3 vec3d1 = this.entity.getDeltaMovement();
|
||||
@@ -22,7 +22,7 @@ index 7fdc90245ab93bc9910b224ceed74820f6e7b5dd..e3efedd0e474867b4e1330c63b1b8932
|
||||
double d0 = vec3d1.distanceToSqr(this.lastSentMovement);
|
||||
|
||||
if (d0 > 1.0E-7D || d0 > 0.0D && vec3d1.lengthSqr() == 0.0D) {
|
||||
@@ -240,6 +241,7 @@ public class ServerEntity {
|
||||
@@ -245,6 +246,7 @@ public class ServerEntity {
|
||||
this.broadcast.accept(new ClientboundSetEntityMotionPacket(this.entity.getId(), this.lastSentMovement));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,18 +75,18 @@ index 62484ebf4550b05182f693a3180bbac5d5fd906d..67800e426445060a8343e27a7452b8d7
|
||||
throw new IllegalStateException("Ticking retired scheduler");
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index c28be00e390be74322744e9a3581ee0ef7849670..e69f94d2a2d11373e44872bbee3986da5727db69 100644
|
||||
index 36940bc192088233842d8fa7a37b84657552ceff..a6f1365bb72e9598ed2101b60d8774d236fd48e1 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -311,6 +311,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
public volatile boolean abnormalExit = false; // Paper
|
||||
@@ -312,6 +312,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
public static final long SERVER_INIT = System.nanoTime(); // Paper - Lag compensation
|
||||
|
||||
//public gg.pufferfish.pufferfish.util.AsyncExecutor mobSpawnExecutor = new gg.pufferfish.pufferfish.util.AsyncExecutor("pufferfish-async-mob-spawning"); // Pufferfish - optimize mob spawning // Leaf - Unify thread name // Dreeam TODO
|
||||
+ public final Set<Entity> entitiesWithScheduledTasks = java.util.concurrent.ConcurrentHashMap.newKeySet(); // SparklyPaper - skip EntityScheduler's executeTick checks if there isn't any tasks to be run (concurrent because plugins may schedule tasks async)
|
||||
|
||||
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
|
||||
AtomicReference<S> atomicreference = new AtomicReference();
|
||||
@@ -1728,6 +1729,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1729,6 +1730,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.server.getScheduler().mainThreadHeartbeat(this.tickCount); // CraftBukkit
|
||||
// Paper start - Folia scheduler API
|
||||
((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick();
|
||||
@@ -105,7 +105,7 @@ index c28be00e390be74322744e9a3581ee0ef7849670..e69f94d2a2d11373e44872bbee3986da
|
||||
getAllLevels().forEach(level -> {
|
||||
for (final Entity entity : level.moonrise$getEntityLookup().getAllCopy()) { // Paper - rewrite chunk system
|
||||
if (entity.isRemoved()) {
|
||||
@@ -1739,6 +1752,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1740,6 +1753,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Fix MC-2025
|
||||
Mojang issues: https://bugs.mojang.com/browse/MC-2025
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index ad52f705caec3c1bac6fd3719f8d3087d239e334..690f935aacb4b96d0f5d932cc7b9edf1b0b15e8b 100644
|
||||
index 95d246ec3fded53f325bbeb8bf3244576aa9ca04..777290653fe1c3ea83f53b9d6595642f51200642 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -2550,6 +2550,16 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -2633,6 +2633,16 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
nbttagcompound.putBoolean("Purpur.FireImmune", immuneToFire);
|
||||
}
|
||||
// Purpur end
|
||||
@@ -26,7 +26,7 @@ index ad52f705caec3c1bac6fd3719f8d3087d239e334..690f935aacb4b96d0f5d932cc7b9edf1
|
||||
return nbttagcompound;
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT");
|
||||
@@ -2627,6 +2637,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -2710,6 +2720,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
this.reapplyPosition();
|
||||
}
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Remove stream in BlockBehaviour cache blockstate
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
index 155a099eb9b0196385947f5765fad4e5c5b74b44..8b46772221cd60691a6cc4f6b691bdfe94e78608 100644
|
||||
index ef2a3ed8e95de4cbbe85803f0146ab3901b26947..4120d015f82b6a2ff4ac2c72dfca11da1e8037cb 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
@@ -1302,7 +1302,7 @@ public abstract class BlockBehaviour implements FeatureElement {
|
||||
@@ -1390,7 +1390,7 @@ public abstract class BlockBehaviour implements FeatureElement {
|
||||
@Nullable
|
||||
final VoxelShape[] occlusionShapes;
|
||||
protected final VoxelShape collisionShape;
|
||||
@@ -17,7 +17,7 @@ index 155a099eb9b0196385947f5765fad4e5c5b74b44..8b46772221cd60691a6cc4f6b691bdfe
|
||||
private final boolean[] faceSturdy;
|
||||
protected final boolean isCollisionShapeFullBlock;
|
||||
|
||||
@@ -1334,9 +1334,14 @@ public abstract class BlockBehaviour implements FeatureElement {
|
||||
@@ -1422,9 +1422,14 @@ public abstract class BlockBehaviour implements FeatureElement {
|
||||
if (!this.collisionShape.isEmpty() && state.hasOffsetFunction()) {
|
||||
throw new IllegalStateException(String.format(Locale.ROOT, "%s has a collision shape and an offset type, but is not marked as dynamicShape in its properties.", BuiltInRegistries.BLOCK.getKey(block)));
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user