mirror of
https://github.com/BX-Team/DivineMC.git
synced 2025-12-19 14:59:25 +00:00
79 lines
4.2 KiB
Diff
79 lines
4.2 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 7683f6a99dfac07ae6ab0d9fd42598b4f57907e8..702729d610d090af934f7b95c9e0877d9441df42 100644
|
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
|
@@ -171,8 +171,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
|
public final 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 - Faster redstone torch rapid clock removal; Move from Map in BlockRedstoneTorch to here
|
|
@@ -343,9 +341,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
|
});
|
|
// CraftBukkit end
|
|
this.timings = new co.aikar.timings.WorldTimingsHandler(this); // Paper - code below can generate new world and access timings
|
|
- this.keepSpawnInMemory = this.paperConfig().spawn.keepSpawnLoaded; // Paper - Option to keep spawn chunks loaded
|
|
- this.entityLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.entityMaxTickTime);
|
|
- this.tileLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.tileMaxTickTime);
|
|
+ this.keepSpawnInMemory = this.paperConfig().spawn.keepSpawnLoaded; // Paper - Option to keep spawn chunks loaded // DivineMC - Remove Spigot tick limiter
|
|
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
|
|
// Paper start - optimise collisions
|
|
this.minSection = io.papermc.paper.util.WorldUtil.getMinSection(this);
|
|
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
|
index f9ba24d32f4170c641e420991e6c358f6bd91be2..8b6de4295172dfa7eb33a20a822923e7a4954812 100644
|
|
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
|
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
|
@@ -452,6 +452,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()
|
|
@@ -460,6 +461,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;
|
|
- }
|
|
-}
|