|
|
|
@ -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
|
|
|
|
|
|
|
|
|
|