|
|
|
|
@@ -736,7 +736,7 @@ index 199789d56d22fcb1b77ebd56805cc28aa5a5ab0a..00000000000000000000000000000000
|
|
|
|
|
-}
|
|
|
|
|
diff --git a/src/main/java/co/aikar/timings/TimingHistory.java b/src/main/java/co/aikar/timings/TimingHistory.java
|
|
|
|
|
deleted file mode 100644
|
|
|
|
|
index 6f6eb1a2e6c8d49014a7ae44540ee282bae5200e..0000000000000000000000000000000000000000
|
|
|
|
|
index c8287776ad585d04fb4fa3290cd73d7097035ea0..0000000000000000000000000000000000000000
|
|
|
|
|
--- a/src/main/java/co/aikar/timings/TimingHistory.java
|
|
|
|
|
+++ /dev/null
|
|
|
|
|
@@ -1,357 +0,0 @@
|
|
|
|
|
@@ -1031,7 +1031,7 @@ index 6f6eb1a2e6c8d49014a7ae44540ee282bae5200e..00000000000000000000000000000000
|
|
|
|
|
- final TicksRecord ticksRecord = new TicksRecord();
|
|
|
|
|
- final PingRecord pingRecord = new PingRecord();
|
|
|
|
|
- final TimingData fst = TimingsManager.FULL_SERVER_TICK.minuteData.clone();
|
|
|
|
|
- final double tps = 1E9 / ( System.nanoTime() - lastMinuteTime ) * ticksRecord.timed;
|
|
|
|
|
- final double tps = 1E9 / (System.nanoTime() - lastMinuteTime) * ticksRecord.timed;
|
|
|
|
|
- final double usedMemory = TimingsManager.FULL_SERVER_TICK.avgUsedMemory;
|
|
|
|
|
- final double freeMemory = TimingsManager.FULL_SERVER_TICK.avgFreeMemory;
|
|
|
|
|
- final double loadAvg = ManagementFactory.getOperatingSystemMXBean().getSystemLoadAverage();
|
|
|
|
|
@@ -1753,7 +1753,7 @@ index 04d0dc27406e9f96224f88edb1c535176e84d395..00000000000000000000000000000000
|
|
|
|
|
-}
|
|
|
|
|
diff --git a/src/main/java/co/aikar/timings/TimingsManager.java b/src/main/java/co/aikar/timings/TimingsManager.java
|
|
|
|
|
deleted file mode 100644
|
|
|
|
|
index e72ad05abada04426e32a73d02b21cb69079d268..0000000000000000000000000000000000000000
|
|
|
|
|
index 83a70358e9b7d3d9ae76cf130915b3c33d09a793..0000000000000000000000000000000000000000
|
|
|
|
|
--- a/src/main/java/co/aikar/timings/TimingsManager.java
|
|
|
|
|
+++ /dev/null
|
|
|
|
|
@@ -1,192 +0,0 @@
|
|
|
|
|
@@ -1912,7 +1912,7 @@ index e72ad05abada04426e32a73d02b21cb69079d268..00000000000000000000000000000000
|
|
|
|
|
- public static Timing getCommandTiming(@Nullable String pluginName, @NotNull Command command) {
|
|
|
|
|
- Plugin plugin = null;
|
|
|
|
|
- final Server server = Bukkit.getServer();
|
|
|
|
|
- if (!( server == null || pluginName == null ||
|
|
|
|
|
- if (!(server == null || pluginName == null ||
|
|
|
|
|
- "minecraft".equals(pluginName) || "bukkit".equals(pluginName) ||
|
|
|
|
|
- "spigot".equalsIgnoreCase(pluginName) || "paper".equals(pluginName)
|
|
|
|
|
- )) {
|
|
|
|
|
@@ -2104,6 +2104,774 @@ index 632c4961515f5052551f841cfa840e60bba7a257..00000000000000000000000000000000
|
|
|
|
|
- super.stopTiming();
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
diff --git a/src/main/java/co/aikar/util/Counter.java b/src/main/java/co/aikar/util/Counter.java
|
|
|
|
|
deleted file mode 100644
|
|
|
|
|
index dae84243804b4b076cafb3e1b29bdcf614efc93f..0000000000000000000000000000000000000000
|
|
|
|
|
--- a/src/main/java/co/aikar/util/Counter.java
|
|
|
|
|
+++ /dev/null
|
|
|
|
|
@@ -1,39 +0,0 @@
|
|
|
|
|
-package co.aikar.util;
|
|
|
|
|
-
|
|
|
|
|
-import com.google.common.collect.ForwardingMap;
|
|
|
|
|
-
|
|
|
|
|
-import java.util.HashMap;
|
|
|
|
|
-import java.util.Map;
|
|
|
|
|
-import org.jetbrains.annotations.NotNull;
|
|
|
|
|
-import org.jetbrains.annotations.Nullable;
|
|
|
|
|
-
|
|
|
|
|
-@Deprecated(forRemoval = true)
|
|
|
|
|
-public class Counter <T> extends ForwardingMap<T, Long> {
|
|
|
|
|
- private final Map<T, Long> counts = new HashMap<>();
|
|
|
|
|
-
|
|
|
|
|
- public long decrement(@Nullable T key) {
|
|
|
|
|
- return increment(key, -1);
|
|
|
|
|
- }
|
|
|
|
|
- public long increment(@Nullable T key) {
|
|
|
|
|
- return increment(key, 1);
|
|
|
|
|
- }
|
|
|
|
|
- public long decrement(@Nullable T key, long amount) {
|
|
|
|
|
- return increment(key, -amount);
|
|
|
|
|
- }
|
|
|
|
|
- public long increment(@Nullable T key, long amount) {
|
|
|
|
|
- Long count = this.getCount(key);
|
|
|
|
|
- count += amount;
|
|
|
|
|
- this.counts.put(key, count);
|
|
|
|
|
- return count;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public long getCount(@Nullable T key) {
|
|
|
|
|
- return this.counts.getOrDefault(key, 0L);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @NotNull
|
|
|
|
|
- @Override
|
|
|
|
|
- protected Map<T, Long> delegate() {
|
|
|
|
|
- return this.counts;
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
diff --git a/src/main/java/co/aikar/util/JSONUtil.java b/src/main/java/co/aikar/util/JSONUtil.java
|
|
|
|
|
deleted file mode 100644
|
|
|
|
|
index c105a1429ca58b37be265708ec345e00f0d43ed8..0000000000000000000000000000000000000000
|
|
|
|
|
--- a/src/main/java/co/aikar/util/JSONUtil.java
|
|
|
|
|
+++ /dev/null
|
|
|
|
|
@@ -1,141 +0,0 @@
|
|
|
|
|
-package co.aikar.util;
|
|
|
|
|
-
|
|
|
|
|
-import com.google.common.base.Function;
|
|
|
|
|
-import com.google.common.collect.Lists;
|
|
|
|
|
-import com.google.common.collect.Maps;
|
|
|
|
|
-import org.jetbrains.annotations.NotNull;
|
|
|
|
|
-import org.jetbrains.annotations.Nullable;
|
|
|
|
|
-import org.json.simple.JSONArray;
|
|
|
|
|
-import org.json.simple.JSONObject;
|
|
|
|
|
-
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
|
|
-import java.util.LinkedHashMap;
|
|
|
|
|
-import java.util.List;
|
|
|
|
|
-import java.util.Map;
|
|
|
|
|
-
|
|
|
|
|
-/**
|
|
|
|
|
- * Provides Utility methods that assist with generating JSON Objects
|
|
|
|
|
- */
|
|
|
|
|
-@SuppressWarnings({"rawtypes", "SuppressionAnnotation"})
|
|
|
|
|
-@Deprecated(forRemoval = true)
|
|
|
|
|
-public final class JSONUtil {
|
|
|
|
|
- private JSONUtil() {}
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Creates a key/value "JSONPair" object
|
|
|
|
|
- *
|
|
|
|
|
- * @param key Key to use
|
|
|
|
|
- * @param obj Value to use
|
|
|
|
|
- * @return JSONPair
|
|
|
|
|
- */
|
|
|
|
|
- @NotNull
|
|
|
|
|
- public static JSONPair pair(@NotNull String key, @Nullable Object obj) {
|
|
|
|
|
- return new JSONPair(key, obj);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @NotNull
|
|
|
|
|
- public static JSONPair pair(long key, @Nullable Object obj) {
|
|
|
|
|
- return new JSONPair(String.valueOf(key), obj);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Creates a new JSON object from multiple JSONPair key/value pairs
|
|
|
|
|
- *
|
|
|
|
|
- * @param data JSONPairs
|
|
|
|
|
- * @return Map
|
|
|
|
|
- */
|
|
|
|
|
- @NotNull
|
|
|
|
|
- public static Map<String, Object> createObject(@NotNull JSONPair... data) {
|
|
|
|
|
- return appendObjectData(new LinkedHashMap(), data);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * This appends multiple key/value Obj pairs into a JSON Object
|
|
|
|
|
- *
|
|
|
|
|
- * @param parent Map to be appended to
|
|
|
|
|
- * @param data Data to append
|
|
|
|
|
- * @return Map
|
|
|
|
|
- */
|
|
|
|
|
- @NotNull
|
|
|
|
|
- public static Map<String, Object> appendObjectData(@NotNull Map parent, @NotNull JSONPair... data) {
|
|
|
|
|
- for (JSONPair JSONPair : data) {
|
|
|
|
|
- parent.put(JSONPair.key, JSONPair.val);
|
|
|
|
|
- }
|
|
|
|
|
- return parent;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * This builds a JSON array from a set of data
|
|
|
|
|
- *
|
|
|
|
|
- * @param data Data to build JSON array from
|
|
|
|
|
- * @return List
|
|
|
|
|
- */
|
|
|
|
|
- @NotNull
|
|
|
|
|
- public static List toArray(@NotNull Object... data) {
|
|
|
|
|
- return Lists.newArrayList(data);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * These help build a single JSON array using a mapper function
|
|
|
|
|
- *
|
|
|
|
|
- * @param collection Collection to apply to
|
|
|
|
|
- * @param mapper Mapper to apply
|
|
|
|
|
- * @param <E> Element Type
|
|
|
|
|
- * @return List
|
|
|
|
|
- */
|
|
|
|
|
- @NotNull
|
|
|
|
|
- public static <E> List toArrayMapper(@NotNull E[] collection, @NotNull Function<E, Object> mapper) {
|
|
|
|
|
- return toArrayMapper(Lists.newArrayList(collection), mapper);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @NotNull
|
|
|
|
|
- public static <E> List toArrayMapper(@NotNull Iterable<E> collection, @NotNull Function<E, Object> mapper) {
|
|
|
|
|
- List array = Lists.newArrayList();
|
|
|
|
|
- for (E e : collection) {
|
|
|
|
|
- Object object = mapper.apply(e);
|
|
|
|
|
- if (object != null) {
|
|
|
|
|
- array.add(object);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- return array;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * These help build a single JSON Object from a collection, using a mapper function
|
|
|
|
|
- *
|
|
|
|
|
- * @param collection Collection to apply to
|
|
|
|
|
- * @param mapper Mapper to apply
|
|
|
|
|
- * @param <E> Element Type
|
|
|
|
|
- * @return Map
|
|
|
|
|
- */
|
|
|
|
|
- @NotNull
|
|
|
|
|
- public static <E> Map toObjectMapper(@NotNull E[] collection, @NotNull Function<E, JSONPair> mapper) {
|
|
|
|
|
- return toObjectMapper(Lists.newArrayList(collection), mapper);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @NotNull
|
|
|
|
|
- public static <E> Map toObjectMapper(@NotNull Iterable<E> collection, @NotNull Function<E, JSONPair> mapper) {
|
|
|
|
|
- Map object = Maps.newLinkedHashMap();
|
|
|
|
|
- for (E e : collection) {
|
|
|
|
|
- JSONPair JSONPair = mapper.apply(e);
|
|
|
|
|
- if (JSONPair != null) {
|
|
|
|
|
- object.put(JSONPair.key, JSONPair.val);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- return object;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Simply stores a key and a value, used internally by many methods below.
|
|
|
|
|
- */
|
|
|
|
|
- @SuppressWarnings("PublicInnerClass")
|
|
|
|
|
- public static class JSONPair {
|
|
|
|
|
- final String key;
|
|
|
|
|
- final Object val;
|
|
|
|
|
-
|
|
|
|
|
- JSONPair(@NotNull String key, @NotNull Object val) {
|
|
|
|
|
- this.key = key;
|
|
|
|
|
- this.val = val;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
diff --git a/src/main/java/co/aikar/util/LoadingIntMap.java b/src/main/java/co/aikar/util/LoadingIntMap.java
|
|
|
|
|
deleted file mode 100644
|
|
|
|
|
index 5753b9bce89db2ac378ec41f1b61907cc2e23335..0000000000000000000000000000000000000000
|
|
|
|
|
--- a/src/main/java/co/aikar/util/LoadingIntMap.java
|
|
|
|
|
+++ /dev/null
|
|
|
|
|
@@ -1,77 +0,0 @@
|
|
|
|
|
-/*
|
|
|
|
|
- * Copyright (c) 2015. Starlis LLC / dba Empire Minecraft
|
|
|
|
|
- *
|
|
|
|
|
- * This source code is proprietary software and must not be redistributed without Starlis LLC's approval
|
|
|
|
|
- *
|
|
|
|
|
- */
|
|
|
|
|
-package co.aikar.util;
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-import com.google.common.base.Function;
|
|
|
|
|
-import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
|
|
|
|
-import org.jetbrains.annotations.NotNull;
|
|
|
|
|
-import org.jetbrains.annotations.Nullable;
|
|
|
|
|
-
|
|
|
|
|
-/**
|
|
|
|
|
- * Allows you to pass a Loader function that when a key is accessed that doesn't exist,
|
|
|
|
|
- * automatically loads the entry into the map by calling the loader Function.
|
|
|
|
|
- *
|
|
|
|
|
- * .get() Will only return null if the Loader can return null.
|
|
|
|
|
- *
|
|
|
|
|
- * You may pass any backing Map to use.
|
|
|
|
|
- *
|
|
|
|
|
- * This class is not thread safe and should be wrapped with Collections.synchronizedMap on the OUTSIDE of the LoadingMap if needed.
|
|
|
|
|
- *
|
|
|
|
|
- * Do not wrap the backing map with Collections.synchronizedMap.
|
|
|
|
|
- *
|
|
|
|
|
- * @param <V> Value
|
|
|
|
|
- */
|
|
|
|
|
-@Deprecated(forRemoval = true)
|
|
|
|
|
-public class LoadingIntMap<V> extends Int2ObjectOpenHashMap<V> {
|
|
|
|
|
- private final Function<Integer, V> loader;
|
|
|
|
|
-
|
|
|
|
|
- public LoadingIntMap(@NotNull Function<Integer, V> loader) {
|
|
|
|
|
- super();
|
|
|
|
|
- this.loader = loader;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public LoadingIntMap(int expectedSize, @NotNull Function<Integer, V> loader) {
|
|
|
|
|
- super(expectedSize);
|
|
|
|
|
- this.loader = loader;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public LoadingIntMap(int expectedSize, float loadFactor, @NotNull Function<Integer, V> loader) {
|
|
|
|
|
- super(expectedSize, loadFactor);
|
|
|
|
|
- this.loader = loader;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- @Nullable
|
|
|
|
|
- @Override
|
|
|
|
|
- public V get(int key) {
|
|
|
|
|
- V res = super.get(key);
|
|
|
|
|
- if (res == null) {
|
|
|
|
|
- res = loader.apply(key);
|
|
|
|
|
- if (res != null) {
|
|
|
|
|
- put(key, res);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- return res;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Due to java stuff, you will need to cast it to (Function) for some cases
|
|
|
|
|
- *
|
|
|
|
|
- * @param <T> Type
|
|
|
|
|
- */
|
|
|
|
|
- public abstract static class Feeder <T> implements Function<T, T> {
|
|
|
|
|
- @Nullable
|
|
|
|
|
- @Override
|
|
|
|
|
- public T apply(@Nullable Object input) {
|
|
|
|
|
- return apply();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Nullable
|
|
|
|
|
- public abstract T apply();
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
diff --git a/src/main/java/co/aikar/util/LoadingMap.java b/src/main/java/co/aikar/util/LoadingMap.java
|
|
|
|
|
deleted file mode 100644
|
|
|
|
|
index 1786eeb5cbeaad75602c9c5649bbcd9b2af5cf81..0000000000000000000000000000000000000000
|
|
|
|
|
--- a/src/main/java/co/aikar/util/LoadingMap.java
|
|
|
|
|
+++ /dev/null
|
|
|
|
|
@@ -1,369 +0,0 @@
|
|
|
|
|
-/*
|
|
|
|
|
- * This file is licensed under the MIT License (MIT).
|
|
|
|
|
- *
|
|
|
|
|
- * Copyright (c) 2014 Daniel Ennis <http://aikar.co>
|
|
|
|
|
- *
|
|
|
|
|
- * Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
|
- * of this software and associated documentation files (the "Software"), to deal
|
|
|
|
|
- * in the Software without restriction, including without limitation the rights
|
|
|
|
|
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
|
- * copies of the Software, and to permit persons to whom the Software is
|
|
|
|
|
- * furnished to do so, subject to the following conditions:
|
|
|
|
|
- *
|
|
|
|
|
- * The above copyright notice and this permission notice shall be included in
|
|
|
|
|
- * all copies or substantial portions of the Software.
|
|
|
|
|
- *
|
|
|
|
|
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
|
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
|
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
|
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
|
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
|
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
|
- * THE SOFTWARE.
|
|
|
|
|
- */
|
|
|
|
|
-package co.aikar.util;
|
|
|
|
|
-
|
|
|
|
|
-import com.google.common.base.Preconditions;
|
|
|
|
|
-import java.lang.reflect.Constructor;
|
|
|
|
|
-import java.util.AbstractMap;
|
|
|
|
|
-import java.util.Collection;
|
|
|
|
|
-import java.util.HashMap;
|
|
|
|
|
-import java.util.IdentityHashMap;
|
|
|
|
|
-import java.util.Map;
|
|
|
|
|
-import java.util.Set;
|
|
|
|
|
-import java.util.function.Function;
|
|
|
|
|
-import org.jetbrains.annotations.NotNull;
|
|
|
|
|
-import org.jetbrains.annotations.Nullable;
|
|
|
|
|
-
|
|
|
|
|
-/**
|
|
|
|
|
- * Allows you to pass a Loader function that when a key is accessed that doesn't exists,
|
|
|
|
|
- * automatically loads the entry into the map by calling the loader Function.
|
|
|
|
|
- *
|
|
|
|
|
- * .get() Will only return null if the Loader can return null.
|
|
|
|
|
- *
|
|
|
|
|
- * You may pass any backing Map to use.
|
|
|
|
|
- *
|
|
|
|
|
- * This class is not thread safe and should be wrapped with Collections.synchronizedMap on the OUTSIDE of the LoadingMap if needed.
|
|
|
|
|
- *
|
|
|
|
|
- * Do not wrap the backing map with Collections.synchronizedMap.
|
|
|
|
|
- *
|
|
|
|
|
- * @param <K> Key
|
|
|
|
|
- * @param <V> Value
|
|
|
|
|
- */
|
|
|
|
|
-@Deprecated(forRemoval = true)
|
|
|
|
|
-public class LoadingMap <K, V> extends AbstractMap<K, V> {
|
|
|
|
|
- private final Map<K, V> backingMap;
|
|
|
|
|
- private final java.util.function.Function<K, V> loader;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Initializes an auto loading map using specified loader and backing map
|
|
|
|
|
- * @param backingMap Map to wrap
|
|
|
|
|
- * @param loader Loader
|
|
|
|
|
- */
|
|
|
|
|
- public LoadingMap(@NotNull Map<K, V> backingMap, @NotNull java.util.function.Function<K, V> loader) {
|
|
|
|
|
- this.backingMap = backingMap;
|
|
|
|
|
- this.loader = loader;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Creates a new LoadingMap with the specified map and loader
|
|
|
|
|
- *
|
|
|
|
|
- * @param backingMap Actual map being used.
|
|
|
|
|
- * @param loader Loader to use
|
|
|
|
|
- * @param <K> Key Type of the Map
|
|
|
|
|
- * @param <V> Value Type of the Map
|
|
|
|
|
- * @return Map
|
|
|
|
|
- */
|
|
|
|
|
- @NotNull
|
|
|
|
|
- public static <K, V> Map<K, V> of(@NotNull Map<K, V> backingMap, @NotNull Function<K, V> loader) {
|
|
|
|
|
- return new LoadingMap<>(backingMap, loader);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Creates a LoadingMap with an auto instantiating loader.
|
|
|
|
|
- *
|
|
|
|
|
- * Will auto construct class of of Value when not found
|
|
|
|
|
- *
|
|
|
|
|
- * Since this uses Reflection, It is more effecient to define your own static loader
|
|
|
|
|
- * than using this helper, but if performance is not critical, this is easier.
|
|
|
|
|
- *
|
|
|
|
|
- * @param backingMap Actual map being used.
|
|
|
|
|
- * @param keyClass Class used for the K generic
|
|
|
|
|
- * @param valueClass Class used for the V generic
|
|
|
|
|
- * @param <K> Key Type of the Map
|
|
|
|
|
- * @param <V> Value Type of the Map
|
|
|
|
|
- * @return Map that auto instantiates on .get()
|
|
|
|
|
- */
|
|
|
|
|
- @NotNull
|
|
|
|
|
- public static <K, V> Map<K, V> newAutoMap(@NotNull Map<K, V> backingMap, @Nullable final Class<? extends K> keyClass,
|
|
|
|
|
- @NotNull final Class<? extends V> valueClass) {
|
|
|
|
|
- return new LoadingMap<>(backingMap, new AutoInstantiatingLoader<>(keyClass, valueClass));
|
|
|
|
|
- }
|
|
|
|
|
- /**
|
|
|
|
|
- * Creates a LoadingMap with an auto instantiating loader.
|
|
|
|
|
- *
|
|
|
|
|
- * Will auto construct class of of Value when not found
|
|
|
|
|
- *
|
|
|
|
|
- * Since this uses Reflection, It is more effecient to define your own static loader
|
|
|
|
|
- * than using this helper, but if performance is not critical, this is easier.
|
|
|
|
|
- *
|
|
|
|
|
- * @param backingMap Actual map being used.
|
|
|
|
|
- * @param valueClass Class used for the V generic
|
|
|
|
|
- * @param <K> Key Type of the Map
|
|
|
|
|
- * @param <V> Value Type of the Map
|
|
|
|
|
- * @return Map that auto instantiates on .get()
|
|
|
|
|
- */
|
|
|
|
|
- @NotNull
|
|
|
|
|
- public static <K, V> Map<K, V> newAutoMap(@NotNull Map<K, V> backingMap,
|
|
|
|
|
- @NotNull final Class<? extends V> valueClass) {
|
|
|
|
|
- return newAutoMap(backingMap, null, valueClass);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @see #newAutoMap
|
|
|
|
|
- *
|
|
|
|
|
- * new Auto initializing map using a HashMap.
|
|
|
|
|
- *
|
|
|
|
|
- * @param keyClass Class used for the K generic
|
|
|
|
|
- * @param valueClass Class used for the V generic
|
|
|
|
|
- * @param <K> Key Type of the Map
|
|
|
|
|
- * @param <V> Value Type of the Map
|
|
|
|
|
- * @return Map that auto instantiates on .get()
|
|
|
|
|
- */
|
|
|
|
|
- @NotNull
|
|
|
|
|
- public static <K, V> Map<K, V> newHashAutoMap(@Nullable final Class<? extends K> keyClass, @NotNull final Class<? extends V> valueClass) {
|
|
|
|
|
- return newAutoMap(new HashMap<>(), keyClass, valueClass);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @see #newAutoMap
|
|
|
|
|
- *
|
|
|
|
|
- * new Auto initializing map using a HashMap.
|
|
|
|
|
- *
|
|
|
|
|
- * @param valueClass Class used for the V generic
|
|
|
|
|
- * @param <K> Key Type of the Map
|
|
|
|
|
- * @param <V> Value Type of the Map
|
|
|
|
|
- * @return Map that auto instantiates on .get()
|
|
|
|
|
- */
|
|
|
|
|
- @NotNull
|
|
|
|
|
- public static <K, V> Map<K, V> newHashAutoMap(@NotNull final Class<? extends V> valueClass) {
|
|
|
|
|
- return newHashAutoMap(null, valueClass);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @see #newAutoMap
|
|
|
|
|
- *
|
|
|
|
|
- * new Auto initializing map using a HashMap.
|
|
|
|
|
- *
|
|
|
|
|
- * @param keyClass Class used for the K generic
|
|
|
|
|
- * @param valueClass Class used for the V generic
|
|
|
|
|
- * @param initialCapacity Initial capacity to use
|
|
|
|
|
- * @param loadFactor Load factor to use
|
|
|
|
|
- * @param <K> Key Type of the Map
|
|
|
|
|
- * @param <V> Value Type of the Map
|
|
|
|
|
- * @return Map that auto instantiates on .get()
|
|
|
|
|
- */
|
|
|
|
|
- @NotNull
|
|
|
|
|
- public static <K, V> Map<K, V> newHashAutoMap(@Nullable final Class<? extends K> keyClass, @NotNull final Class<? extends V> valueClass, int initialCapacity, float loadFactor) {
|
|
|
|
|
- return newAutoMap(new HashMap<>(initialCapacity, loadFactor), keyClass, valueClass);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @see #newAutoMap
|
|
|
|
|
- *
|
|
|
|
|
- * new Auto initializing map using a HashMap.
|
|
|
|
|
- *
|
|
|
|
|
- * @param valueClass Class used for the V generic
|
|
|
|
|
- * @param initialCapacity Initial capacity to use
|
|
|
|
|
- * @param loadFactor Load factor to use
|
|
|
|
|
- * @param <K> Key Type of the Map
|
|
|
|
|
- * @param <V> Value Type of the Map
|
|
|
|
|
- * @return Map that auto instantiates on .get()
|
|
|
|
|
- */
|
|
|
|
|
- @NotNull
|
|
|
|
|
- public static <K, V> Map<K, V> newHashAutoMap(@NotNull final Class<? extends V> valueClass, int initialCapacity, float loadFactor) {
|
|
|
|
|
- return newHashAutoMap(null, valueClass, initialCapacity, loadFactor);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Initializes an auto loading map using a HashMap
|
|
|
|
|
- *
|
|
|
|
|
- * @param loader Loader to use
|
|
|
|
|
- * @param <K> Key Type of the Map
|
|
|
|
|
- * @param <V> Value Type of the Map
|
|
|
|
|
- * @return Map
|
|
|
|
|
- */
|
|
|
|
|
- @NotNull
|
|
|
|
|
- public static <K, V> Map<K, V> newHashMap(@NotNull Function<K, V> loader) {
|
|
|
|
|
- return new LoadingMap<>(new HashMap<>(), loader);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Initializes an auto loading map using a HashMap
|
|
|
|
|
- *
|
|
|
|
|
- * @param loader Loader to use
|
|
|
|
|
- * @param initialCapacity Initial capacity to use
|
|
|
|
|
- * @param <K> Key Type of the Map
|
|
|
|
|
- * @param <V> Value Type of the Map
|
|
|
|
|
- * @return Map
|
|
|
|
|
- */
|
|
|
|
|
- @NotNull
|
|
|
|
|
- public static <K, V> Map<K, V> newHashMap(@NotNull Function<K, V> loader, int initialCapacity) {
|
|
|
|
|
- return new LoadingMap<>(new HashMap<>(initialCapacity), loader);
|
|
|
|
|
- }
|
|
|
|
|
- /**
|
|
|
|
|
- * Initializes an auto loading map using a HashMap
|
|
|
|
|
- *
|
|
|
|
|
- * @param loader Loader to use
|
|
|
|
|
- * @param initialCapacity Initial capacity to use
|
|
|
|
|
- * @param loadFactor Load factor to use
|
|
|
|
|
- * @param <K> Key Type of the Map
|
|
|
|
|
- * @param <V> Value Type of the Map
|
|
|
|
|
- * @return Map
|
|
|
|
|
- */
|
|
|
|
|
- @NotNull
|
|
|
|
|
- public static <K, V> Map<K, V> newHashMap(@NotNull Function<K, V> loader, int initialCapacity, float loadFactor) {
|
|
|
|
|
- return new LoadingMap<>(new HashMap<>(initialCapacity, loadFactor), loader);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Initializes an auto loading map using an Identity HashMap
|
|
|
|
|
- *
|
|
|
|
|
- * @param loader Loader to use
|
|
|
|
|
- * @param <K> Key Type of the Map
|
|
|
|
|
- * @param <V> Value Type of the Map
|
|
|
|
|
- * @return Map
|
|
|
|
|
- */
|
|
|
|
|
- @NotNull
|
|
|
|
|
- public static <K, V> Map<K, V> newIdentityHashMap(@NotNull Function<K, V> loader) {
|
|
|
|
|
- return new LoadingMap<>(new IdentityHashMap<>(), loader);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Initializes an auto loading map using an Identity HashMap
|
|
|
|
|
- *
|
|
|
|
|
- * @param loader Loader to use
|
|
|
|
|
- * @param initialCapacity Initial capacity to use
|
|
|
|
|
- * @param <K> Key Type of the Map
|
|
|
|
|
- * @param <V> Value Type of the Map
|
|
|
|
|
- * @return Map
|
|
|
|
|
- */
|
|
|
|
|
- @NotNull
|
|
|
|
|
- public static <K, V> Map<K, V> newIdentityHashMap(@NotNull Function<K, V> loader, int initialCapacity) {
|
|
|
|
|
- return new LoadingMap<>(new IdentityHashMap<>(initialCapacity), loader);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public int size() {return backingMap.size();}
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public boolean isEmpty() {return backingMap.isEmpty();}
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public boolean containsKey(@Nullable Object key) {return backingMap.containsKey(key);}
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public boolean containsValue(@Nullable Object value) {return backingMap.containsValue(value);}
|
|
|
|
|
-
|
|
|
|
|
- @Nullable
|
|
|
|
|
- @Override
|
|
|
|
|
- public V get(@Nullable Object key) {
|
|
|
|
|
- V v = backingMap.get(key);
|
|
|
|
|
- if (v != null) {
|
|
|
|
|
- return v;
|
|
|
|
|
- }
|
|
|
|
|
- return backingMap.computeIfAbsent((K) key, loader);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Nullable
|
|
|
|
|
- public V put(@Nullable K key, @Nullable V value) {return backingMap.put(key, value);}
|
|
|
|
|
-
|
|
|
|
|
- @Nullable
|
|
|
|
|
- @Override
|
|
|
|
|
- public V remove(@Nullable Object key) {return backingMap.remove(key);}
|
|
|
|
|
-
|
|
|
|
|
- public void putAll(@NotNull Map<? extends K, ? extends V> m) {backingMap.putAll(m);}
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public void clear() {backingMap.clear();}
|
|
|
|
|
-
|
|
|
|
|
- @NotNull
|
|
|
|
|
- @Override
|
|
|
|
|
- public Set<K> keySet() {return backingMap.keySet();}
|
|
|
|
|
-
|
|
|
|
|
- @NotNull
|
|
|
|
|
- @Override
|
|
|
|
|
- public Collection<V> values() {return backingMap.values();}
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public boolean equals(@Nullable Object o) {return backingMap.equals(o);}
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public int hashCode() {return backingMap.hashCode();}
|
|
|
|
|
-
|
|
|
|
|
- @NotNull
|
|
|
|
|
- @Override
|
|
|
|
|
- public Set<Entry<K, V>> entrySet() {
|
|
|
|
|
- return backingMap.entrySet();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @NotNull
|
|
|
|
|
- public LoadingMap<K, V> clone() {
|
|
|
|
|
- return new LoadingMap<>(backingMap, loader);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- private static class AutoInstantiatingLoader<K, V> implements Function<K, V> {
|
|
|
|
|
- final Constructor<? extends V> constructor;
|
|
|
|
|
- private final Class<? extends V> valueClass;
|
|
|
|
|
-
|
|
|
|
|
- AutoInstantiatingLoader(@Nullable Class<? extends K> keyClass, @NotNull Class<? extends V> valueClass) {
|
|
|
|
|
- try {
|
|
|
|
|
- this.valueClass = valueClass;
|
|
|
|
|
- if (keyClass != null) {
|
|
|
|
|
- constructor = valueClass.getConstructor(keyClass);
|
|
|
|
|
- } else {
|
|
|
|
|
- constructor = null;
|
|
|
|
|
- }
|
|
|
|
|
- } catch (NoSuchMethodException e) {
|
|
|
|
|
- throw new IllegalStateException(
|
|
|
|
|
- valueClass.getName() + " does not have a constructor for " + (keyClass != null ? keyClass.getName() : null));
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @NotNull
|
|
|
|
|
- @Override
|
|
|
|
|
- public V apply(@Nullable K input) {
|
|
|
|
|
- try {
|
|
|
|
|
- return (constructor != null ? constructor.newInstance(input) : valueClass.newInstance());
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- throw new ExceptionInInitializerError(e);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public int hashCode() {
|
|
|
|
|
- return super.hashCode();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Override
|
|
|
|
|
- public boolean equals(Object object) {
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Due to java stuff, you will need to cast it to (Function) for some cases
|
|
|
|
|
- *
|
|
|
|
|
- * @param <T> Type
|
|
|
|
|
- */
|
|
|
|
|
- public abstract static class Feeder <T> implements Function<T, T> {
|
|
|
|
|
- @Nullable
|
|
|
|
|
- @Override
|
|
|
|
|
- public T apply(@Nullable Object input) {
|
|
|
|
|
- return apply();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Nullable
|
|
|
|
|
- public abstract T apply();
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
diff --git a/src/main/java/co/aikar/util/MRUMapCache.java b/src/main/java/co/aikar/util/MRUMapCache.java
|
|
|
|
|
deleted file mode 100644
|
|
|
|
|
index 3e61a926620a67daec3af54b72a1b911eaef2ed4..0000000000000000000000000000000000000000
|
|
|
|
|
--- a/src/main/java/co/aikar/util/MRUMapCache.java
|
|
|
|
|
+++ /dev/null
|
|
|
|
|
@@ -1,112 +0,0 @@
|
|
|
|
|
-/*
|
|
|
|
|
- * This file is licensed under the MIT License (MIT).
|
|
|
|
|
- *
|
|
|
|
|
- * Copyright (c) 2014 Daniel Ennis <http://aikar.co>
|
|
|
|
|
- *
|
|
|
|
|
- * Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
|
- * of this software and associated documentation files (the "Software"), to deal
|
|
|
|
|
- * in the Software without restriction, including without limitation the rights
|
|
|
|
|
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
|
- * copies of the Software, and to permit persons to whom the Software is
|
|
|
|
|
- * furnished to do so, subject to the following conditions:
|
|
|
|
|
- *
|
|
|
|
|
- * The above copyright notice and this permission notice shall be included in
|
|
|
|
|
- * all copies or substantial portions of the Software.
|
|
|
|
|
- *
|
|
|
|
|
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
|
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
|
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
|
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
|
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
|
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
|
- * THE SOFTWARE.
|
|
|
|
|
- */
|
|
|
|
|
-package co.aikar.util;
|
|
|
|
|
-
|
|
|
|
|
-import java.util.AbstractMap;
|
|
|
|
|
-import java.util.Collection;
|
|
|
|
|
-import java.util.Map;
|
|
|
|
|
-import java.util.Set;
|
|
|
|
|
-import org.jetbrains.annotations.NotNull;
|
|
|
|
|
-import org.jetbrains.annotations.Nullable;
|
|
|
|
|
-
|
|
|
|
|
-/**
|
|
|
|
|
- * Implements a Most Recently Used cache in front of a backing map, to quickly access the last accessed result.
|
|
|
|
|
- *
|
|
|
|
|
- * @param <K> Key Type of the Map
|
|
|
|
|
- * @param <V> Value Type of the Map
|
|
|
|
|
- */
|
|
|
|
|
-@Deprecated(forRemoval = true)
|
|
|
|
|
-public class MRUMapCache<K, V> extends AbstractMap<K, V> {
|
|
|
|
|
- final Map<K, V> backingMap;
|
|
|
|
|
- Object cacheKey;
|
|
|
|
|
- V cacheValue;
|
|
|
|
|
- public MRUMapCache(@NotNull final Map<K, V> backingMap) {
|
|
|
|
|
- this.backingMap = backingMap;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public int size() {return backingMap.size();}
|
|
|
|
|
-
|
|
|
|
|
- public boolean isEmpty() {return backingMap.isEmpty();}
|
|
|
|
|
-
|
|
|
|
|
- public boolean containsKey(@Nullable Object key) {
|
|
|
|
|
- return key != null && key.equals(cacheKey) || backingMap.containsKey(key);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public boolean containsValue(@Nullable Object value) {
|
|
|
|
|
- return value != null && value == cacheValue || backingMap.containsValue(value);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Nullable
|
|
|
|
|
- public V get(@Nullable Object key) {
|
|
|
|
|
- if (cacheKey != null && cacheKey.equals(key)) {
|
|
|
|
|
- return cacheValue;
|
|
|
|
|
- }
|
|
|
|
|
- cacheKey = key;
|
|
|
|
|
- return cacheValue = backingMap.get(key);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Nullable
|
|
|
|
|
- public V put(@Nullable K key, @Nullable V value) {
|
|
|
|
|
- cacheKey = key;
|
|
|
|
|
- return cacheValue = backingMap.put(key, value);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Nullable
|
|
|
|
|
- public V remove(@Nullable Object key) {
|
|
|
|
|
- if (key != null && key.equals(cacheKey)) {
|
|
|
|
|
- cacheKey = null;
|
|
|
|
|
- }
|
|
|
|
|
- return backingMap.remove(key);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- public void putAll(@NotNull Map<? extends K, ? extends V> m) {backingMap.putAll(m);}
|
|
|
|
|
-
|
|
|
|
|
- public void clear() {
|
|
|
|
|
- cacheKey = null;
|
|
|
|
|
- cacheValue = null;
|
|
|
|
|
- backingMap.clear();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @NotNull
|
|
|
|
|
- public Set<K> keySet() {return backingMap.keySet();}
|
|
|
|
|
-
|
|
|
|
|
- @NotNull
|
|
|
|
|
- public Collection<V> values() {return backingMap.values();}
|
|
|
|
|
-
|
|
|
|
|
- @NotNull
|
|
|
|
|
- public Set<Map.Entry<K, V>> entrySet() {return backingMap.entrySet();}
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * Wraps the specified map with a most recently used cache
|
|
|
|
|
- *
|
|
|
|
|
- * @param map Map to be wrapped
|
|
|
|
|
- * @param <K> Key Type of the Map
|
|
|
|
|
- * @param <V> Value Type of the Map
|
|
|
|
|
- * @return Map
|
|
|
|
|
- */
|
|
|
|
|
- @NotNull
|
|
|
|
|
- public static <K, V> Map<K, V> of(@NotNull Map<K, V> map) {
|
|
|
|
|
- return new MRUMapCache<K, V>(map);
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java
|
|
|
|
|
index 71eb845a4d3b8b6ec3b816a0f20ec807e0f9a86d..a43419c23aa0f6fd809caf5a841cb138f350b7ba 100644
|
|
|
|
|
--- a/src/main/java/org/bukkit/command/Command.java
|
|
|
|
|
@@ -2219,18 +2987,10 @@ index 001465eedafa51ac027a4db51cba6223edfe1171..9cb0f09b821a4020d17771a5b64ddd53
|
|
|
|
|
|
|
|
|
|
// Paper start
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
|
|
|
|
index 065f182fbfe4541d602f57d548f286ee3c2fab19..40350504b5f7a92d834e95bb2e4e4268195ec9e7 100644
|
|
|
|
|
index b23774f34a39426c7eeba9da05a75de44e603658..1ad24e0107499e4dcaad647feeb54887675d9e51 100644
|
|
|
|
|
--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
|
|
|
|
+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
|
|
|
|
|
@@ -43,7 +43,6 @@ import org.bukkit.plugin.TimedRegisteredListener;
|
|
|
|
|
import org.bukkit.plugin.UnknownDependencyException;
|
|
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
|
-import org.spigotmc.CustomTimingsHandler; // Spigot
|
|
|
|
|
import org.yaml.snakeyaml.error.YAMLException;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@@ -294,7 +293,7 @@ public final class JavaPluginLoader implements PluginLoader {
|
|
|
|
|
@@ -291,7 +291,7 @@ public final class JavaPluginLoader implements PluginLoader {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -2239,15 +2999,15 @@ index 065f182fbfe4541d602f57d548f286ee3c2fab19..40350504b5f7a92d834e95bb2e4e4268
|
|
|
|
|
@Override
|
|
|
|
|
public void execute(@NotNull Listener listener, @NotNull Event event) throws EventException { // Paper
|
|
|
|
|
try {
|
|
|
|
|
@@ -308,7 +307,7 @@ public final class JavaPluginLoader implements PluginLoader {
|
|
|
|
|
@@ -305,7 +305,7 @@ public final class JavaPluginLoader implements PluginLoader {
|
|
|
|
|
throw new EventException(t);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
- }, plugin, method, eventClass); // Paper
|
|
|
|
|
+ }; // Paper // DivineMC - Delete Timings
|
|
|
|
|
if (false) { // Spigot - RL handles useTimings check now
|
|
|
|
|
eventSet.add(new TimedRegisteredListener(listener, executor, eh.priority(), plugin, eh.ignoreCancelled()));
|
|
|
|
|
} else {
|
|
|
|
|
eventSet.add(new RegisteredListener(listener, executor, eh.priority(), plugin, eh.ignoreCancelled()));
|
|
|
|
|
}
|
|
|
|
|
return ret;
|
|
|
|
|
diff --git a/src/main/java/org/spigotmc/CustomTimingsHandler.java b/src/main/java/org/spigotmc/CustomTimingsHandler.java
|
|
|
|
|
deleted file mode 100644
|
|
|
|
|
index b4249da3eb26eae26ec000cc4d56cd21ac2fc6d5..0000000000000000000000000000000000000000
|
|
|
|
|
|