13
0
geforkt von Mirrors/Paper

Update upstream B/CB

Dieser Commit ist enthalten in:
Zach Brown 2016-10-21 15:28:44 -05:00
Ursprung 4708920d8d
Commit 2515c80051
9 geänderte Dateien mit 27 neuen und 126 gelöschten Zeilen

Datei anzeigen

@ -308,8 +308,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
/** /**
* Represents a chest. * Represents a chest.
*/ */
-public interface Chest extends BlockState, InventoryHolder { -public interface Chest extends BlockState, InventoryHolder, Lockable {
+public interface Chest extends BlockState, InventoryHolder, LootableInventory { // Paper +public interface Chest extends BlockState, InventoryHolder, Lockable, LootableInventory { // Paper
/** /**
* Returns the chest's inventory. If this is a double chest, it returns * Returns the chest's inventory. If this is a double chest, it returns
@ -327,8 +327,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
/** /**
* Represents a dispenser. * Represents a dispenser.
*/ */
-public interface Dispenser extends BlockState, InventoryHolder { -public interface Dispenser extends BlockState, InventoryHolder, Lockable {
+public interface Dispenser extends BlockState, InventoryHolder, LootableInventory { // Paper +public interface Dispenser extends BlockState, InventoryHolder, Lockable, LootableInventory { // Paper
/** /**
* Gets the BlockProjectileSource object for this dispenser. * Gets the BlockProjectileSource object for this dispenser.
@ -345,8 +345,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
/** /**
* Represents a hopper. * Represents a hopper.
*/ */
-public interface Hopper extends BlockState, InventoryHolder { -public interface Hopper extends BlockState, InventoryHolder, Lockable {
+public interface Hopper extends BlockState, InventoryHolder, LootableInventory { // Paper +public interface Hopper extends BlockState, InventoryHolder, Lockable, LootableInventory { // Paper
} }
-- --

Datei anzeigen

@ -114,7 +114,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} }
} }
@@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider { @@ -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); this.chunkLoader.b(this.world, chunk);
} catch (Exception exception) { } catch (Exception exception) {
- ChunkProviderServer.a.error("Couldn\'t save entities", exception); - ChunkProviderServer.a.error("Couldn\'t save entities", exception);

Datei anzeigen

@ -91,6 +91,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} }
- if (autosavePeriod > 0 && this.ticks % autosavePeriod == 0) { // CraftBukkit - if (autosavePeriod > 0 && this.ticks % autosavePeriod == 0) { // CraftBukkit
MinecraftTimings.worldSaveTimer.startTiming(); // Spigot
this.methodProfiler.a("save"); this.methodProfiler.a("save");
+ +
+ serverAutoSave = (autosavePeriod > 0 && this.ticks % autosavePeriod == 0); // Paper + serverAutoSave = (autosavePeriod > 0 && this.ticks % autosavePeriod == 0); // Paper
@ -111,6 +112,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// this.saveChunks(true); // this.saveChunks(true);
// Spigot End // Spigot End
this.methodProfiler.b(); this.methodProfiler.b();
MinecraftTimings.worldSaveTimer.stopTiming(); // Spigot
- } - }
+ //} // Paper - Incremental Auto Saving + //} // Paper - Incremental Auto Saving
@ -126,17 +128,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (chunkproviderserver.e()) { if (chunkproviderserver.e()) {
- org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); // CraftBukkit - 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 + 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) { if (iprogressupdate != null) {
iprogressupdate.a("Saving level"); 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) { if (iprogressupdate != null) {
iprogressupdate.c("Saving chunks"); iprogressupdate.c("Saving chunks");
} }
+ } // Paper
timings.worldSaveChunks.startTiming(); // Paper
chunkproviderserver.a(flag);
-- --

Datei anzeigen

@ -10,8 +10,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/WorldServer.java --- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/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 { @@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler {
chunkproviderserver.a(flag); chunkproviderserver.a(flag);
timings.worldSaveChunks.stopTiming(); // Paper
// CraftBukkit - ArrayList -> Collection // CraftBukkit - ArrayList -> Collection
- Collection arraylist = chunkproviderserver.a(); - Collection arraylist = chunkproviderserver.a();
+ /* //Paper start Collection arraylist = chunkproviderserver.a(); + /* //Paper start Collection arraylist = chunkproviderserver.a();
@ -25,7 +25,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- } - }
+ }*/ + }*/
+ // Paper end + // Paper end
timings.worldSave.stopTiming(); // Paper
} }
} }
-- --

Datei anzeigen

@ -10,8 +10,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/co/aikar/timings/WorldTimingsHandler.java --- a/src/main/java/co/aikar/timings/WorldTimingsHandler.java
+++ b/src/main/java/co/aikar/timings/WorldTimingsHandler.java +++ b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
@@ -0,0 +0,0 @@ public class WorldTimingsHandler { @@ -0,0 +0,0 @@ public class WorldTimingsHandler {
public final Timing chunkSaveNop; public final Timing chunkIOStage1;
public final Timing chunkSaveData; public final Timing chunkIOStage2;
+ public final Timing lightingQueueTimer; + public final Timing lightingQueueTimer;
+ +

Datei anzeigen

@ -666,8 +666,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
import org.bukkit.craftbukkit.inventory.CraftInventoryDoubleChest; import org.bukkit.craftbukkit.inventory.CraftInventoryDoubleChest;
import org.bukkit.inventory.Inventory; import org.bukkit.inventory.Inventory;
-public class CraftChest extends CraftBlockState implements Chest { -public class CraftChest extends CraftContainer implements Chest {
+public class CraftChest extends CraftBlockState implements Chest, CraftLootableBlockInventory { // Paper +public class CraftChest extends CraftContainer implements Chest, CraftLootableBlockInventory { // Paper
private final CraftWorld world; private final CraftWorld world;
private final TileEntityChest chest; private final TileEntityChest chest;
@ -686,8 +686,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
import org.bukkit.inventory.Inventory; import org.bukkit.inventory.Inventory;
import org.bukkit.projectiles.BlockProjectileSource; import org.bukkit.projectiles.BlockProjectileSource;
-public class CraftDispenser extends CraftBlockState implements Dispenser { -public class CraftDispenser extends CraftContainer implements Dispenser {
+public class CraftDispenser extends CraftBlockState implements Dispenser, CraftLootableBlockInventory { // Paper +public class CraftDispenser extends CraftContainer implements Dispenser, CraftLootableBlockInventory { // Paper
private final CraftWorld world; private final CraftWorld world;
private final TileEntityDispenser dispenser; private final TileEntityDispenser dispenser;
@ -706,8 +706,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
import org.bukkit.craftbukkit.inventory.CraftInventory; import org.bukkit.craftbukkit.inventory.CraftInventory;
import org.bukkit.inventory.Inventory; import org.bukkit.inventory.Inventory;
-public class CraftHopper extends CraftBlockState implements Hopper { -public class CraftHopper extends CraftContainer implements Hopper {
+public class CraftHopper extends CraftBlockState implements Hopper, CraftLootableBlockInventory { // Paper +public class CraftHopper extends CraftContainer implements Hopper, CraftLootableBlockInventory { // Paper
private final TileEntityHopper hopper; private final TileEntityHopper hopper;
public CraftHopper(final Block block) { public CraftHopper(final Block block) {

Datei anzeigen

@ -45,7 +45,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public static final Timing chunkIOTickTimer = Timings.ofSafe("ChunkIOTick"); + public static final Timing chunkIOTickTimer = Timings.ofSafe("ChunkIOTick");
+ public static final Timing timeUpdateTimer = Timings.ofSafe("Time Update"); + public static final Timing timeUpdateTimer = Timings.ofSafe("Time Update");
+ public static final Timing serverCommandTimer = Timings.ofSafe("Server Command"); + 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 tickEntityTimer = Timings.ofSafe("## tickEntity");
+ public static final Timing tickTileEntityTimer = Timings.ofSafe("## tickTileEntity"); + public static final Timing tickTileEntityTimer = Timings.ofSafe("## tickTileEntity");
@ -325,11 +325,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public final Timing chunkGeneration; + public final Timing chunkGeneration;
+ public final Timing chunkIOStage1; + public final Timing chunkIOStage1;
+ public final Timing chunkIOStage2; + 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) { + public WorldTimingsHandler(World server) {
+ String name = server.worldData.getName() +" - "; + String name = server.worldData.getName() +" - ";
@ -368,11 +363,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ chunkGeneration = Timings.ofSafe(name + "chunkGeneration"); + chunkGeneration = Timings.ofSafe(name + "chunkGeneration");
+ chunkIOStage1 = Timings.ofSafe(name + "ChunkIO Stage 1 - DiskIO"); + chunkIOStage1 = Timings.ofSafe(name + "ChunkIO Stage 1 - DiskIO");
+ chunkIOStage2 = Timings.ofSafe(name + "ChunkIO Stage 2 - Post Load"); + 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"); + tracker1 = Timings.ofSafe(name + "tracker stage 1");
+ tracker2 = Timings.ofSafe(name + "tracker stage 2"); + tracker2 = Timings.ofSafe(name + "tracker stage 2");
@ -492,28 +482,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} }
private void z() { 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 diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
@ -761,6 +729,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (autosavePeriod > 0 && this.ticks % autosavePeriod == 0) { // CraftBukkit if (autosavePeriod > 0 && this.ticks % autosavePeriod == 0) { // CraftBukkit
- SpigotTimings.worldSaveTimer.startTiming(); // Spigot - SpigotTimings.worldSaveTimer.startTiming(); // Spigot
+ MinecraftTimings.worldSaveTimer.startTiming(); // Spigot
this.methodProfiler.a("save"); this.methodProfiler.a("save");
this.v.savePlayers(); this.v.savePlayers();
// Spigot Start // Spigot Start
@ -769,6 +738,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// Spigot End // Spigot End
this.methodProfiler.b(); this.methodProfiler.b();
- SpigotTimings.worldSaveTimer.stopTiming(); // Spigot - SpigotTimings.worldSaveTimer.stopTiming(); // Spigot
+ MinecraftTimings.worldSaveTimer.stopTiming(); // Spigot
} }
this.methodProfiler.a("tallying"); this.methodProfiler.a("tallying");
@ -1016,30 +986,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// this.minecraftServer.getCommandHandler().a(this.player, s); // this.minecraftServer.getCommandHandler().a(this.player, s);
// CraftBukkit end // 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 diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/StructureGenerator.java --- a/src/main/java/net/minecraft/server/StructureGenerator.java
@ -1298,49 +1244,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// CraftBukkit end // 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 diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java

@ -1 +1 @@
Subproject commit 450225fe17a930d7bb0de2d646c4a892d5bdcd7e Subproject commit cdf11d567708cfb03453e4a139de7abc60f89cf9

@ -1 +1 @@
Subproject commit e20928f7da265577c771b63ca7ce49c35ef19b2b Subproject commit b6490dada59fa2f7777448c09f591384faa8333e