Rename a Timings class and split up Tracker timings

This commit is contained in:
Aikar 2016-04-29 21:23:40 -04:00
parent 5aa3237a21
commit 368a822c47
8 changed files with 252 additions and 89 deletions

View File

@ -1,4 +1,4 @@
From f0cccb930c97f03205579dba1faf032ed9969b0a Mon Sep 17 00:00:00 2001
From 7446c784f0bad396c8f8f8da924f322d9f794252 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 3 Mar 2016 04:00:11 -0600
Subject: [PATCH] Timings v2
@ -21,11 +21,11 @@ index 8899e3a..8bc1a26 100644
<groupId>net.sf.trove4j</groupId>
<artifactId>trove4j</artifactId>
<version>3.0.3</version>
diff --git a/src/main/java/co/aikar/timings/SpigotTimings.java b/src/main/java/co/aikar/timings/SpigotTimings.java
diff --git a/src/main/java/co/aikar/timings/MinecraftTimings.java b/src/main/java/co/aikar/timings/MinecraftTimings.java
new file mode 100644
index 0000000..3f4271c
index 0000000..0f8315c
--- /dev/null
+++ b/src/main/java/co/aikar/timings/SpigotTimings.java
+++ b/src/main/java/co/aikar/timings/MinecraftTimings.java
@@ -0,0 +1,110 @@
+package co.aikar.timings;
+
@ -35,7 +35,7 @@ index 0000000..3f4271c
+
+import org.bukkit.craftbukkit.scheduler.CraftTask;
+
+public final class SpigotTimings {
+public final class MinecraftTimings {
+
+ public static final Timing playerListTimer = Timings.ofSafe("Player List");
+ public static final Timing connectionTimer = Timings.ofSafe("Connection Handler");
@ -59,7 +59,7 @@ index 0000000..3f4271c
+ public static final Timing antiXrayUpdateTimer = Timings.ofSafe("anti-xray - update");
+ public static final Timing antiXrayObfuscateTimer = Timings.ofSafe("anti-xray - obfuscate");
+
+ private SpigotTimings() {}
+ private MinecraftTimings() {}
+
+ /**
+ * Gets a timer associated with a plugins tasks.
@ -139,10 +139,10 @@ index 0000000..3f4271c
+}
diff --git a/src/main/java/co/aikar/timings/WorldTimingsHandler.java b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
new file mode 100644
index 0000000..9ebc710
index 0000000..11dd692
--- /dev/null
+++ b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
@@ -0,0 +1,69 @@
@@ -0,0 +1,71 @@
+package co.aikar.timings;
+
+import net.minecraft.server.World;
@ -167,7 +167,8 @@ index 0000000..9ebc710
+ public final Timing entityTick;
+ public final Timing tileEntityTick;
+ public final Timing tileEntityPending;
+ public final Timing tracker;
+ public final Timing tracker1;
+ public final Timing tracker2;
+ public final Timing doTick;
+ public final Timing tickEntities;
+
@ -207,7 +208,8 @@ index 0000000..9ebc710
+ syncChunkLoadTileTicksTimer = Timings.ofSafe(name + "chunkLoad - TileTicks");
+ syncChunkLoadPostTimer = Timings.ofSafe(name + "chunkLoad - Post");
+
+ tracker = Timings.ofSafe(name + "tracker");
+ tracker1 = Timings.ofSafe(name + "tracker stage 1");
+ tracker2 = Timings.ofSafe(name + "tracker stage 2");
+ doTick = Timings.ofSafe(name + "doTick");
+ tickEntities = Timings.ofSafe(name + "tickEntities");
+ }
@ -273,7 +275,7 @@ index dca7763..7cfe3b9 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java
index 1d2f580..88e1e98 100644
index 1d2f580..6005d03 100644
--- a/src/main/java/net/minecraft/server/Block.java
+++ b/src/main/java/net/minecraft/server/Block.java
@@ -32,6 +32,15 @@ public class Block {
@ -284,7 +286,7 @@ index 1d2f580..88e1e98 100644
+ public co.aikar.timings.Timing timing;
+ public co.aikar.timings.Timing getTiming() {
+ if (timing == null) {
+ timing = co.aikar.timings.SpigotTimings.getBlockTiming(this);
+ timing = co.aikar.timings.MinecraftTimings.getBlockTiming(this);
+ }
+ return timing;
+ }
@ -293,7 +295,7 @@ index 1d2f580..88e1e98 100644
public static int getId(Block block) {
return Block.REGISTRY.a(block); // CraftBukkit - decompile error
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
index 328857d..0225a2e 100644
index 328857d..42752d9 100644
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
@@ -22,7 +22,7 @@ import java.io.PrintStream;
@ -301,12 +303,30 @@ index 328857d..0225a2e 100644
import org.bukkit.craftbukkit.LoggerOutputStream;
-import org.bukkit.craftbukkit.SpigotTimings; // Spigot
+import co.aikar.timings.SpigotTimings; // Paper
+import co.aikar.timings.MinecraftTimings; // Paper
import org.bukkit.event.server.ServerCommandEvent;
import org.bukkit.craftbukkit.util.Waitable;
import org.bukkit.event.server.RemoteServerCommandEvent;
@@ -428,7 +428,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
}
public void aL() {
- SpigotTimings.serverCommandTimer.startTiming(); // Spigot
+ MinecraftTimings.serverCommandTimer.startTiming(); // Spigot
while (!this.serverCommandQueue.isEmpty()) {
ServerCommand servercommand = (ServerCommand) this.serverCommandQueue.remove(0);
@@ -443,7 +443,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
// CraftBukkit end
}
- SpigotTimings.serverCommandTimer.stopTiming(); // Spigot
+ MinecraftTimings.serverCommandTimer.stopTiming(); // Spigot
}
public boolean aa() {
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 2983756..9e84616 100644
index 2983756..54367ef 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -24,7 +24,8 @@ import org.bukkit.block.BlockFace;
@ -314,7 +334,7 @@ index 2983756..9e84616 100644
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Vehicle;
-import org.spigotmc.CustomTimingsHandler; // Spigot
+import co.aikar.timings.SpigotTimings; // Paper
+import co.aikar.timings.MinecraftTimings; // Paper
+import co.aikar.timings.Timing; // Paper
import org.bukkit.event.entity.EntityCombustByEntityEvent;
import org.bukkit.event.hanging.HangingBreakByEntityEvent;
@ -324,7 +344,7 @@ index 2983756..9e84616 100644
public org.bukkit.projectiles.ProjectileSource projectileSource; // CraftBukkit - For projectiles only
public boolean forceExplosionKnockback; // CraftBukkit - SPIGOT-949
- public CustomTimingsHandler tickTimer = org.bukkit.craftbukkit.SpigotTimings.getEntityTimings(this); // Spigot
+ public Timing tickTimer = SpigotTimings.getEntityTimings(this); // Paper
+ public Timing tickTimer = MinecraftTimings.getEntityTimings(this); // Paper
// Spigot start
public final byte activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this);
public final boolean defaultActivationState;
@ -345,7 +365,7 @@ index 2983756..9e84616 100644
public void recalcPosition() {
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 09d6bd5..81525ee 100644
index 09d6bd5..9fc46b1 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -25,7 +25,7 @@ import org.bukkit.event.entity.EntityTeleportEvent;
@ -353,7 +373,7 @@ index 09d6bd5..81525ee 100644
// CraftBukkit end
-import org.bukkit.craftbukkit.SpigotTimings; // Spigot
+import co.aikar.timings.SpigotTimings; // Paper
+import co.aikar.timings.MinecraftTimings; // Paper
public abstract class EntityLiving extends Entity {
@ -415,8 +435,39 @@ index 09d6bd5..81525ee 100644
this.world.methodProfiler.b();
}
diff --git a/src/main/java/net/minecraft/server/EntityTracker.java b/src/main/java/net/minecraft/server/EntityTracker.java
index 3773bb1..8eceb93 100644
--- a/src/main/java/net/minecraft/server/EntityTracker.java
+++ b/src/main/java/net/minecraft/server/EntityTracker.java
@@ -172,7 +172,7 @@ public class EntityTracker {
public void updatePlayers() {
ArrayList arraylist = Lists.newArrayList();
Iterator iterator = this.c.iterator();
-
+ world.timings.tracker1.startTiming(); // Spigot
while (iterator.hasNext()) {
EntityTrackerEntry entitytrackerentry = (EntityTrackerEntry) iterator.next();
@@ -185,7 +185,9 @@ public class EntityTracker {
}
}
}
+ world.timings.tracker1.stopTiming(); // Spigot
+ world.timings.tracker2.startTiming(); // Spigot
for (int i = 0; i < arraylist.size(); ++i) {
EntityPlayer entityplayer = (EntityPlayer) arraylist.get(i);
Iterator iterator1 = this.c.iterator();
@@ -198,6 +200,7 @@ public class EntityTracker {
}
}
}
+ world.timings.tracker2.stopTiming(); // Spigot
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 0caa3f9..a5fea4a 100644
index 0caa3f9..8bfbc2c 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -45,7 +45,7 @@ import org.bukkit.craftbukkit.CraftServer;
@ -424,7 +475,7 @@ index 0caa3f9..a5fea4a 100644
// CraftBukkit start
// CraftBukkit end
-import org.bukkit.craftbukkit.SpigotTimings; // Spigot
+import co.aikar.timings.SpigotTimings; // Paper
+import co.aikar.timings.MinecraftTimings; // Paper
public abstract class MinecraftServer implements Runnable, ICommandListener, IAsyncTaskHandler, IMojangStatistics {
@ -432,7 +483,7 @@ index 0caa3f9..a5fea4a 100644
}
// CraftBukkit end
MinecraftServer.LOGGER.info("Stopping server");
+ SpigotTimings.stopServer(); // Paper
+ MinecraftTimings.stopServer(); // Paper
// CraftBukkit start
if (this.server != null) {
this.server.disablePlugins();
@ -445,9 +496,29 @@ index 0caa3f9..a5fea4a 100644
long i = System.nanoTime();
++this.ticks;
@@ -706,11 +707,11 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
@@ -673,7 +674,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
}
if (autosavePeriod > 0 && this.ticks % autosavePeriod == 0) { // CraftBukkit
- SpigotTimings.worldSaveTimer.startTiming(); // Spigot
+ MinecraftTimings.worldSaveTimer.startTiming(); // Spigot
this.methodProfiler.a("save");
this.v.savePlayers();
// Spigot Start
@@ -688,7 +689,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
// this.saveChunks(true);
// Spigot End
this.methodProfiler.b();
- SpigotTimings.worldSaveTimer.stopTiming(); // Spigot
+ MinecraftTimings.worldSaveTimer.stopTiming(); // Spigot
}
this.methodProfiler.a("tallying");
@@ -705,12 +706,13 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
this.methodProfiler.b();
this.methodProfiler.b();
+
org.spigotmc.WatchdogThread.tick(); // Spigot
- SpigotTimings.serverTickTimer.stopTiming(); // Spigot
- org.spigotmc.CustomTimingsHandler.tick(); // Spigot
@ -455,36 +526,100 @@ index 0caa3f9..a5fea4a 100644
}
public void D() {
+ SpigotTimings.minecraftSchedulerTimer.startTiming(); // Paper
+ MinecraftTimings.minecraftSchedulerTimer.startTiming(); // Paper
this.methodProfiler.a("jobs");
Queue queue = this.j;
@@ -721,13 +722,14 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
@@ -721,26 +723,27 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
SystemUtils.a(entry, MinecraftServer.LOGGER);
}
// Spigot end
+ SpigotTimings.minecraftSchedulerTimer.stopTiming(); // Paper
+ MinecraftTimings.minecraftSchedulerTimer.stopTiming(); // Paper
this.methodProfiler.c("levels");
- SpigotTimings.schedulerTimer.startTiming(); // Spigot
+ SpigotTimings.bukkitSchedulerTimer.startTiming(); // Paper
+ MinecraftTimings.bukkitSchedulerTimer.startTiming(); // Paper
// CraftBukkit start
this.server.getScheduler().mainThreadHeartbeat(this.ticks);
- SpigotTimings.schedulerTimer.stopTiming(); // Spigot
+ SpigotTimings.bukkitSchedulerTimer.stopTiming(); // Paper
+ MinecraftTimings.bukkitSchedulerTimer.stopTiming(); // Paper
// Run tasks that are waiting on processing
SpigotTimings.processQueueTimer.startTiming(); // Spigot
- SpigotTimings.processQueueTimer.startTiming(); // Spigot
+ MinecraftTimings.processQueueTimer.startTiming(); // Spigot
while (!processQueue.isEmpty()) {
processQueue.remove().run();
}
- SpigotTimings.processQueueTimer.stopTiming(); // Spigot
+ MinecraftTimings.processQueueTimer.stopTiming(); // Spigot
- SpigotTimings.chunkIOTickTimer.startTiming(); // Spigot
+ MinecraftTimings.chunkIOTickTimer.startTiming(); // Spigot
org.bukkit.craftbukkit.chunkio.ChunkIOExecutor.tick();
- SpigotTimings.chunkIOTickTimer.stopTiming(); // Spigot
+ MinecraftTimings.chunkIOTickTimer.stopTiming(); // Spigot
- SpigotTimings.timeUpdateTimer.startTiming(); // Spigot
+ MinecraftTimings.timeUpdateTimer.startTiming(); // Spigot
// Send time updates to everyone, it will get the right time from the world the player is in.
if (this.ticks % 20 == 0) {
for (int i = 0; i < this.getPlayerList().players.size(); ++i) {
@@ -748,7 +751,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
entityplayer.playerConnection.sendPacket(new PacketPlayOutUpdateTime(entityplayer.world.getTime(), entityplayer.getPlayerTime(), entityplayer.world.getGameRules().getBoolean("doDaylightCycle"))); // Add support for per player time
}
}
- SpigotTimings.timeUpdateTimer.stopTiming(); // Spigot
+ MinecraftTimings.timeUpdateTimer.stopTiming(); // Spigot
int i;
@@ -805,9 +808,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
this.methodProfiler.b();
this.methodProfiler.a("tracker");
- worldserver.timings.tracker.startTiming(); // Spigot
worldserver.getTracker().updatePlayers();
- worldserver.timings.tracker.stopTiming(); // Spigot
this.methodProfiler.b();
this.methodProfiler.b();
// } // CraftBukkit
@@ -816,20 +817,20 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
}
this.methodProfiler.c("connection");
- SpigotTimings.connectionTimer.startTiming(); // Spigot
+ MinecraftTimings.connectionTimer.startTiming(); // Spigot
this.am().c();
- SpigotTimings.connectionTimer.stopTiming(); // Spigot
+ MinecraftTimings.connectionTimer.stopTiming(); // Spigot
this.methodProfiler.c("players");
- SpigotTimings.playerListTimer.startTiming(); // Spigot
+ MinecraftTimings.playerListTimer.startTiming(); // Spigot
this.v.tick();
- SpigotTimings.playerListTimer.stopTiming(); // Spigot
+ MinecraftTimings.playerListTimer.stopTiming(); // Spigot
this.methodProfiler.c("tickables");
- SpigotTimings.tickablesTimer.startTiming(); // Spigot
+ MinecraftTimings.tickablesTimer.startTiming(); // Spigot
for (i = 0; i < this.o.size(); ++i) {
((ITickable) this.o.get(i)).c();
}
- SpigotTimings.tickablesTimer.stopTiming(); // Spigot
+ MinecraftTimings.tickablesTimer.stopTiming(); // Spigot
this.methodProfiler.b();
}
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index eb39362..085bb83 100644
index 711b037..5599845 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -58,6 +58,7 @@ import org.bukkit.inventory.CraftingInventory;
import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.inventory.InventoryView;
import org.bukkit.util.NumberConversions;
+import co.aikar.timings.SpigotTimings; // Paper
+import co.aikar.timings.MinecraftTimings; // Paper
// CraftBukkit end
public class PlayerConnection implements PacketListenerPlayIn, ITickable {
@ -493,7 +628,7 @@ index eb39362..085bb83 100644
private void handleCommand(String s) {
- org.bukkit.craftbukkit.SpigotTimings.playerCommandTimer.startTiming(); // Spigot
+ SpigotTimings.playerCommandTimer.startTiming(); // Paper
+ MinecraftTimings.playerCommandTimer.startTiming(); // Paper
// CraftBukkit start - whole method
if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot
this.LOGGER.info(this.player.getName() + " issued server command: " + s);
@ -502,30 +637,30 @@ index eb39362..085bb83 100644
if (event.isCancelled()) {
- org.bukkit.craftbukkit.SpigotTimings.playerCommandTimer.stopTiming(); // Spigot
+ SpigotTimings.playerCommandTimer.stopTiming(); // Paper
+ MinecraftTimings.playerCommandTimer.stopTiming(); // Paper
return;
}
try {
if (this.server.dispatchCommand(event.getPlayer(), event.getMessage().substring(1))) {
- org.bukkit.craftbukkit.SpigotTimings.playerCommandTimer.stopTiming(); // Spigot
+ SpigotTimings.playerCommandTimer.stopTiming(); // Paper
+ MinecraftTimings.playerCommandTimer.stopTiming(); // Paper
return;
}
} catch (org.bukkit.command.CommandException ex) {
player.sendMessage(org.bukkit.ChatColor.RED + "An internal error occurred while attempting to perform this command");
java.util.logging.Logger.getLogger(PlayerConnection.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- org.bukkit.craftbukkit.SpigotTimings.playerCommandTimer.stopTiming(); // Spigot
+ SpigotTimings.playerCommandTimer.stopTiming(); // Paper
+ MinecraftTimings.playerCommandTimer.stopTiming(); // Paper
return;
}
- org.bukkit.craftbukkit.SpigotTimings.playerCommandTimer.stopTiming(); // Spigot
+ SpigotTimings.playerCommandTimer.stopTiming(); // Paper
+ MinecraftTimings.playerCommandTimer.stopTiming(); // Paper
// this.minecraftServer.getCommandHandler().a(this.player, s);
// CraftBukkit end
}
diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java
index e6524e9..4193f20 100644
index e6524e9..20bf384 100644
--- a/src/main/java/net/minecraft/server/TileEntity.java
+++ b/src/main/java/net/minecraft/server/TileEntity.java
@@ -6,12 +6,13 @@ import java.util.concurrent.Callable;
@ -533,14 +668,14 @@ index e6524e9..4193f20 100644
import org.apache.logging.log4j.Logger;
-import org.spigotmc.CustomTimingsHandler; // Spigot
+import co.aikar.timings.SpigotTimings; // Paper
+import co.aikar.timings.MinecraftTimings; // Paper
+import co.aikar.timings.Timing; // Paper
import org.bukkit.inventory.InventoryHolder; // CraftBukkit
public abstract class TileEntity {
- public CustomTimingsHandler tickTimer = org.bukkit.craftbukkit.SpigotTimings.getTileEntityTimings(this); // Spigot
+ public Timing tickTimer = SpigotTimings.getTileEntityTimings(this); // Paper
+ public Timing tickTimer = MinecraftTimings.getTileEntityTimings(this); // Paper
private static final Logger a = LogManager.getLogger();
private static Map<String, Class<? extends TileEntity>> f = Maps.newHashMap();
private static Map<Class<? extends TileEntity>, String> g = Maps.newHashMap();
@ -948,7 +1083,7 @@ index 41d2d87..0000000
- }
-}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 0756c81..888823c 100644
index 6d13b62..dc5ddb1 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -37,15 +37,9 @@ import org.bukkit.configuration.serialization.DelegateDeserialization;
@ -982,7 +1117,7 @@ index 0756c81..888823c 100644
public Player.Spigot spigot()
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
index 93d8d42..44e057c 100644
index 93d8d42..2a22697 100644
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
@@ -186,7 +186,7 @@ public class CraftScheduler implements BukkitScheduler {
@ -990,7 +1125,7 @@ index 93d8d42..44e057c 100644
}
return false;
- }});
+ }}){{this.timings=co.aikar.timings.SpigotTimings.getCancelTasksTimer();}}; // Paper
+ }}){{this.timings=co.aikar.timings.MinecraftTimings.getCancelTasksTimer();}}; // Paper
handle(task, 0l);
for (CraftTask taskPending = head.getNext(); taskPending != null; taskPending = taskPending.getNext()) {
if (taskPending == task) {
@ -999,7 +1134,7 @@ index 93d8d42..44e057c 100644
}
}
- });
+ }){{this.timings=co.aikar.timings.SpigotTimings.getCancelTasksTimer(plugin);}}; // Paper
+ }){{this.timings=co.aikar.timings.MinecraftTimings.getCancelTasksTimer(plugin);}}; // Paper
handle(task, 0l);
for (CraftTask taskPending = head.getNext(); taskPending != null; taskPending = taskPending.getNext()) {
if (taskPending == task) {
@ -1008,7 +1143,7 @@ index 93d8d42..44e057c 100644
CraftScheduler.this.temp.clear();
}
- });
+ }){{this.timings=co.aikar.timings.SpigotTimings.getCancelTasksTimer();}}; // Paper
+ }){{this.timings=co.aikar.timings.MinecraftTimings.getCancelTasksTimer();}}; // Paper
handle(task, 0l);
for (CraftTask taskPending = head.getNext(); taskPending != null; taskPending = taskPending.getNext()) {
if (taskPending == task) {
@ -1023,7 +1158,7 @@ index 93d8d42..44e057c 100644
task.getOwner().getLogger().log(
Level.WARNING,
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java
index 220e39a..ecbb0e5 100644
index 220e39a..afc6c17 100644
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java
@@ -1,8 +1,8 @@
@ -1032,7 +1167,7 @@ index 220e39a..ecbb0e5 100644
import org.bukkit.Bukkit;
-import org.bukkit.craftbukkit.SpigotTimings; // Spigot
-import org.spigotmc.CustomTimingsHandler; // Spigot
+import co.aikar.timings.SpigotTimings; // Paper
+import co.aikar.timings.MinecraftTimings; // Paper
+import co.aikar.timings.Timing; // Paper
import org.bukkit.plugin.Plugin;
import org.bukkit.scheduler.BukkitTask;
@ -1076,7 +1211,7 @@ index 220e39a..ecbb0e5 100644
- CraftTask(final Plugin plugin, final Runnable task, final int id, final long period) {
- this(null, plugin, task, id, period);
- // Spigot end
+ timings = task != null ? SpigotTimings.getPluginTaskTimings(this, period) : null; // Paper
+ timings = task != null ? MinecraftTimings.getPluginTaskTimings(this, period) : null; // Paper
}
public final int getTaskId() {
@ -1117,7 +1252,7 @@ index e52ef47..3d90b34 100644
this.value = value;
}
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
index e53092c..0b057fa 100644
index e53092c..499dc24 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java
@@ -29,7 +29,7 @@ import net.minecraft.server.EntityWither;
@ -1125,10 +1260,39 @@ index e53092c..0b057fa 100644
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.World;
-import org.bukkit.craftbukkit.SpigotTimings;
+import co.aikar.timings.SpigotTimings;
+import co.aikar.timings.MinecraftTimings;
public class ActivationRange
{
@@ -63,8 +63,8 @@ public class ActivationRange
/**
* These entities are excluded from Activation range checks.
*
- * @param entity
- * @param world
+ * @param entity Entity to initialize
+ * @param config Spigot config to determine ranges
* @return boolean If it should always tick.
*/
public static boolean initializeEntityActivationState(Entity entity, SpigotWorldConfig config)
@@ -97,7 +97,7 @@ public class ActivationRange
*/
public static void activateEntities(World world)
{
- SpigotTimings.entityActivationCheckTimer.startTiming();
+ MinecraftTimings.entityActivationCheckTimer.startTiming();
final int miscActivationRange = world.spigotConfig.miscActivationRange;
final int animalActivationRange = world.spigotConfig.animalActivationRange;
final int monsterActivationRange = world.spigotConfig.monsterActivationRange;
@@ -131,7 +131,7 @@ public class ActivationRange
}
}
}
- SpigotTimings.entityActivationCheckTimer.stopTiming();
+ MinecraftTimings.entityActivationCheckTimer.stopTiming();
}
/**
@@ -245,11 +245,9 @@ public class ActivationRange
*/
public static boolean checkIfActive(Entity entity)
@ -1150,5 +1314,5 @@ index e53092c..0b057fa 100644
}
}
--
2.8.0
2.8.1

View File

@ -1,4 +1,4 @@
From 0777499c5b969bd7241f6872ed59200d5ca6835a Mon Sep 17 00:00:00 2001
From c4769bc62dc29d598093e20269fd1f8213cb0f20 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Tue, 1 Mar 2016 14:32:43 -0600
Subject: [PATCH] Show 'Paper' in client crashes, server lists, and Mojang
@ -20,10 +20,10 @@ index c872029..fac5f88 100644
EULA.a.warn("Failed to save " + this.b, exception);
} finally {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index eac4e79..d901d2c 100644
index 8bfbc2c..b510e31 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1024,7 +1024,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
@@ -1023,7 +1023,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
}
public String getServerModName() {
@ -80,5 +80,5 @@ index 94a3d42..3ed983c 100644
log.log( Level.SEVERE, "------------------------------" );
//
--
2.7.4
2.8.1

View File

@ -1,17 +1,17 @@
From 72f0c84a2ce35945f2df3a37d9a7304a50e710da Mon Sep 17 00:00:00 2001
From 51306b297c90ec78be730733123a3e4be59904c7 Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net>
Date: Tue, 1 Mar 2016 23:45:08 -0600
Subject: [PATCH] Entity Origin API
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 9e84616..2d22842 100644
index 54367ef..9a8d534 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -142,6 +142,7 @@ public abstract class Entity implements ICommandListener {
public org.bukkit.projectiles.ProjectileSource projectileSource; // CraftBukkit - For projectiles only
public boolean forceExplosionKnockback; // CraftBukkit - SPIGOT-949
public Timing tickTimer = SpigotTimings.getEntityTimings(this); // Paper
public Timing tickTimer = MinecraftTimings.getEntityTimings(this); // Paper
+ public Location origin; // Paper
// Spigot start
public final byte activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this);
@ -147,5 +147,5 @@ index c493c9c..93843aa 100644
+ // Paper end
}
--
2.8.0
2.8.1

View File

@ -1,14 +1,14 @@
From 4458f44347f9ab06bb50e6608531a6039c5d0b3d Mon Sep 17 00:00:00 2001
From cf551879a447edab9e7fbbdbe01190b3663ad0dc Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net>
Date: Wed, 2 Mar 2016 00:52:31 -0600
Subject: [PATCH] Lighting Queue
diff --git a/src/main/java/co/aikar/timings/SpigotTimings.java b/src/main/java/co/aikar/timings/SpigotTimings.java
index 3f4271c..5fdf051 100644
--- a/src/main/java/co/aikar/timings/SpigotTimings.java
+++ b/src/main/java/co/aikar/timings/SpigotTimings.java
@@ -17,6 +17,7 @@ public final class SpigotTimings {
diff --git a/src/main/java/co/aikar/timings/MinecraftTimings.java b/src/main/java/co/aikar/timings/MinecraftTimings.java
index 0f8315c..5afdc2c 100644
--- a/src/main/java/co/aikar/timings/MinecraftTimings.java
+++ b/src/main/java/co/aikar/timings/MinecraftTimings.java
@@ -17,6 +17,7 @@ public final class MinecraftTimings {
public static final Timing timeUpdateTimer = Timings.ofSafe("Time Update");
public static final Timing serverCommandTimer = Timings.ofSafe("Server Command");
public static final Timing worldSaveTimer = Timings.ofSafe("World Save");
@ -147,12 +147,12 @@ index 7d3adde..54c83f3 100644
ChunkUnloadEvent event = new ChunkUnloadEvent(chunk.bukkitChunk);
server.getPluginManager().callEvent(event);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 3aac51d..24aa5b5 100644
index cd784a0..75f2605 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -47,6 +47,11 @@ import org.bukkit.craftbukkit.CraftServer;
// CraftBukkit end
import co.aikar.timings.SpigotTimings; // Paper
import co.aikar.timings.MinecraftTimings; // Paper
+// Paper start
+import java.util.LinkedList;
@ -170,14 +170,13 @@ index 3aac51d..24aa5b5 100644
// CraftBukkit end
public MinecraftServer(OptionSet options, Proxy proxy, DataConverterManager dataconvertermanager, YggdrasilAuthenticationService yggdrasilauthenticationservice, MinecraftSessionService minecraftsessionservice, GameProfileRepository gameprofilerepository, UserCache usercache) {
@@ -759,6 +765,35 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
@@ -760,6 +766,34 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
this.methodProfiler.b();
this.methodProfiler.b();
this.methodProfiler.b();
this.methodProfiler.b();
+
+ // Paper start - Flush light updates
+ if (!lightingQueue.isEmpty()) {
+ SpigotTimings.lightingQueueTimer.startTiming();
+ MinecraftTimings.lightingQueueTimer.startTiming();
+
+ int updatesThisTick = 0;
+ long cachedTime = System.currentTimeMillis();
@ -199,7 +198,7 @@ index 3aac51d..24aa5b5 100644
+ }
+ }
+
+ SpigotTimings.lightingQueueTimer.stopTiming();
+ MinecraftTimings.lightingQueueTimer.stopTiming();
+ }
+ // Paper end
+
@ -230,5 +229,5 @@ index 3b84e27..1793995 100644
}
--
2.8.0
2.8.1

View File

@ -1,4 +1,4 @@
From e4f94a4f98e5082dc5522095541902f568b82c06 Mon Sep 17 00:00:00 2001
From 5fbcaa4e972f9256ae7660441955f23a98148ee1 Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net>
Date: Wed, 2 Mar 2016 11:59:48 -0600
Subject: [PATCH] Optimize explosions
@ -124,11 +124,11 @@ index ae49403..7e99b7d 100644
+ // Paper end
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 24aa5b5..ee9491f 100644
index 75f2605..d515dcb 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -900,6 +900,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
worldserver.timings.tracker.stopTiming(); // Spigot
@@ -898,6 +898,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
worldserver.getTracker().updatePlayers();
this.methodProfiler.b();
this.methodProfiler.b();
+ worldserver.explosionDensityCache.clear(); // Paper - Optimize explosions
@ -156,5 +156,5 @@ index 1793995..a9cda67 100644
public CraftWorld getWorld() {
return this.world;
--
2.8.0
2.8.1

View File

@ -1,4 +1,4 @@
From 722700414bcbb589d78ddd5fd87e32faa8146760 Mon Sep 17 00:00:00 2001
From b8ff86f276a84f71244e65081715bac5e4e8375b Mon Sep 17 00:00:00 2001
From: DemonWav <demonwav@gmail.com>
Date: Thu, 3 Mar 2016 01:44:39 -0600
Subject: [PATCH] Add Location support to tab completers (vanilla feature
@ -20,10 +20,10 @@ index 0e03d9a..a73542d 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index ee9491f..058735e 100644
index d515dcb..3420b8b 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1186,7 +1186,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
@@ -1184,7 +1184,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
return arraylist;
}
*/
@ -151,5 +151,5 @@ index 100d84a..a40218c 100644
public static CommandSender lastSender = null; // Nasty :(
--
2.8.0
2.8.1

View File

@ -1,14 +1,14 @@
From 11e2be232ed4dd1dd6cb9ffc043a90e99cb39541 Mon Sep 17 00:00:00 2001
From 8082519bb735558d60447b300f684c4b1ca9f539 Mon Sep 17 00:00:00 2001
From: DemonWav <demonwav@gmail.com>
Date: Wed, 30 Mar 2016 01:20:11 -0500
Subject: [PATCH] Add getEntity by UUID API
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 058735e..06dec17 100644
index 3420b8b..f46cf24 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1622,4 +1622,20 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
@@ -1620,4 +1620,20 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
return (Bukkit.getServer() instanceof CraftServer) ? ((CraftServer) Bukkit.getServer()).getServer() : null;
}
// CraftBukkit end
@ -57,5 +57,5 @@ index e957ed0..0a5301f 100644
// Paper end
}
--
2.8.0
2.8.1

View File

@ -1,4 +1,4 @@
From 58c6555de6de8075c9c1ebfca359e0e5c37707c2 Mon Sep 17 00:00:00 2001
From a1323acf735c05c96afd84a30ba5d9059f78582b Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 28 Apr 2016 00:57:27 -0400
Subject: [PATCH] remove null possibility for getServer singleton
@ -6,7 +6,7 @@ Subject: [PATCH] remove null possibility for getServer singleton
to stop IDE complaining about potential NPE
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index b1e6e5d..08997ea 100644
index 26380e7..6efc569 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -54,6 +54,7 @@ import java.util.Queue;
@ -25,7 +25,7 @@ index b1e6e5d..08997ea 100644
io.netty.util.ResourceLeakDetector.setEnabled( false ); // Spigot - disable
this.e = proxy;
this.U = yggdrasilauthenticationservice;
@@ -1620,7 +1622,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
@@ -1618,7 +1620,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
// CraftBukkit start
@Deprecated
public static MinecraftServer getServer() {