refactor: Deprecate tick limiter API for public use

This commit is contained in:
NotMyFault 2022-01-04 20:33:05 +01:00
parent 42dacfc7ef
commit b8399abfe1
No known key found for this signature in database
GPG Key ID: 158F5701A6AAD00C
3 changed files with 39 additions and 0 deletions

View File

@ -45,6 +45,11 @@ import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginManager;
import org.bukkit.util.Vector;
/**
* @deprecated FAWE is not necessarily the tool you want to use to limit certain tick actions, e.g. fireworks or elytra flying.
* The code is untouched since the 1.12 era and there is no guarantee that it will work or will be maintained in the future.
*/
@Deprecated(since = "2.0.0")
public abstract class ChunkListener implements Listener {
private static final Logger LOGGER = LogManagerCompat.getLogger();
@ -88,7 +93,15 @@ public abstract class ChunkListener implements Listener {
protected abstract StackTraceElement getElement(Exception ex, int index);
/**
* @deprecated see {@link com.fastasyncworldedit.bukkit.listener.ChunkListener} for an explanation of the deprecation
*/
@Deprecated(since = "2.0.0")
public static boolean physicsFreeze = false;
/**
* @deprecated see {@link com.fastasyncworldedit.bukkit.listener.ChunkListener} for an explanation of the deprecation
*/
@Deprecated(since = "2.0.0")
public static boolean itemFreeze = false;
protected final Long2ObjectOpenHashMap<Boolean> badChunks = new Long2ObjectOpenHashMap<>();
@ -97,6 +110,10 @@ public abstract class ChunkListener implements Listener {
private int lastZ = Integer.MIN_VALUE;
private int[] lastCount;
/**
* @deprecated see {@link com.fastasyncworldedit.bukkit.listener.ChunkListener} for an explanation of the deprecation
*/
@Deprecated(since = "2.0.0")
public int[] getCount(int cx, int cz) {
if (lastX == cx && lastZ == cz) {
return lastCount;
@ -112,6 +129,10 @@ public abstract class ChunkListener implements Listener {
return tmp;
}
/**
* @deprecated see {@link com.fastasyncworldedit.bukkit.listener.ChunkListener} for an explanation of the deprecation
*/
@Deprecated(since = "2.0.0")
public void cleanup(Chunk chunk) {
for (Entity entity : chunk.getEntities()) {
if (entity.getType() == EntityType.DROPPED_ITEM) {
@ -128,6 +149,10 @@ public abstract class ChunkListener implements Listener {
protected long physStart;
protected long physTick;
/**
* @deprecated see {@link com.fastasyncworldedit.bukkit.listener.ChunkListener} for an explanation of the deprecation
*/
@Deprecated(since = "2.0.0")
public final void reset() {
physSkip = 0;
physStart = System.currentTimeMillis();

View File

@ -9,11 +9,20 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.block.BlockPhysicsEvent;
/**
* @deprecated FAWE is not necessarily the tool you want to use to limit certain tick actions, e.g. fireworks or elytra flying.
* The code is untouched since the 1.12 era and there is no guarantee that it will work or will be maintained in the future.
*/
@Deprecated(since = "2.0.0")
public class ChunkListener9 extends ChunkListener {
private Exception exception;
private StackTraceElement[] elements;
/**
* @deprecated see {@link com.fastasyncworldedit.bukkit.listener.ChunkListener9} for an explanation of the deprecation
*/
@Deprecated(since = "2.0.0")
public ChunkListener9() {
super();
}

View File

@ -672,6 +672,11 @@ public class Settings extends Config {
}
/**
* @deprecated FAWE is not necessarily the tool you want to use to limit certain tick actions, e.g. fireworks or elytra flying.
* The code is untouched since the 1.12 era and there is no guarantee that it will work or will be maintained in the future.
*/
@Deprecated(since = "2.0.0")
@Comment("Generic tick limiter (not necessarily WorldEdit related, but useful to stop abuse)")
public static class TICK_LIMITER {