mirror of
https://github.com/BX-Team/DivineMC.git
synced 2025-12-19 14:59:25 +00:00
Upstream has released updates that appear to apply and compile correctly Purpur Changes: PurpurMC/Purpur@5b26bab8 Updated Upstream (Paper) PurpurMC/Purpur@8734844b sigh...
51 lines
3.1 KiB
Diff
51 lines
3.1 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
|
|
Date: Sat, 1 Feb 2025 19:14:09 +0300
|
|
Subject: [PATCH] Skip EntityScheduler's executeTick checks if there isn't any
|
|
tasks to be run
|
|
|
|
Original project: https://github.com/SparklyPower/SparklyPaper
|
|
Removed due to moonrise already implemented feature like this
|
|
|
|
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
|
index 70b33e54d8384709b166ca57cd114632e357f24f..89f9c2c3661f1ef951d865bd8c81564ea558c1e2 100644
|
|
--- a/net/minecraft/server/MinecraftServer.java
|
|
+++ b/net/minecraft/server/MinecraftServer.java
|
|
@@ -289,6 +289,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
public boolean lagging = false; // Purpur - Lagging threshold
|
|
protected boolean upnp = false; // Purpur - UPnP Port Forwarding
|
|
public final org.bxteam.divinemc.util.tps.TPSCalculator tpsCalculator = new org.bxteam.divinemc.util.tps.TPSCalculator(); // DivineMC - Lag compensation
|
|
+ public final Set<net.minecraft.world.entity.Entity> entitiesWithScheduledTasks = java.util.concurrent.ConcurrentHashMap.newKeySet(); // DivineMC - Skip EntityScheduler's executeTick checks if there isn't any tasks to be run
|
|
|
|
public static <S extends MinecraftServer> S spin(Function<Thread, S> threadFunction) {
|
|
ca.spottedleaf.dataconverter.minecraft.datatypes.MCTypeRegistry.init(); // Paper - rewrite data converter system
|
|
@@ -1662,17 +1663,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
this.server.getScheduler().mainThreadHeartbeat(); // CraftBukkit
|
|
// Paper start - Folia scheduler API
|
|
((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) org.bukkit.Bukkit.getGlobalRegionScheduler()).tick();
|
|
- getAllLevels().forEach(level -> {
|
|
- for (final net.minecraft.world.entity.Entity entity : level.getEntities().getAll()) {
|
|
- if (entity.isRemoved()) {
|
|
- continue;
|
|
- }
|
|
- final org.bukkit.craftbukkit.entity.CraftEntity bukkit = entity.getBukkitEntityRaw();
|
|
- if (bukkit != null) {
|
|
- bukkit.taskScheduler.executeTick();
|
|
- }
|
|
+ // DivineMC start - Skip EntityScheduler's executeTick checks if there isn't any tasks to be run
|
|
+ for (final net.minecraft.world.entity.Entity entity : entitiesWithScheduledTasks) {
|
|
+ if (entity.isRemoved()) {
|
|
+ continue;
|
|
}
|
|
- });
|
|
+
|
|
+ final org.bukkit.craftbukkit.entity.CraftEntity bukkit = entity.getBukkitEntityRaw();
|
|
+ if (bukkit != null) {
|
|
+ bukkit.taskScheduler.executeTick();
|
|
+ }
|
|
+ }
|
|
+ // DivineMC end - Skip EntityScheduler's executeTick checks if there isn't any tasks to be run
|
|
// Paper end - Folia scheduler API
|
|
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.CALLBACK_MANAGER.handleQueue(this.tickCount); // Paper
|
|
this.getFunctions().tick();
|