This commit is contained in:
Shane Freeder 2017-08-12 22:32:01 +01:00
parent dfd39f99e6
commit a6eb798352
17 changed files with 109 additions and 119 deletions

View file

@ -10,10 +10,9 @@ index 64c0f0a7..6da6abd8 100644
--- a/src/main/java/org/bukkit/metadata/MetadataStoreBase.java
+++ b/src/main/java/org/bukkit/metadata/MetadataStoreBase.java
@@ -0,0 +0,0 @@ public abstract class MetadataStoreBase<T> {
}
}
+ /**
/**
+ * Removes all metadata in the metadata store that originates from the
+ * given plugin.
+ *
@ -33,7 +32,8 @@ index 64c0f0a7..6da6abd8 100644
+ }
+ }
+
/**
+ /**
* Creates a unique name for the object receiving metadata by combining
* unique data from the subject with a metadataKey.
* <p>
--

View file

@ -9,10 +9,9 @@ index 67b0d516..21b2733f 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable {
*/
public Chunk getChunkAt(Block block);
+ /**
/**
+ * Used by {@link World#getChunkAtAsync(Location,ChunkLoadCallback)} methods
+ * to request a {@link Chunk} to be loaded, with this callback receiving
+ * the chunk when it is finished.
@ -84,7 +83,8 @@ index 67b0d516..21b2733f 100644
+ */
+ public void getChunkAtAsync(Block block, ChunkLoadCallback cb);
+
/**
+ /**
* Checks if the specified {@link Chunk} is loaded
*
* @param chunk The chunk to check
--

View file

@ -37,7 +37,7 @@ index f37491d7..30882559 100644
exp = expAmount;
}
+ /**
/**
+ * Get the source that provided the experience.
+ *
+ * @return The source of the experience
@ -48,7 +48,8 @@ index f37491d7..30882559 100644
+ }
+ // Paper end
+
/**
+ /**
* Get the amount of experience the player will receive
*
* @return The amount of experience
--

View file

@ -106,10 +106,9 @@ index 31b8f93e..360d2f08 100644
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -0,0 +0,0 @@
</dependency>
</dependencies>
</plugin>
- <plugin>
<plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>animal-sniffer-maven-plugin</artifactId>
- <version>1.15</version>
@ -129,9 +128,10 @@ index 31b8f93e..360d2f08 100644
- </signature>
- </configuration>
- </plugin>
<plugin>
- <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.0.0</version>
@@ -0,0 +0,0 @@
</execution>
</executions>

View file

@ -9,10 +9,9 @@ index 360d2f08..c6bdf44e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -0,0 +0,0 @@
</repositories>
<dependencies>
+ <dependency>
<dependency>
+ <groupId>net.sf.trove4j</groupId>
+ <artifactId>trove4j</artifactId>
+ <version>3.0.3</version>
@ -25,7 +24,8 @@ index 360d2f08..c6bdf44e 100644
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
<dependency>
+ <dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
--

View file

@ -89,7 +89,7 @@ index c8e52eab1..33737af78 100644
}
}
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index ba720204d..9449b645d 100644
index ae527d527..52490d02a 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -0,0 +0,0 @@ import java.util.Iterator;
@ -114,8 +114,8 @@ index ba720204d..9449b645d 100644
}
}
@@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider {
try (co.aikar.timings.Timing timed = world.timings.chunkSaveNop.startTiming()) {
this.chunkLoader.b(this.world, chunk);
try {
// this.chunkLoader.b(this.world, chunk); // Spigot
} catch (Exception exception) {
- ChunkProviderServer.a.error("Couldn\'t save entities", exception);
+ // Paper start
@ -128,7 +128,7 @@ index ba720204d..9449b645d 100644
}
@@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider {
chunk.setLastSaved(this.world.getTime());
this.chunkLoader.a(this.world, chunk);
this.chunkLoader.a(this.world, chunk, unloaded); // Spigot
} catch (IOException ioexception) {
- ChunkProviderServer.a.error("Couldn\'t save chunk", ioexception);
+ // Paper start

View file

@ -76,7 +76,7 @@ index a0b5cd56b..f98d380f6 100644
public Random a(long i) {
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index df3235981..067c53b12 100644
index a01356ccc..08bc8c928 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -0,0 +0,0 @@
@ -87,7 +87,7 @@ index df3235981..067c53b12 100644
import com.google.common.collect.Sets;
import it.unimi.dsi.fastutil.longs.Long2ObjectMap;
@@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider {
this.saveChunk(chunk);
this.saveChunk(chunk, false); // Spigot
chunk.f(false);
++i;
- if (i == 24 && !flag && false) { // Spigot
@ -96,7 +96,7 @@ index df3235981..067c53b12 100644
}
}
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 1d1948e9c..ef211aedd 100644
index ed4fc3096..299b1df9e 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting {

View file

@ -6,11 +6,11 @@ Subject: [PATCH] Chunk Save Reattempt
We commonly have "Stream Closed" errors on chunk saving, so this code should re-try to save the chunk in the event of failure and hopefully prevent rollbacks.
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
index cd976f09e..d1c13f00d 100644
index 772da28aa..6f2c192af 100644
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
NBTTagCompound nbttagcompound = chunk.compound; // Paper - Chunk queue improvements
// CraftBukkit
if (nbttagcompound != null) {
+ int attempts = 0; Exception laste = null; while (attempts++ < 5) { // Paper
@ -25,7 +25,7 @@ index cd976f09e..d1c13f00d 100644
+ try {Thread.sleep(10);} catch (InterruptedException e) {e.printStackTrace();} } // Paper
+ if (laste != null) { com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(laste); MinecraftServer.LOGGER.error("Failed to save chunk", laste); } // Paper
}
synchronized (lock) { if (this.b.get(chunkcoordintpair) == nbttagcompound) { this.b.remove(chunkcoordintpair); } }// Paper - This will not equal if a newer version is still pending
synchronized (lock) { if (this.b.get(chunkcoordintpair) == chunk.compoundSupplier) { this.b.remove(chunkcoordintpair); } }// Paper - This will not equal if a newer version is still pending
diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java
index 6a92b5af8..5bcbd718f 100644

View file

@ -8,7 +8,7 @@ Adds a command line flag to enable stats on how chunk saves are processing.
Stats on current queue, how many was processed and how many were queued.
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index ef194312b..8fca62eec 100644
index 25f1d40db..09c0c3719 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 {
@ -55,7 +55,7 @@ index ef194312b..8fca62eec 100644
return false;
}
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
index 67753e0b1..ea91c0477 100644
index 023dddcb8..aaf1a2095 100644
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {

View file

@ -41,7 +41,7 @@ index 36689db74..3898ad8fa 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
index cdb0b1342..cd976f09e 100644
index 682b4230e..772da28aa 100644
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
@@ -0,0 +0,0 @@ import java.util.List;
@ -51,16 +51,18 @@ index cdb0b1342..cd976f09e 100644
+import java.util.concurrent.ConcurrentLinkedQueue; // Paper
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
// Spigot start
@@ -0,0 +0,0 @@ import org.spigotmc.SupplierUtils;
public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
+ private ConcurrentLinkedQueue<QueuedChunk> queue = new ConcurrentLinkedQueue<>(); // Paper - Chunk queue improvements
+ private final Object lock = new Object(); // Paper - Chunk queue improvements
private static final Logger a = LogManager.getLogger();
private final Map<ChunkCoordIntPair, NBTTagCompound> b = Maps.newConcurrentMap();
private final Map<ChunkCoordIntPair, Supplier<NBTTagCompound>> b = Maps.newConcurrentMap(); // Spigot
// CraftBukkit
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
protected void a(ChunkCoordIntPair chunkcoordintpair, NBTTagCompound nbttagcompound) {
protected void a(ChunkCoordIntPair chunkcoordintpair, Supplier<NBTTagCompound> nbttagcompound) { // Spigot
// CraftBukkit
// if (!this.c.contains(chunkcoordintpair))
- {
@ -75,7 +77,7 @@ index cdb0b1342..cd976f09e 100644
}
private synchronized boolean processSaveQueueEntry(boolean logCompletion) {
- Iterator<Map.Entry<ChunkCoordIntPair, NBTTagCompound>> iter = this.b.entrySet().iterator();
- Iterator<Map.Entry<ChunkCoordIntPair, Supplier<NBTTagCompound>>> iter = this.b.entrySet().iterator(); // Spigot
- if (!iter.hasNext()) {
+ // CraftBukkit start
+ // Paper start - Chunk queue improvements
@ -90,34 +92,31 @@ index cdb0b1342..cd976f09e 100644
return false;
} else {
- // CraftBukkit start
- Map.Entry<ChunkCoordIntPair, NBTTagCompound> entry = iter.next();
- Map.Entry<ChunkCoordIntPair, Supplier<NBTTagCompound>> entry = iter.next(); // Spigot
- ChunkCoordIntPair chunkcoordintpair = entry.getKey();
- NBTTagCompound nbttagcompound = entry.getValue();
- Supplier<NBTTagCompound> value = entry.getValue(); // Spigot
- // CraftBukkit end
+ ChunkCoordIntPair chunkcoordintpair = chunk.coords; // Paper - Chunk queue improvements
boolean flag;
try {
- // this.c.add(chunkcoordintpair);
- // NBTTagCompound nbttagcompound = (NBTTagCompound) this.b.remove(chunkcoordintpair);
- // CraftBukkit
+ //this.c.add(chunkcoordintpair);
+ //NBTTagCompound nbttagcompound = (NBTTagCompound) entry.getValue(); // CraftBukkit // Paper - Chunk queue improvements
+ NBTTagCompound nbttagcompound = chunk.compound; // Paper - Chunk queue improvements
// this.c.add(chunkcoordintpair);
- NBTTagCompound nbttagcompound = SupplierUtils.getIfExists(value); // Spigot
+ NBTTagCompound nbttagcompound = SupplierUtils.getIfExists(chunk.compoundSupplier); // Spigot // Paper
// CraftBukkit
if (nbttagcompound != null) {
try {
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
ChunkRegionLoader.a.error("Failed to save chunk", exception);
}
}
+ synchronized (lock) { if (this.b.get(chunkcoordintpair) == nbttagcompound) { this.b.remove(chunkcoordintpair); } }// Paper - This will not equal if a newer version is still pending
+ synchronized (lock) { if (this.b.get(chunkcoordintpair) == chunk.compoundSupplier) { this.b.remove(chunkcoordintpair); } }// Paper - This will not equal if a newer version is still pending
flag = true;
} finally {
- this.b.remove(chunkcoordintpair, nbttagcompound); // CraftBukkit
+ //this.b.remove(chunkcoordintpair, nbttagcompound); // CraftBukkit // Paper
- this.b.remove(chunkcoordintpair, value); // CraftBukkit // Spigot
+ //this.b.remove(chunkcoordintpair, value); // CraftBukkit // Spigot // Paper
}
return flag;
@ -129,11 +128,11 @@ index cdb0b1342..cd976f09e 100644
+ // Paper start - Chunk queue improvements
+ private static class QueuedChunk {
+ public ChunkCoordIntPair coords;
+ public NBTTagCompound compound;
+ public Supplier<NBTTagCompound> compoundSupplier;
+
+ public QueuedChunk(ChunkCoordIntPair coords, NBTTagCompound compound) {
+ public QueuedChunk(ChunkCoordIntPair coords, Supplier<NBTTagCompound> compoundSupplier) {
+ this.coords = coords;
+ this.compound = compound;
+ this.compoundSupplier = compoundSupplier;
+ }
+ }
+ // Paper end

View file

@ -8,7 +8,7 @@ Vanilla will double add Spider Jockeys to the world, so ignore already added.
Also add debug if something else tries to, and abort before world gets bad state
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
index d1c13f00d..5f999d275 100644
index cee77e7a3..f5366ebf0 100644
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {

View file

@ -6,11 +6,11 @@ Subject: [PATCH] Lighting Queue
This provides option to queue lighting updates to ensure they do not cause the server lag
diff --git a/src/main/java/co/aikar/timings/WorldTimingsHandler.java b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
index e7789117b..f90f5bf84 100644
index e0ad559b7..4eebd9fae 100644
--- 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 worldSaveLevel;
public final Timing chunkSaveData;
+ public final Timing lightingQueueTimer;
@ -85,7 +85,7 @@ index a4b7d0176..6def9debe 100644
TileEntity tileentity;
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index c1b0d6cea..ba720204d 100644
index 024ea5912..ae527d527 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 {

View file

@ -23,7 +23,7 @@ index efae01b1d..70b498c7b 100644
private void removeCorruptTEs() {
removeCorruptTEs = getBoolean("remove-corrupt-tile-entities", false);
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index 067c53b12..ef194312b 100644
index 08bc8c928..25f1d40db 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 {
@ -42,7 +42,7 @@ index 067c53b12..ef194312b 100644
while (iterator.hasNext()) {
Chunk chunk = (Chunk) iterator.next();
@@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider {
this.saveChunk(chunk);
this.saveChunk(chunk, false); // Spigot
chunk.f(false);
++i;
- if (!flag && i >= world.paperConfig.maxAutoSaveChunksPerTick) { // Spigot - // Paper - Incremental Auto Save - cap max per tick
@ -51,7 +51,7 @@ index 067c53b12..ef194312b 100644
}
}
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
index 3ed762f05..e90d08b0d 100644
index f5366ebf0..023dddcb8 100644
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] String based Action Bar API
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
index 1159eea1..38359517 100644
index 1159eea1a..38359517c 100644
--- a/src/main/java/net/minecraft/server/MCUtil.java
+++ b/src/main/java/net/minecraft/server/MCUtil.java
@@ -0,0 +0,0 @@
@ -62,14 +62,13 @@ index 1159eea1..38359517 100644
+ }
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index b65ac0c7..005c8a00 100644
index 41330c2a2..f30613672 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 {
}
// Paper start
+ @Override
@Override
+ public void sendActionBar(String message) {
+ if (getHandle().playerConnection == null || message == null || message.isEmpty()) return;
+ getHandle().playerConnection.sendPacket(new PacketPlayOutChat(new ChatComponentText(message), ChatMessageType.GAME_INFO));
@ -81,7 +80,8 @@ index b65ac0c7..005c8a00 100644
+ sendActionBar(org.bukkit.ChatColor.translateAlternateColorCodes(alternateChar, message));
+ }
+
@Override
+ @Override
public void setPlayerListHeaderFooter(BaseComponent[] header, BaseComponent[] footer) {
PacketPlayOutPlayerListHeaderFooter packet = new PacketPlayOutPlayerListHeaderFooter();
packet.header = header;
--

View file

@ -6,7 +6,7 @@ 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 00000000..1b33390d
index 000000000..1b33390de
--- /dev/null
+++ b/src/main/java/co/aikar/timings/MinecraftTimings.java
@@ -0,0 +0,0 @@
@ -137,7 +137,7 @@ index 00000000..1b33390d
+}
diff --git a/src/main/java/co/aikar/timings/TimedChunkGenerator.java b/src/main/java/co/aikar/timings/TimedChunkGenerator.java
new file mode 100644
index 00000000..089154f6
index 000000000..089154f62
--- /dev/null
+++ b/src/main/java/co/aikar/timings/TimedChunkGenerator.java
@@ -0,0 +0,0 @@
@ -274,7 +274,7 @@ index 00000000..089154f6
+}
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 00000000..e7789117
index 000000000..e0ad559b7
--- /dev/null
+++ b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
@@ -0,0 +0,0 @@
@ -327,7 +327,6 @@ index 00000000..e7789117
+ public final Timing worldSave;
+ public final Timing worldSaveChunks;
+ public final Timing worldSaveLevel;
+ public final Timing chunkSaveNop;
+ public final Timing chunkSaveData;
+
+ public WorldTimingsHandler(World server) {
@ -370,7 +369,6 @@ index 00000000..e7789117
+ 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");
@ -380,7 +378,7 @@ index 00000000..e7789117
+ }
+}
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index 5ab2cf6e..b5795b6d 100644
index 5ab2cf6ee..b5795b6d3 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;
@ -424,7 +422,7 @@ index 5ab2cf6e..b5795b6d 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java
index 2dca6dbc..35231096 100644
index 2dca6dbcb..352310960 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 {
@ -444,7 +442,7 @@ index 2dca6dbc..35231096 100644
public static int getId(Block block) {
return Block.REGISTRY.a(block); // CraftBukkit - decompile error
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index d268fec3..52f6242d 100644
index d268fec39..52f6242d7 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -0,0 +0,0 @@ public class Chunk {
@ -492,29 +490,20 @@ index d268fec3..52f6242d 100644
private void z() {
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index 9dcab42d..c1b0d6ce 100644
index 787b201fd..024ea5912 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) {
public void saveChunk(Chunk chunk, boolean unloaded) { // Spigot
- try {
+ try (co.aikar.timings.Timing timed = world.timings.chunkSaveData.startTiming()) {
chunk.setLastSaved(this.world.getTime());
this.chunkLoader.a(this.world, chunk);
this.chunkLoader.a(this.world, chunk, 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 9655a3ce..cdb0b134 100644
index a07e2c1fd..682b4230e 100644
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
@ -554,7 +543,7 @@ index 9655a3ce..cdb0b134 100644
// return chunk; // CraftBukkit
}
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
index 6f63a5a1..3b842591 100644
index 6f63a5a1d..3b8425915 100644
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
@@ -0,0 +0,0 @@ import java.io.PrintStream;
@ -607,7 +596,7 @@ index 6f63a5a1..3b842591 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 c2da96ea..6d47f384 100644
index c2da96eaf..6d47f384a 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.block.BlockFace;
@ -646,7 +635,7 @@ index c2da96ea..6d47f384 100644
public void recalcPosition() {
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 27580a93..35812d56 100644
index 27580a938..35812d561 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;
@ -717,7 +706,7 @@ index 27580a93..35812d56 100644
}
diff --git a/src/main/java/net/minecraft/server/EntityTracker.java b/src/main/java/net/minecraft/server/EntityTracker.java
index 284d1204..3aab5420 100644
index 284d1204d..3aab54206 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 {
@ -748,7 +737,7 @@ index 284d1204..3aab5420 100644
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index da9ad603..5b5c143b 100644
index da9ad6037..5b5c143b0 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -0,0 +0,0 @@ import org.bukkit.Bukkit;
@ -895,7 +884,7 @@ index da9ad603..5b5c143b 100644
this.methodProfiler.b();
}
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index eeac3499..e4ed2e99 100644
index eeac34998..e4ed2e991 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -0,0 +0,0 @@
@ -995,7 +984,7 @@ index eeac3499..e4ed2e99 100644
}
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index b679b136..03bbac73 100644
index b679b1363..03bbac737 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;
@ -1043,7 +1032,7 @@ index b679b136..03bbac73 100644
// CraftBukkit end
}
diff --git a/src/main/java/net/minecraft/server/PlayerConnectionUtils.java b/src/main/java/net/minecraft/server/PlayerConnectionUtils.java
index f74b0679..1fc632e0 100644
index f74b06794..1fc632e0c 100644
--- a/src/main/java/net/minecraft/server/PlayerConnectionUtils.java
+++ b/src/main/java/net/minecraft/server/PlayerConnectionUtils.java
@@ -0,0 +0,0 @@
@ -1073,7 +1062,7 @@ index f74b0679..1fc632e0 100644
+ // Paper end
}
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index c00aee88..b3356b40 100644
index c00aee885..b3356b40f 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -0,0 +0,0 @@
@ -1097,7 +1086,7 @@ index c00aee88..b3356b40 100644
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 74e3f42c..2580a4cf 100644
index 74e3f42cd..2580a4cf6 100644
--- a/src/main/java/net/minecraft/server/StructureGenerator.java
+++ b/src/main/java/net/minecraft/server/StructureGenerator.java
@@ -0,0 +0,0 @@
@ -1139,7 +1128,7 @@ index 74e3f42c..2580a4cf 100644
return flag;
}
diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java
index 5a5a588e..d2d4ff6f 100644
index 5a5a588e7..d2d4ff6fb 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;
@ -1159,7 +1148,7 @@ index 5a5a588e..d2d4ff6f 100644
private static final RegistryMaterials<MinecraftKey, Class<? extends TileEntity>> f = new RegistryMaterials();
protected World world;
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 1096c6c6..f06b82ec 100644
index 1096c6c66..f06b82ec5 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ import com.google.common.collect.Maps;
@ -1265,7 +1254,7 @@ index 1096c6c6..f06b82ec 100644
public boolean b(AxisAlignedBB axisalignedbb) {
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 8afe1d3d..00b09397 100644
index 8afe1d3d3..00b093976 100644
--- 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 {
@ -1399,7 +1388,7 @@ index 8afe1d3d..00b09397 100644
// CraftBukkit start
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index ec98b3a0..63bbcf0b 100644
index ec98b3a02..63bbcf0b1 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 {
@ -1410,10 +1399,10 @@ index ec98b3a0..63bbcf0b 100644
@Override
public YamlConfiguration getConfig()
{
return org.spigotmc.SpigotConfig.config;
@@ -0,0 +0,0 @@ public final class CraftServer implements Server {
}
+ @Override
@Override
+ public YamlConfiguration getBukkitConfig()
+ {
+ return configuration;
@ -1431,12 +1420,13 @@ index ec98b3a0..63bbcf0b 100644
+ return com.destroystokyo.paper.PaperConfig.config;
+ }
+
@Override
+ @Override
public void restart() {
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 311a2c3f..00000000
index 311a2c3f6..000000000
--- a/src/main/java/org/bukkit/craftbukkit/SpigotTimings.java
+++ /dev/null
@@ -0,0 +0,0 @@
@ -1615,7 +1605,7 @@ index 311a2c3f..00000000
- }
-}
diff --git a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java
index 3a95b446..b5efb9c3 100644
index 3a95b4465..b5efb9c3f 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 @@
@ -1659,7 +1649,7 @@ index 3a95b446..b5efb9c3 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 ca138fa6..d3890088 100644
index ca138fa65..d38900887 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 @@ import org.bukkit.configuration.serialization.DelegateDeserialization;
@ -1685,7 +1675,7 @@ index ca138fa6..d3890088 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 27725b20..19adb77b 100644
index 27725b20e..19adb77b5 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;
@ -1761,7 +1751,7 @@ index 27725b20..19adb77b 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 220e39ab..afc6c17e 100644
index 220e39abe..afc6c17e6 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 @@
@ -1843,7 +1833,7 @@ index 220e39ab..afc6c17e 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 e52ef47b..3d90b342 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;
@ -1855,7 +1845,7 @@ index e52ef47b..3d90b342 100644
this.value = value;
}
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
index 2bd690fd..38be7ed7 100644
index 2bd690fdf..38be7ed71 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;

View file

@ -20,22 +20,22 @@ Other changes:
configuration
diff --git a/pom.xml b/pom.xml
index 7f6f7fe8..d3661164 100644
index 7f6f7fe84..d36611644 100644
--- a/pom.xml
+++ b/pom.xml
@@ -0,0 +0,0 @@
<version>5.0.4</version>
<scope>compile</scope>
</dependency>
- <dependency>
<dependency>
- <groupId>jline</groupId>
- <artifactId>jline</artifactId>
- <version>2.12.1</version>
- <scope>compile</scope>
- </dependency>
<dependency>
- <dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.19.3</version>
@@ -0,0 +0,0 @@
<version>3.0.3</version>
<scope>compile</scope>
@ -96,7 +96,7 @@ index 7f6f7fe8..d3661164 100644
<groupId>org.apache.maven.plugins</groupId>
diff --git a/src/main/java/com/destroystokyo/paper/console/TerminalConsoleCommandSender.java b/src/main/java/com/destroystokyo/paper/console/TerminalConsoleCommandSender.java
new file mode 100644
index 00000000..685deaa0
index 000000000..685deaa0e
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/console/TerminalConsoleCommandSender.java
@@ -0,0 +0,0 @@
@ -119,7 +119,7 @@ index 00000000..685deaa0
+}
diff --git a/src/main/java/com/destroystokyo/paper/console/TerminalHandler.java b/src/main/java/com/destroystokyo/paper/console/TerminalHandler.java
new file mode 100644
index 00000000..d5bc6149
index 000000000..d5bc61490
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/console/TerminalHandler.java
@@ -0,0 +0,0 @@
@ -184,7 +184,7 @@ index 00000000..d5bc6149
+
+}
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
index 3b842591..059f6b6b 100644
index 3b8425915..059f6b6b5 100644
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
@@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
@ -237,7 +237,7 @@ index 3b842591..059f6b6b 100644
System.setOut(new PrintStream(new LoggerOutputStream(logger, Level.INFO), true));
System.setErr(new PrintStream(new LoggerOutputStream(logger, Level.WARN), true));
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index a4f44b39..ea2c5713 100644
index a4f44b39b..ea2c57137 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -0,0 +0,0 @@ import org.apache.commons.lang3.Validate;
@ -296,7 +296,7 @@ index a4f44b39..ea2c5713 100644
public boolean a(int i, String s) {
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index b8a0b67a..ebca377e 100644
index b8a0b67a9..ebca377e5 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -0,0 +0,0 @@ public abstract class PlayerList {
@ -310,7 +310,7 @@ index b8a0b67a..ebca377e 100644
this.k = new GameProfileBanList(PlayerList.a);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 444f2801..9c0b3c60 100644
index 444f28019..9c0b3c60e 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -0,0 +0,0 @@ import io.netty.buffer.ByteBuf;
@ -336,7 +336,7 @@ index 444f2801..9c0b3c60 100644
@Override
public PluginCommand getPluginCommand(String name) {
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index ec9508e9..d3d848f8 100644
index ec9508e90..d3d848f8c 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -0,0 +0,0 @@ import java.util.logging.Logger;
@ -378,7 +378,7 @@ index ec9508e9..d3d848f8 100644
if (Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) {
diff --git a/src/main/java/org/bukkit/craftbukkit/command/ColouredConsoleSender.java b/src/main/java/org/bukkit/craftbukkit/command/ColouredConsoleSender.java
deleted file mode 100644
index 26a2fb89..00000000
index 26a2fb894..000000000
--- a/src/main/java/org/bukkit/craftbukkit/command/ColouredConsoleSender.java
+++ /dev/null
@@ -0,0 +0,0 @@
@ -457,7 +457,7 @@ index 26a2fb89..00000000
- }
-}
diff --git a/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java b/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java
index 33e8ea02..1e3aae3b 100644
index 33e8ea02c..1e3aae3b8 100644
--- a/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java
+++ b/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java
@@ -0,0 +0,0 @@ import java.util.logging.Level;
@ -536,7 +536,7 @@ index 33e8ea02..1e3aae3b 100644
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java b/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java
index a0cdd231..0a181288 100644
index a0cdd2317..0a1812883 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java
@@ -0,0 +0,0 @@ public class ServerShutdownThread extends Thread {
@ -550,7 +550,7 @@ index a0cdd231..0a181288 100644
}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/TerminalConsoleWriterThread.java b/src/main/java/org/bukkit/craftbukkit/util/TerminalConsoleWriterThread.java
deleted file mode 100644
index b6409711..00000000
index b64097113..000000000
--- a/src/main/java/org/bukkit/craftbukkit/util/TerminalConsoleWriterThread.java
+++ /dev/null
@@ -0,0 +0,0 @@
@ -609,7 +609,7 @@ index b6409711..00000000
- }
-}
diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml
index 5cee8f00..08b6bb7f 100644
index 5cee8f00e..08b6bb7f9 100644
--- a/src/main/resources/log4j2.xml
+++ b/src/main/resources/log4j2.xml
@@ -0,0 +0,0 @@

@ -1 +1 @@
Subproject commit 5340a52690887488ebb8d88d6f4a7236eade58ca
Subproject commit 65e8124d1adfa77a02ecd619be8ee28f3e89cafd