diff --git a/Spigot-API-Patches/LootTable-API.patch b/Spigot-API-Patches/LootTable-API.patch index af94a0c25..9de66287b 100644 --- a/Spigot-API-Patches/LootTable-API.patch +++ b/Spigot-API-Patches/LootTable-API.patch @@ -308,8 +308,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 /** * Represents a chest. */ --public interface Chest extends BlockState, InventoryHolder { -+public interface Chest extends BlockState, InventoryHolder, LootableInventory { // Paper +-public interface Chest extends BlockState, InventoryHolder, Lockable { ++public interface Chest extends BlockState, InventoryHolder, Lockable, LootableInventory { // Paper /** * Returns the chest's inventory. If this is a double chest, it returns @@ -327,8 +327,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 /** * Represents a dispenser. */ --public interface Dispenser extends BlockState, InventoryHolder { -+public interface Dispenser extends BlockState, InventoryHolder, LootableInventory { // Paper +-public interface Dispenser extends BlockState, InventoryHolder, Lockable { ++public interface Dispenser extends BlockState, InventoryHolder, Lockable, LootableInventory { // Paper /** * Gets the BlockProjectileSource object for this dispenser. @@ -345,8 +345,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 /** * Represents a hopper. */ --public interface Hopper extends BlockState, InventoryHolder { -+public interface Hopper extends BlockState, InventoryHolder, LootableInventory { // Paper +-public interface Hopper extends BlockState, InventoryHolder, Lockable { ++public interface Hopper extends BlockState, InventoryHolder, Lockable, LootableInventory { // Paper } -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Add-exception-reporting-event.patch b/Spigot-Server-Patches/Add-exception-reporting-event.patch index 2f765a308..06eab5268 100644 --- a/Spigot-Server-Patches/Add-exception-reporting-event.patch +++ b/Spigot-Server-Patches/Add-exception-reporting-event.patch @@ -114,7 +114,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } } @@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider { - try (co.aikar.timings.Timing timed = world.timings.chunkSaveNop.startTiming()) { + try { this.chunkLoader.b(this.world, chunk); } catch (Exception exception) { - ChunkProviderServer.a.error("Couldn\'t save entities", exception); diff --git a/Spigot-Server-Patches/Auto-Save-Improvements.patch b/Spigot-Server-Patches/Auto-Save-Improvements.patch index 99a6386a2..23d87f872 100644 --- a/Spigot-Server-Patches/Auto-Save-Improvements.patch +++ b/Spigot-Server-Patches/Auto-Save-Improvements.patch @@ -91,6 +91,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } - if (autosavePeriod > 0 && this.ticks % autosavePeriod == 0) { // CraftBukkit + MinecraftTimings.worldSaveTimer.startTiming(); // Spigot this.methodProfiler.a("save"); + + serverAutoSave = (autosavePeriod > 0 && this.ticks % autosavePeriod == 0); // Paper @@ -111,6 +112,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // this.saveChunks(true); // Spigot End this.methodProfiler.b(); + MinecraftTimings.worldSaveTimer.stopTiming(); // Spigot - } + //} // Paper - Incremental Auto Saving @@ -126,17 +128,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (chunkproviderserver.e()) { - org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); // CraftBukkit + if (flag) org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); // CraftBukkit // Paper - Incremental Auto Saving - Only fire event on full save - timings.worldSave.startTiming(); // Paper -+ if (flag || server.serverAutoSave) { // Paper if (iprogressupdate != null) { iprogressupdate.a("Saving level"); } -@@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { + +- this.a(); ++ if (flag || server.serverAutoSave) this.a(); // Paper if (iprogressupdate != null) { iprogressupdate.c("Saving chunks"); } -+ } // Paper - - timings.worldSaveChunks.startTiming(); // Paper - chunkproviderserver.a(flag); -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Disable-Vanilla-Chunk-GC.patch b/Spigot-Server-Patches/Disable-Vanilla-Chunk-GC.patch index 46eadeb3f..6a52f7431 100644 --- a/Spigot-Server-Patches/Disable-Vanilla-Chunk-GC.patch +++ b/Spigot-Server-Patches/Disable-Vanilla-Chunk-GC.patch @@ -10,8 +10,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { + chunkproviderserver.a(flag); - timings.worldSaveChunks.stopTiming(); // Paper // CraftBukkit - ArrayList -> Collection - Collection arraylist = chunkproviderserver.a(); + /* //Paper start Collection arraylist = chunkproviderserver.a(); @@ -25,7 +25,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - } + }*/ + // Paper end - timings.worldSave.stopTiming(); // Paper + } } -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Lighting-Queue.patch b/Spigot-Server-Patches/Lighting-Queue.patch index 24ec84b50..829555a1d 100644 --- a/Spigot-Server-Patches/Lighting-Queue.patch +++ b/Spigot-Server-Patches/Lighting-Queue.patch @@ -10,8 +10,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/co/aikar/timings/WorldTimingsHandler.java +++ b/src/main/java/co/aikar/timings/WorldTimingsHandler.java @@ -0,0 +0,0 @@ public class WorldTimingsHandler { - public final Timing chunkSaveNop; - public final Timing chunkSaveData; + public final Timing chunkIOStage1; + public final Timing chunkIOStage2; + public final Timing lightingQueueTimer; + diff --git a/Spigot-Server-Patches/LootTable-API-Replenishable-Lootables-Feature.patch b/Spigot-Server-Patches/LootTable-API-Replenishable-Lootables-Feature.patch index b04806637..77e90e0af 100644 --- a/Spigot-Server-Patches/LootTable-API-Replenishable-Lootables-Feature.patch +++ b/Spigot-Server-Patches/LootTable-API-Replenishable-Lootables-Feature.patch @@ -666,8 +666,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import org.bukkit.craftbukkit.inventory.CraftInventoryDoubleChest; import org.bukkit.inventory.Inventory; --public class CraftChest extends CraftBlockState implements Chest { -+public class CraftChest extends CraftBlockState implements Chest, CraftLootableBlockInventory { // Paper +-public class CraftChest extends CraftContainer implements Chest { ++public class CraftChest extends CraftContainer implements Chest, CraftLootableBlockInventory { // Paper private final CraftWorld world; private final TileEntityChest chest; @@ -686,8 +686,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import org.bukkit.inventory.Inventory; import org.bukkit.projectiles.BlockProjectileSource; --public class CraftDispenser extends CraftBlockState implements Dispenser { -+public class CraftDispenser extends CraftBlockState implements Dispenser, CraftLootableBlockInventory { // Paper +-public class CraftDispenser extends CraftContainer implements Dispenser { ++public class CraftDispenser extends CraftContainer implements Dispenser, CraftLootableBlockInventory { // Paper private final CraftWorld world; private final TileEntityDispenser dispenser; @@ -706,8 +706,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import org.bukkit.craftbukkit.inventory.CraftInventory; import org.bukkit.inventory.Inventory; --public class CraftHopper extends CraftBlockState implements Hopper { -+public class CraftHopper extends CraftBlockState implements Hopper, CraftLootableBlockInventory { // Paper +-public class CraftHopper extends CraftContainer implements Hopper { ++public class CraftHopper extends CraftContainer implements Hopper, CraftLootableBlockInventory { // Paper private final TileEntityHopper hopper; public CraftHopper(final Block block) { diff --git a/Spigot-Server-Patches/Timings-v2.patch b/Spigot-Server-Patches/Timings-v2.patch index 8ea072fb6..93dfb2030 100644 --- a/Spigot-Server-Patches/Timings-v2.patch +++ b/Spigot-Server-Patches/Timings-v2.patch @@ -45,7 +45,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + public static final Timing chunkIOTickTimer = Timings.ofSafe("ChunkIOTick"); + public static final Timing timeUpdateTimer = Timings.ofSafe("Time Update"); + public static final Timing serverCommandTimer = Timings.ofSafe("Server Command"); -+ public static final Timing savePlayers = Timings.ofSafe("Save Players"); ++ public static final Timing worldSaveTimer = Timings.ofSafe("World Save"); + + public static final Timing tickEntityTimer = Timings.ofSafe("## tickEntity"); + public static final Timing tickTileEntityTimer = Timings.ofSafe("## tickTileEntity"); @@ -325,11 +325,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + public final Timing chunkGeneration; + public final Timing chunkIOStage1; + public final Timing chunkIOStage2; -+ public final Timing worldSave; -+ public final Timing worldSaveChunks; -+ public final Timing worldSaveLevel; -+ public final Timing chunkSaveNop; -+ public final Timing chunkSaveData; + + public WorldTimingsHandler(World server) { + String name = server.worldData.getName() +" - "; @@ -368,11 +363,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + chunkGeneration = Timings.ofSafe(name + "chunkGeneration"); + chunkIOStage1 = Timings.ofSafe(name + "ChunkIO Stage 1 - DiskIO"); + chunkIOStage2 = Timings.ofSafe(name + "ChunkIO Stage 2 - Post Load"); -+ worldSave = Timings.ofSafe(name + "World Save"); -+ worldSaveLevel = Timings.ofSafe(name + "World Save - Level"); -+ worldSaveChunks = Timings.ofSafe(name + "World Save - Chunks"); -+ chunkSaveNop = Timings.ofSafe(name + "Chunk Save - NOP"); -+ chunkSaveData = Timings.ofSafe(name + "Chunk Save - Data"); + + tracker1 = Timings.ofSafe(name + "tracker stage 1"); + tracker2 = Timings.ofSafe(name + "tracker stage 2"); @@ -492,28 +482,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } private void z() { -diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 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 { - } - - public void saveChunkNOP(Chunk chunk) { -- try { -+ try (co.aikar.timings.Timing timed = world.timings.chunkSaveNop.startTiming()) { - this.chunkLoader.b(this.world, chunk); - } catch (Exception exception) { - ChunkProviderServer.a.error("Couldn\'t save entities", exception); -@@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider { - } - - public void saveChunk(Chunk chunk) { -- try { -+ try (co.aikar.timings.Timing timed = world.timings.chunkSaveData.startTiming()) { - chunk.setLastSaved(this.world.getTime()); - this.chunkLoader.a(this.world, chunk); - } catch (IOException ioexception) { diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -761,6 +729,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 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 @@ -769,6 +738,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // Spigot End this.methodProfiler.b(); - SpigotTimings.worldSaveTimer.stopTiming(); // Spigot ++ MinecraftTimings.worldSaveTimer.stopTiming(); // Spigot } this.methodProfiler.a("tallying"); @@ -1016,30 +986,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // this.minecraftServer.getCommandHandler().a(this.player, s); // CraftBukkit end } -diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/server/PlayerList.java -+++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -0,0 +0,0 @@ - package net.minecraft.server; - -+import co.aikar.timings.MinecraftTimings; - import com.google.common.collect.Lists; - import com.google.common.collect.Maps; - import com.google.common.collect.Sets; -@@ -0,0 +0,0 @@ public abstract class PlayerList { - } - - public void savePlayers() { -+ MinecraftTimings.savePlayers.startTiming(); // Paper - for (int i = 0; i < this.players.size(); ++i) { - this.savePlayerFile((EntityPlayer) this.players.get(i)); - } -- -+ MinecraftTimings.savePlayers.stopTiming(); // Paper - } - - public void addWhitelist(GameProfile gameprofile) { diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/StructureGenerator.java @@ -1298,49 +1244,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // CraftBukkit end } -@@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { - - if (chunkproviderserver.e()) { - org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); // CraftBukkit -+ timings.worldSave.startTiming(); // Paper - if (iprogressupdate != null) { - iprogressupdate.a("Saving level"); - } -@@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { - iprogressupdate.c("Saving chunks"); - } - -+ timings.worldSaveChunks.startTiming(); // Paper - chunkproviderserver.a(flag); -+ timings.worldSaveChunks.stopTiming(); // Paper - // CraftBukkit - ArrayList -> Collection - Collection arraylist = chunkproviderserver.a(); - Iterator iterator = arraylist.iterator(); -@@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { - chunkproviderserver.unload(chunk); - } - } -- -+ timings.worldSave.stopTiming(); // Paper - } - } - -@@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { - } - - protected void a() throws ExceptionWorldConflict { -+ timings.worldSaveLevel.startTiming(); // Paper - this.checkSession(); - WorldServer[] aworldserver = this.server.worldServer; - int i = aworldserver.length; -@@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { - this.worldData.e(this.getWorldBorder().i()); - this.dataManager.saveWorldData(this.worldData, this.server.getPlayerList().t()); - this.worldMaps.a(); -+ timings.worldSaveLevel.stopTiming(); // Paper - } - - // CraftBukkit start diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/work/Bukkit b/work/Bukkit index 450225fe1..cdf11d567 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit 450225fe17a930d7bb0de2d646c4a892d5bdcd7e +Subproject commit cdf11d567708cfb03453e4a139de7abc60f89cf9 diff --git a/work/CraftBukkit b/work/CraftBukkit index e20928f7d..b6490dada 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit e20928f7da265577c771b63ca7ce49c35ef19b2b +Subproject commit b6490dada59fa2f7777448c09f591384faa8333e