Merge remote-tracking branch 'origin/master' into pre/1.13

This commit is contained in:
Aikar 2018-09-03 10:32:30 -04:00
commit 06787e40db
2 changed files with 41 additions and 37 deletions

View File

@ -37,4 +37,5 @@ Hugo Manrique <hugmanrique@gmail.com>
Andrew Steinborn <git@steinborn.me>
willies952002 <admin@domnian.com>
MicleBrick <miclebrick@outlook.com>
Trigary <trigary0@gmail.com>
```

View File

@ -6,18 +6,21 @@ Subject: [PATCH] Timings v2
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 0000000000..984044b02a
index 000000000..2620ac0ff
--- /dev/null
+++ b/src/main/java/co/aikar/timings/MinecraftTimings.java
@@ -0,0 +0,0 @@
+package co.aikar.timings;
+package co.aickar.timings;
+
+import com.google.common.collect.MapMaker;
+import net.minecraft.server.*;
+import org.bukkit.plugin.Plugin;
+import org.bukkit.scheduler.BukkitTask;
+
+import org.bukkit.craftbukkit.scheduler.CraftTask;
+
+import java.util.Map;
+
+public final class MinecraftTimings {
+
+ public static final Timing playerListTimer = Timings.ofSafe("Player List");
@ -48,6 +51,8 @@ index 0000000000..984044b02a
+ public static final Timing antiXrayUpdateTimer = Timings.ofSafe("anti-xray - update");
+ public static final Timing antiXrayObfuscateTimer = Timings.ofSafe("anti-xray - obfuscate");
+
+ private static final Map<Class<? extends Runnable>, String> taskNameCache = new MapMaker().weakKeys().makeMap();
+
+ private MinecraftTimings() {}
+
+ /**
@ -71,12 +76,10 @@ index 0000000000..984044b02a
+ plugin = TimingsManager.getPluginByClassloader(taskClass);
+ }
+
+ final String taskname;
+ if (taskClass.isAnonymousClass()) {
+ taskname = taskClass.getName();
+ } else {
+ taskname = taskClass.getCanonicalName();
+ }
+ final String taskname = taskNameCache.computeIfAbsent(taskClass, clazz ->
+ clazz.isAnonymousClass() || clazz.isLocalClass()
+ ? clazz.getName()
+ : clazz.getCanonicalName());
+
+ StringBuilder name = new StringBuilder(64);
+ name.append("Task: ").append(taskname);
@ -141,7 +144,7 @@ index 0000000000..984044b02a
+}
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 0000000000..145cb274b0
index 000000000..145cb274b
--- /dev/null
+++ b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
@@ -0,0 +0,0 @@
@ -250,7 +253,7 @@ index 0000000000..145cb274b0
+ }
+}
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index d2efcca80a..4812da0dac 100644
index d2efcca80..4812da0da 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -0,0 +0,0 @@ import java.util.concurrent.TimeUnit;
@ -294,7 +297,7 @@ index d2efcca80a..4812da0dac 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java
index 8811dbc9b3..7818a3b6a7 100644
index 8811dbc9b..7818a3b6a 100644
--- a/src/main/java/net/minecraft/server/Block.java
+++ b/src/main/java/net/minecraft/server/Block.java
@@ -0,0 +0,0 @@ public class Block implements IMaterial {
@ -314,7 +317,7 @@ index 8811dbc9b3..7818a3b6a7 100644
private final float frictionFactor;
protected final BlockStateList<Block, IBlockData> blockStateList;
diff --git a/src/main/java/net/minecraft/server/ChunkMap.java b/src/main/java/net/minecraft/server/ChunkMap.java
index e3d1761b49..fbebd4591c 100644
index e3d1761b4..fbebd4591 100644
--- a/src/main/java/net/minecraft/server/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/ChunkMap.java
@@ -0,0 +0,0 @@ public class ChunkMap extends Long2ObjectOpenHashMap<Chunk> {
@ -345,7 +348,7 @@ index e3d1761b49..fbebd4591c 100644
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index 9e805c5d22..0034956af9 100644
index 9e805c5d2..0034956af 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider {
@ -386,7 +389,7 @@ index 9e805c5d22..0034956af9 100644
this.chunkLoader.saveChunk(this.world, ichunkaccess, unloaded); // Spigot
} catch (IOException ioexception) {
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
index df07b2b889..f969c036f3 100644
index df07b2b88..f969c036f 100644
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
@@ -0,0 +0,0 @@
@ -433,7 +436,7 @@ index df07b2b889..f969c036f3 100644
}
diff --git a/src/main/java/net/minecraft/server/CustomFunction.java b/src/main/java/net/minecraft/server/CustomFunction.java
index b7cdc495a3..8b9b076ded 100644
index b7cdc495a..8b9b076de 100644
--- a/src/main/java/net/minecraft/server/CustomFunction.java
+++ b/src/main/java/net/minecraft/server/CustomFunction.java
@@ -0,0 +0,0 @@ public class CustomFunction {
@ -460,7 +463,7 @@ index b7cdc495a3..8b9b076ded 100644
return this.b;
}
diff --git a/src/main/java/net/minecraft/server/CustomFunctionData.java b/src/main/java/net/minecraft/server/CustomFunctionData.java
index 4d7e151793..40ff72f725 100644
index 4d7e15179..40ff72f72 100644
--- a/src/main/java/net/minecraft/server/CustomFunctionData.java
+++ b/src/main/java/net/minecraft/server/CustomFunctionData.java
@@ -0,0 +0,0 @@ public class CustomFunctionData implements ITickable, IResourcePackListener {
@ -473,7 +476,7 @@ index 4d7e151793..40ff72f725 100644
int j = 0;
CustomFunction.c[] acustomfunction_c = customfunction.b();
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
index efa738d4ec..dabad6b055 100644
index efa738d4e..dabad6b05 100644
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Level;
@ -526,7 +529,7 @@ index efa738d4ec..dabad6b055 100644
return waitable.get();
} catch (java.util.concurrent.ExecutionException e) {
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 591ae114cf..ec5c9fd735 100644
index 591ae114c..ec5c9fd73 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -0,0 +0,0 @@ import org.bukkit.command.CommandSender;
@ -565,7 +568,7 @@ index 591ae114cf..ec5c9fd735 100644
protected float ab() {
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 8d33c16580..603208caf8 100644
index 8d33c1658..603208caf 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -0,0 +0,0 @@ import org.bukkit.event.entity.EntityTeleportEvent;
@ -641,7 +644,7 @@ index 8d33c16580..603208caf8 100644
}
diff --git a/src/main/java/net/minecraft/server/EntityTracker.java b/src/main/java/net/minecraft/server/EntityTracker.java
index ae31935c48..70c9b1f50c 100644
index ae31935c4..70c9b1f50 100644
--- a/src/main/java/net/minecraft/server/EntityTracker.java
+++ b/src/main/java/net/minecraft/server/EntityTracker.java
@@ -0,0 +0,0 @@ public class EntityTracker {
@ -672,7 +675,7 @@ index ae31935c48..70c9b1f50c 100644
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 2c69e68276..0ebe754619 100644
index 2c69e6827..0ebe75461 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -0,0 +0,0 @@
@ -825,7 +828,7 @@ index 2c69e68276..0ebe754619 100644
this.methodProfiler.e();
}
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index ac6d8cc6e6..d975c2ccf1 100644
index ac6d8cc6e..d975c2ccf 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -0,0 +0,0 @@
@ -919,7 +922,7 @@ index ac6d8cc6e6..d975c2ccf1 100644
}
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 1c57f6e738..ca19c6c172 100644
index 996ffbdfa..2a734eb67 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -0,0 +0,0 @@ import org.bukkit.inventory.CraftingInventory;
@ -958,7 +961,7 @@ index 1c57f6e738..ca19c6c172 100644
// this.minecraftServer.getCommandDispatcher().a(this.player.getCommandListener(), s);
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/PlayerConnectionUtils.java b/src/main/java/net/minecraft/server/PlayerConnectionUtils.java
index 616797dc6e..3a5daf6705 100644
index 616797dc6..3a5daf670 100644
--- a/src/main/java/net/minecraft/server/PlayerConnectionUtils.java
+++ b/src/main/java/net/minecraft/server/PlayerConnectionUtils.java
@@ -0,0 +0,0 @@
@ -979,7 +982,7 @@ index 616797dc6e..3a5daf6705 100644
throw CancelledPacketHandleException.INSTANCE;
}
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index ead9697e65..26df2ff32f 100644
index ead9697e6..26df2ff32 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -0,0 +0,0 @@
@ -1003,7 +1006,7 @@ index ead9697e65..26df2ff32f 100644
public WhiteList getWhitelist() {
diff --git a/src/main/java/net/minecraft/server/TickListServer.java b/src/main/java/net/minecraft/server/TickListServer.java
index a07895935e..ee5c2421bb 100644
index a07895935..ee5c2421b 100644
--- a/src/main/java/net/minecraft/server/TickListServer.java
+++ b/src/main/java/net/minecraft/server/TickListServer.java
@@ -0,0 +0,0 @@ public class TickListServer<T> implements TickList<T> {
@ -1057,7 +1060,7 @@ index a07895935e..ee5c2421bb 100644
}
diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java
index c69209497b..68ac014aab 100644
index c69209497..68ac014aa 100644
--- a/src/main/java/net/minecraft/server/TileEntity.java
+++ b/src/main/java/net/minecraft/server/TileEntity.java
@@ -0,0 +0,0 @@ import javax.annotation.Nullable;
@ -1077,7 +1080,7 @@ index c69209497b..68ac014aab 100644
private final TileEntityTypes<?> e; public TileEntityTypes getTileEntityType() { return e; } // Paper - OBFHELPER
protected World world;
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 169294b3c3..2f7fab0907 100644
index 169294b3c..2f7fab090 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@
@ -1192,7 +1195,7 @@ index 169294b3c3..2f7fab0907 100644
public boolean a(@Nullable Entity entity, VoxelShape voxelshape) {
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index c276c259ae..badec349b7 100644
index c276c259a..badec349b 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -0,0 +0,0 @@
@ -1299,7 +1302,7 @@ index c276c259ae..badec349b7 100644
// CraftBukkit start
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 46a9ff9482..9ba50a2daa 100644
index 46a9ff948..9ba50a2da 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -0,0 +0,0 @@ public final class CraftServer implements Server {
@ -1336,7 +1339,7 @@ index 46a9ff9482..9ba50a2daa 100644
org.spigotmc.RestartCommand.restart();
diff --git a/src/main/java/org/bukkit/craftbukkit/SpigotTimings.java b/src/main/java/org/bukkit/craftbukkit/SpigotTimings.java
deleted file mode 100644
index 4c8ab2bc97..0000000000
index 4c8ab2bc9..000000000
--- a/src/main/java/org/bukkit/craftbukkit/SpigotTimings.java
+++ /dev/null
@@ -0,0 +0,0 @@
@ -1515,7 +1518,7 @@ index 4c8ab2bc97..0000000000
- }
-}
diff --git a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java
index 413dd35f06..52a8c48fa4 100644
index 413dd35f0..52a8c48fa 100644
--- a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java
+++ b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java
@@ -0,0 +0,0 @@
@ -1551,7 +1554,7 @@ index 413dd35f06..52a8c48fa4 100644
public void callStage3(QueuedChunk queuedChunk, Chunk chunk, Runnable runnable) throws RuntimeException {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 9f78f2c4ae..b8bdcb6b74 100644
index 9f78f2c4a..b8bdcb6b7 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -1568,7 +1571,7 @@ index 9f78f2c4ae..b8bdcb6b74 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 f11bd7545f..93b9134d6e 100644
index f11bd7545..93b9134d6 100644
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
@@ -0,0 +0,0 @@ import java.util.concurrent.atomic.AtomicInteger;
@ -1644,7 +1647,7 @@ index f11bd7545f..93b9134d6e 100644
private boolean isReady(final int currentTick) {
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java
index 7e7ce9a81b..46029ce246 100644
index 7e7ce9a81..46029ce24 100644
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java
@@ -0,0 +0,0 @@
@ -1726,7 +1729,7 @@ index 7e7ce9a81b..46029ce246 100644
- // Spigot end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftIconCache.java b/src/main/java/org/bukkit/craftbukkit/util/CraftIconCache.java
index e52ef47b78..3d90b34268 100644
index e52ef47b7..3d90b3426 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftIconCache.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftIconCache.java
@@ -0,0 +0,0 @@ import org.bukkit.util.CachedServerIcon;
@ -1738,7 +1741,7 @@ index e52ef47b78..3d90b34268 100644
this.value = value;
}
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
index e60fe5a920..f68e42c4d4 100644
index e60fe5a92..f68e42c4d 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java
@@ -0,0 +0,0 @@ import net.minecraft.server.EntityWither;