9
0
mirror of https://github.com/BX-Team/DivineMC.git synced 2025-12-23 08:49:18 +00:00
Files
DivineMC/patches/server/0010-Remove-Spigot-tick-limiter.patch
NONPLAYT 9f5ecf4072 Updated Upstream (Purpur)
Upstream has released updates that appear to apply and compile correctly

Purpur Changes:
PurpurMC/Purpur@991719a Updated Upstream (Paper)
PurpurMC/Purpur@ffab9f8 stop spawned wither skulls from saving to disk, not withers
PurpurMC/Purpur@d22455b move anonymous overrides into witherskull class
PurpurMC/Purpur@625e4ad remove rainglow patch in favor of paper plugin impl
2023-06-21 21:05:51 +03:00

77 lines
3.9 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Fri, 31 Mar 2023 23:05:12 +0300
Subject: [PATCH] Remove Spigot tick limiter
Original code by Titaniumtown, modified by NONPLAYT
You can find the original code on https://gitlab.com/Titaniumtown/JettPack
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index de4a7223c672953c5d02d222638af7f9dcd602aa..7700383d188835f6ac47c75e084abc3524f1f221 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -182,8 +182,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public final gq.bxteam.divinemc.configuration.DivineWorldConfig divinemcConfig; // DivineMC
public final co.aikar.timings.WorldTimingsHandler timings; // Paper
public static BlockPos lastPhysicsProblem; // Spigot
- private org.spigotmc.TickLimiter entityLimiter;
- private org.spigotmc.TickLimiter tileLimiter;
private int tileTickPosition;
public final Map<Explosion.CacheKey, Float> explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions
public java.util.ArrayDeque<net.minecraft.world.level.block.RedstoneTorchBlock.Toggle> redstoneUpdateInfos; // Paper - Move from Map in BlockRedstoneTorch to here
@@ -425,8 +423,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// CraftBukkit end
timings = new co.aikar.timings.WorldTimingsHandler(this); // Paper - code below can generate new world and access timings
this.keepSpawnInMemory = this.paperConfig().spawn.keepSpawnLoaded; // Paper
- this.entityLimiter = new org.spigotmc.TickLimiter(spigotConfig.entityMaxTickTime);
- this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime);
this.chunkPacketBlockController = this.paperConfig().anticheat.antiXray.enabled ? new com.destroystokyo.paper.antixray.ChunkPacketBlockControllerAntiXray(this, executor) : com.destroystokyo.paper.antixray.ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray
}
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index 389bcb5e01d66f8e3915e09a49aace5176012191..d5271bc912632e694a10897717460893a1badf04 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -450,6 +450,7 @@ public class SpigotWorldConfig
this.hangingTickFrequency = this.getInt( "hanging-tick-frequency", 200 ); // DivineMC - optimize default values for configs
}
+ /* DivineMC - remove tick limiter
public int tileMaxTickTime;
public int entityMaxTickTime;
private void maxTickTimes()
@@ -458,6 +459,7 @@ public class SpigotWorldConfig
this.entityMaxTickTime = this.getInt("max-tick-time.entity", 50);
this.log("Tile Max Tick Time: " + this.tileMaxTickTime + "ms Entity max Tick Time: " + this.entityMaxTickTime + "ms");
}
+ */
public int thunderChance;
private void thunderChance()
diff --git a/src/main/java/org/spigotmc/TickLimiter.java b/src/main/java/org/spigotmc/TickLimiter.java
deleted file mode 100644
index 4074538ea6090bf99d8ab04b1e98c2832a0e9a98..0000000000000000000000000000000000000000
--- a/src/main/java/org/spigotmc/TickLimiter.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.spigotmc;
-
-public class TickLimiter {
-
- private final int maxTime;
- private long startTime;
-
- public TickLimiter(int maxtime) {
- this.maxTime = maxtime;
- }
-
- public void initTick() {
- this.startTime = System.currentTimeMillis();
- }
-
- public boolean shouldContinue() {
- long remaining = System.currentTimeMillis() - this.startTime;
- return remaining < this.maxTime;
- }
-}