mirror of
https://github.com/BX-Team/DivineMC.git
synced 2025-12-22 08:19:19 +00:00
Upstream has released updates that appear to apply and compile correctly Purpur Changes: PurpurMC/Purpur@85e34e5 Updated Upstream (Paper) PurpurMC/Purpur@ff80cf5 Updated Upstream (Paper)
77 lines
4.0 KiB
Diff
77 lines
4.0 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 4ed2a063f21ae4bb840e5ec1f84e04221f753ca0..96c6195713127f41b4f60f9ed0d99543e3f147d2 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
|
|
@@ -346,8 +344,6 @@ 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
|
|
- this.entityLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.entityMaxTickTime);
|
|
- this.tileLimiter = new org.spigotmc.TickLimiter(this.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
|
|
// 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 12358c08e0e90d8d01db25534c6d5c4e726191dc..0bfdd15c71ed2fa866b6d4f201dd87b14e2a2f89 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;
|
|
- }
|
|
-}
|