Timings v2
TODO: Add #isStopping to FullServerTickHandler#stopTiming in patch 191 expose isRunning
This commit is contained in:
@ -381,7 +381,6 @@ public final class SimplePluginManager implements PluginManager {
|
||||
}
|
||||
}
|
||||
|
||||
org.bukkit.command.defaults.TimingsCommand.timingStart = System.nanoTime(); // Spigot
|
||||
return result.toArray(new Plugin[result.size()]);
|
||||
}
|
||||
|
||||
@ -429,9 +428,9 @@ public final class SimplePluginManager implements PluginManager {
|
||||
|
||||
if (result != null) {
|
||||
plugins.add(result);
|
||||
lookupNames.put(result.getDescription().getName(), result);
|
||||
lookupNames.put(result.getDescription().getName().toLowerCase(java.util.Locale.ENGLISH), result); // Paper
|
||||
for (String provided : result.getDescription().getProvides()) {
|
||||
lookupNames.putIfAbsent(provided, result);
|
||||
lookupNames.putIfAbsent(provided.toLowerCase(java.util.Locale.ENGLISH), result); // Paper
|
||||
}
|
||||
}
|
||||
|
||||
@ -461,7 +460,7 @@ public final class SimplePluginManager implements PluginManager {
|
||||
@Nullable
|
||||
public synchronized Plugin getPlugin(@NotNull String name) {
|
||||
if (true) {return this.paperPluginManager.getPlugin(name);} // Paper
|
||||
return lookupNames.get(name.replace(' ', '_'));
|
||||
return lookupNames.get(name.replace(' ', '_').toLowerCase(java.util.Locale.ENGLISH)); // Paper
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -689,7 +688,8 @@ public final class SimplePluginManager implements PluginManager {
|
||||
throw new IllegalPluginAccessException("Plugin attempted to register " + event + " while not enabled");
|
||||
}
|
||||
|
||||
if (useTimings) {
|
||||
executor = new co.aikar.timings.TimedEventExecutor(executor, plugin, null, event); // Paper
|
||||
if (false) { // Spigot - RL handles useTimings check now // Paper
|
||||
getEventListeners(event).register(new TimedRegisteredListener(listener, executor, priority, plugin, ignoreCancelled));
|
||||
} else {
|
||||
getEventListeners(event).register(new RegisteredListener(listener, executor, priority, plugin, ignoreCancelled));
|
||||
@ -924,7 +924,7 @@ public final class SimplePluginManager implements PluginManager {
|
||||
@Override
|
||||
public boolean useTimings() {
|
||||
if (true) {return this.paperPluginManager.useTimings();} // Paper
|
||||
return useTimings;
|
||||
return co.aikar.timings.Timings.isTimingsEnabled(); // Spigot
|
||||
}
|
||||
|
||||
/**
|
||||
@ -932,8 +932,9 @@ public final class SimplePluginManager implements PluginManager {
|
||||
*
|
||||
* @param use True if per event timing code should be used
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public void useTimings(boolean use) {
|
||||
useTimings = use;
|
||||
co.aikar.timings.Timings.setTimingsEnabled(use); // Paper
|
||||
}
|
||||
|
||||
// Paper start
|
||||
|
||||
Reference in New Issue
Block a user