@@ -1,4 +1,4 @@
|
||||
From 975bd5c6ca17b8323adefe96e8ac767b63e150c0 Mon Sep 17 00:00:00 2001
|
||||
From 30d1e78cd481297d45e30e4ca6d772b08aaf44e3 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Thu, 10 Jan 2013 00:18:11 -0500
|
||||
Subject: [PATCH] Improved Timings System
|
||||
@@ -19,10 +19,10 @@ Tracks nearly every point of minecraft internals and plugin events to give a goo
|
||||
create mode 100644 src/main/java/org/bukkit/craftbukkit/SpigotTimings.java
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||
index d5887a9..3772ad8 100644
|
||||
index 8b280ab..31e3fce 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||
@@ -103,6 +103,7 @@ public class ChunkProviderServer implements IChunkProvider {
|
||||
@@ -102,6 +102,7 @@ public class ChunkProviderServer implements IChunkProvider {
|
||||
// CraftBukkit end
|
||||
|
||||
if (chunk == null) {
|
||||
@@ -30,7 +30,7 @@ index d5887a9..3772ad8 100644
|
||||
chunk = this.loadChunk(i, j);
|
||||
if (chunk == null) {
|
||||
if (this.chunkProvider == null) {
|
||||
@@ -141,6 +142,7 @@ public class ChunkProviderServer implements IChunkProvider {
|
||||
@@ -140,6 +141,7 @@ public class ChunkProviderServer implements IChunkProvider {
|
||||
// CraftBukkit end
|
||||
|
||||
chunk.a(this, this, i, j);
|
||||
@@ -39,7 +39,7 @@ index d5887a9..3772ad8 100644
|
||||
|
||||
// CraftBukkit start - If we didn't need to load the chunk run the callback now
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index fabe3ab..ccc4858 100644
|
||||
index 8e743ec..8feb1d3 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -14,6 +14,7 @@ import org.bukkit.block.BlockFace;
|
||||
@@ -76,7 +76,7 @@ index fabe3ab..ccc4858 100644
|
||||
|
||||
protected void C() {
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index 15fbf69..350560e 100644
|
||||
index 9210d96..14854ac 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -513,6 +513,7 @@ public abstract class EntityLiving extends Entity {
|
||||
@@ -104,8 +104,8 @@ index 15fbf69..350560e 100644
|
||||
+ org.bukkit.craftbukkit.SpigotTimings.timerEntityTickRest.stopTiming(); // Spigot
|
||||
}
|
||||
|
||||
// CraftBukkit start - delegate so we can handle providing a reason for health being regained
|
||||
@@ -1265,6 +1269,7 @@ public abstract class EntityLiving extends Entity {
|
||||
// CraftBukkit start - Delegate so we can handle providing a reason for health being regained
|
||||
@@ -1267,6 +1271,7 @@ public abstract class EntityLiving extends Entity {
|
||||
}
|
||||
|
||||
public void c() {
|
||||
@@ -113,7 +113,7 @@ index 15fbf69..350560e 100644
|
||||
if (this.bX > 0) {
|
||||
--this.bX;
|
||||
}
|
||||
@@ -1316,6 +1321,7 @@ public abstract class EntityLiving extends Entity {
|
||||
@@ -1318,6 +1323,7 @@ public abstract class EntityLiving extends Entity {
|
||||
this.aA = this.yaw;
|
||||
}
|
||||
}
|
||||
@@ -121,7 +121,7 @@ index 15fbf69..350560e 100644
|
||||
|
||||
this.world.methodProfiler.b();
|
||||
this.world.methodProfiler.a("jump");
|
||||
@@ -1334,6 +1340,7 @@ public abstract class EntityLiving extends Entity {
|
||||
@@ -1336,6 +1342,7 @@ public abstract class EntityLiving extends Entity {
|
||||
|
||||
this.world.methodProfiler.b();
|
||||
this.world.methodProfiler.a("travel");
|
||||
@@ -129,7 +129,7 @@ index 15fbf69..350560e 100644
|
||||
this.bD *= 0.98F;
|
||||
this.bE *= 0.98F;
|
||||
this.bF *= 0.9F;
|
||||
@@ -1342,11 +1349,14 @@ public abstract class EntityLiving extends Entity {
|
||||
@@ -1344,11 +1351,14 @@ public abstract class EntityLiving extends Entity {
|
||||
this.aO *= this.bE();
|
||||
this.e(this.bD, this.bE);
|
||||
this.aO = f;
|
||||
@@ -145,7 +145,7 @@ index 15fbf69..350560e 100644
|
||||
this.world.methodProfiler.b();
|
||||
this.world.methodProfiler.a("looting");
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 43b5d96..28135f4 100644
|
||||
index 9930618..4010cbf 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -6,7 +6,6 @@ import java.security.KeyPair;
|
||||
@@ -156,7 +156,7 @@ index 43b5d96..28135f4 100644
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.logging.Level;
|
||||
@@ -21,6 +20,7 @@ import jline.console.ConsoleReader;
|
||||
@@ -19,6 +18,7 @@ import jline.console.ConsoleReader;
|
||||
import joptsimple.OptionSet;
|
||||
|
||||
import org.bukkit.World.Environment;
|
||||
@@ -164,7 +164,7 @@ index 43b5d96..28135f4 100644
|
||||
import org.bukkit.craftbukkit.util.Waitable;
|
||||
import org.bukkit.event.server.RemoteServerCommandEvent;
|
||||
import org.bukkit.event.world.WorldSaveEvent;
|
||||
@@ -399,7 +399,10 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
|
||||
@@ -397,7 +397,10 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
|
||||
currentTPS = (currentTPS * 0.95) + (1E9 / (curTime - lastTick) * 0.05);
|
||||
lastTick = curTime;
|
||||
MinecraftServer.currentTick++;
|
||||
@@ -175,15 +175,15 @@ index 43b5d96..28135f4 100644
|
||||
}
|
||||
// Spigot end
|
||||
} else {
|
||||
@@ -499,6 +502,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
|
||||
@@ -496,6 +499,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
|
||||
public void r() {
|
||||
this.methodProfiler.a("levels");
|
||||
|
||||
// CraftBukkit start - only send timeupdates to the people in that world
|
||||
+ SpigotTimings.schedulerTimer.startTiming(); // Spigot
|
||||
// CraftBukkit start
|
||||
this.server.getScheduler().mainThreadHeartbeat(this.ticks);
|
||||
|
||||
// Run tasks that are waiting on processing
|
||||
@@ -506,7 +510,10 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
|
||||
@@ -504,7 +508,10 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
|
||||
processQueue.remove().run();
|
||||
}
|
||||
|
||||
@@ -192,9 +192,9 @@ index 43b5d96..28135f4 100644
|
||||
org.bukkit.craftbukkit.chunkio.ChunkIOExecutor.tick();
|
||||
+ SpigotTimings.chunkIOTickTimer.stopTiming(); // Spigot
|
||||
|
||||
// Send timeupdates to everyone, it will get the right time from the world the player is in.
|
||||
// Send time updates to everyone, it will get the right time from the world the player is in.
|
||||
if (this.ticks % 20 == 0) {
|
||||
@@ -558,7 +565,9 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
|
||||
@@ -556,7 +563,9 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
|
||||
|
||||
this.methodProfiler.b();
|
||||
this.methodProfiler.a("tracker");
|
||||
@@ -204,7 +204,7 @@ index 43b5d96..28135f4 100644
|
||||
this.methodProfiler.b();
|
||||
this.methodProfiler.b();
|
||||
// } // CraftBukkit
|
||||
@@ -567,14 +576,20 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
|
||||
@@ -565,14 +574,20 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
|
||||
}
|
||||
|
||||
this.methodProfiler.c("connection");
|
||||
@@ -226,7 +226,7 @@ index 43b5d96..28135f4 100644
|
||||
this.methodProfiler.b();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index 9ea4ee6..60114e6 100644
|
||||
index 133c310..a2d95e3 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -963,6 +963,7 @@ public class PlayerConnection extends Connection {
|
||||
@@ -253,7 +253,7 @@ index 9ea4ee6..60114e6 100644
|
||||
}
|
||||
} 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(Level.SEVERE, null, ex);
|
||||
java.util.logging.Logger.getLogger(PlayerConnection.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||
+ org.bukkit.craftbukkit.SpigotTimings.playerCommandTimer.stopTiming(); // Spigot
|
||||
return;
|
||||
}
|
||||
@@ -279,7 +279,7 @@ index db3fc42..174546d 100644
|
||||
private static Map b = new HashMap();
|
||||
protected World world;
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index e79e82a..6cd8a99 100644
|
||||
index 307171b..0afe88d 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -13,6 +13,7 @@ import java.util.concurrent.Callable;
|
||||
@@ -381,7 +381,7 @@ index e79e82a..6cd8a99 100644
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index 8706874..8d2c73e 100644
|
||||
index 5a49b4d..e41dfba 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -169,9 +169,12 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
|
||||
|
||||
Reference in New Issue
Block a user