Commits

md_5 authored 34287dbe611
SPIGOT-2642: Proper shutdown when restart script non existent
No tags

CraftBukkit-Patches/0010-Spigot-Timings.patch

Modified
1 -From cd3890fdfc55f7a91203c30ca275a738cd922b4c Mon Sep 17 00:00:00 2001
1 +From 797f8d7cd087b3b37c2570bb302491138bd9f77c Mon Sep 17 00:00:00 2001
2 2 From: Aikar <aikar@aikar.co>
3 3 Date: Thu, 10 Jan 2013 00:18:11 -0500
4 4 Subject: [PATCH] Spigot Timings
5 5
6 6 Overhauls the Timings System adding performance tracking all around the Minecraft Server
7 7
8 8 diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
9 9 index ead421a..38f303d 100644
10 10 --- a/src/main/java/net/minecraft/server/Chunk.java
11 11 +++ b/src/main/java/net/minecraft/server/Chunk.java
39 39 try {
40 40 @@ -169,6 +170,7 @@ public class ChunkProviderServer implements IChunkProvider {
41 41 this.chunks.put(k, chunk);
42 42 chunk.addEntities();
43 43 chunk.loadNearby(this, this.chunkGenerator, true); // CraftBukkit
44 44 + world.timings.syncChunkLoadTimer.stopTiming(); // Spigot
45 45 }
46 46
47 47 return chunk;
48 48 diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
49 -index 5c333de..3de34be 100644
49 +index b1ad28c..f604639 100644
50 50 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
51 51 +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
52 52 @@ -46,7 +46,9 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
53 53 // CraftBukkit start - Add async variant, provide compatibility
54 54 @Nullable
55 55 public Chunk a(World world, int i, int j) throws IOException {
56 56 + world.timings.syncChunkLoadDataTimer.startTiming(); // Spigot
57 57 Object[] data = loadChunk(world, i, j);
58 58 + world.timings.syncChunkLoadDataTimer.stopTiming(); // Spigot
59 59 if (data != null) {
60 60 Chunk chunk = (Chunk) data[0];
61 61 NBTTagCompound nbttagcompound = (NBTTagCompound) data[1];
62 -@@ -385,7 +387,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
62 +@@ -392,7 +394,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
63 63
64 64 public void loadEntities(Chunk chunk, NBTTagCompound nbttagcompound, World world) {
65 65 // CraftBukkit end
66 66 -
67 67 + world.timings.syncChunkLoadEntitiesTimer.startTiming(); // Spigot
68 68 NBTTagList nbttaglist1 = nbttagcompound.getList("Entities", 10);
69 69
70 70 if (nbttaglist1 != null) {
71 -@@ -396,7 +398,8 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
71 +@@ -403,7 +405,8 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
72 72 chunk.g(true);
73 73 }
74 74 }
75 75 -
76 76 + world.timings.syncChunkLoadEntitiesTimer.stopTiming(); // Spigot
77 77 + world.timings.syncChunkLoadTileEntitiesTimer.startTiming(); // Spigot
78 78 NBTTagList nbttaglist2 = nbttagcompound.getList("TileEntities", 10);
79 79
80 80 if (nbttaglist2 != null) {
81 -@@ -409,6 +412,8 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
81 +@@ -416,6 +419,8 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
82 82 }
83 83 }
84 84 }
85 85 + world.timings.syncChunkLoadTileEntitiesTimer.stopTiming(); // Spigot
86 86 + world.timings.syncChunkLoadTileTicksTimer.startTiming(); // Spigot
87 87
88 88 if (nbttagcompound.hasKeyOfType("TileTicks", 9)) {
89 89 NBTTagList nbttaglist3 = nbttagcompound.getList("TileTicks", 10);
90 -@@ -428,6 +433,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
90 +@@ -435,6 +440,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
91 91 }
92 92 }
93 93 }
94 94 + world.timings.syncChunkLoadTileTicksTimer.stopTiming(); // Spigot
95 95
96 96 // return chunk; // CraftBukkit
97 97 }
98 98 diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
99 99 index 66ae6c0..59b124a 100644
100 100 --- a/src/main/java/net/minecraft/server/DedicatedServer.java
566 566 this.ao();
567 567 + timings.doSounds.stopTiming(); // Spigot
568 568
569 569 + timings.doChunkGC.startTiming();// Spigot
570 570 this.getWorld().processChunkGC(); // CraftBukkit
571 571 + timings.doChunkGC.stopTiming(); // Spigot
572 572 }
573 573
574 574 @Nullable
575 575 diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
576 -index 56440b8..5f2f290 100644
576 +index 344ad24..f267752 100644
577 577 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
578 578 +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
579 579 @@ -1675,6 +1675,11 @@ public final class CraftServer implements Server {
580 580 private final Spigot spigot = new Spigot()
581 581 {
582 582
583 583 + @Override
584 584 + public YamlConfiguration getConfig()
585 585 + {
586 586 + return org.spigotmc.SpigotConfig.config;

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut