From 878e963fc642a13117fa6cc1ff8eb1d12152ba65 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 16 Jul 2018 00:32:35 -0400 Subject: [PATCH] Delete some dupe patches (should be fixed going forward) --- .../0096-EntityPathfindEvent.patch | 39 --------- ...uce-IO-ops-opening-a-new-region-file.patch | 53 ----------- ...egionFileCache-and-make-configurable.patch | 81 ----------------- .../0100-Use-Optimized-Collections.patch | 38 -------- ...-Do-not-load-chunks-for-light-checks.patch | 23 ----- ...0102-Add-PlayerUseUnknownEntityEvent.patch | 43 --------- ...dDebugInfo-not-initialized-on-client.patch | 21 ----- ...-Configurable-Grass-Spread-Tick-Rate.patch | 36 -------- ...le-Keep-Spawn-Loaded-range-per-world.patch | 87 ------------------- ...g-BlockPlaceEvent-triggering-physics.patch | 21 ----- ...am-reload-spawn-chunks-in-nether-end.patch | 33 ------- ...08-Remove-Debug-checks-from-DataBits.patch | 46 ---------- ...nilla-per-world-scoreboard-coloring-.patch | 55 ------------ ...nd-for-setting-passengers-on-players.patch | 32 ------- ...Remove-unused-World-Tile-Entity-List.patch | 71 --------------- 15 files changed, 679 deletions(-) delete mode 100644 Spigot-Server-Patches/0096-EntityPathfindEvent.patch delete mode 100644 Spigot-Server-Patches/0098-Reduce-IO-ops-opening-a-new-region-file.patch delete mode 100644 Spigot-Server-Patches/0099-Sanitise-RegionFileCache-and-make-configurable.patch delete mode 100644 Spigot-Server-Patches/0100-Use-Optimized-Collections.patch delete mode 100644 Spigot-Server-Patches/0101-Do-not-load-chunks-for-light-checks.patch delete mode 100644 Spigot-Server-Patches/0102-Add-PlayerUseUnknownEntityEvent.patch delete mode 100644 Spigot-Server-Patches/0103-Fix-reducedDebugInfo-not-initialized-on-client.patch delete mode 100644 Spigot-Server-Patches/0104-Configurable-Grass-Spread-Tick-Rate.patch delete mode 100644 Spigot-Server-Patches/0105-Configurable-Keep-Spawn-Loaded-range-per-world.patch delete mode 100644 Spigot-Server-Patches/0106-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch delete mode 100644 Spigot-Server-Patches/0107-Don-t-spam-reload-spawn-chunks-in-nether-end.patch delete mode 100644 Spigot-Server-Patches/0108-Remove-Debug-checks-from-DataBits.patch delete mode 100644 Spigot-Server-Patches/0109-Option-to-use-vanilla-per-world-scoreboard-coloring-.patch delete mode 100644 Spigot-Server-Patches/0110-Workaround-for-setting-passengers-on-players.patch delete mode 100644 Spigot-Server-Patches/0111-Remove-unused-World-Tile-Entity-List.patch diff --git a/Spigot-Server-Patches/0096-EntityPathfindEvent.patch b/Spigot-Server-Patches/0096-EntityPathfindEvent.patch deleted file mode 100644 index 6d205755d..000000000 --- a/Spigot-Server-Patches/0096-EntityPathfindEvent.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 341c685efb02986f52f829c1a7c56357ce0ad071 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Mon, 28 Mar 2016 21:22:26 -0400 -Subject: [PATCH] EntityPathfindEvent - -Fires when an Entity decides to start moving to a location. - -diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java -index cc44d30b5..3ac6f84d3 100644 ---- a/src/main/java/net/minecraft/server/NavigationAbstract.java -+++ b/src/main/java/net/minecraft/server/NavigationAbstract.java -@@ -4,7 +4,7 @@ import javax.annotation.Nullable; - - public abstract class NavigationAbstract { - -- protected EntityInsentient a; -+ protected EntityInsentient a; public Entity getEntity() { return a; } // Paper - OBFHELPER - protected World b; - @Nullable - protected PathEntity c; -@@ -74,6 +74,7 @@ public abstract class NavigationAbstract { - } else if (this.c != null && !this.c.b() && blockposition.equals(this.q)) { - return this.c; - } else { -+ if (!new com.destroystokyo.paper.event.entity.EntityPathfindEvent(getEntity().getBukkitEntity(), MCUtil.toLocation(getEntity().world, blockposition), null).callEvent()) { return null; } // Paper - this.q = blockposition; - float f = this.i(); - -@@ -98,6 +99,7 @@ public abstract class NavigationAbstract { - if (this.c != null && !this.c.b() && blockposition.equals(this.q)) { - return this.c; - } else { -+ if (!new com.destroystokyo.paper.event.entity.EntityPathfindEvent(getEntity().getBukkitEntity(), MCUtil.toLocation(entity.world, blockposition), entity.getBukkitEntity()).callEvent()) { return null; } // Paper - this.q = blockposition; - float f = this.i(); - --- -2.18.0 - diff --git a/Spigot-Server-Patches/0098-Reduce-IO-ops-opening-a-new-region-file.patch b/Spigot-Server-Patches/0098-Reduce-IO-ops-opening-a-new-region-file.patch deleted file mode 100644 index 5245e68f9..000000000 --- a/Spigot-Server-Patches/0098-Reduce-IO-ops-opening-a-new-region-file.patch +++ /dev/null @@ -1,53 +0,0 @@ -From b4237ef0e075d98a14b87bfd673d34b96cb1d966 Mon Sep 17 00:00:00 2001 -From: Antony Riley -Date: Tue, 29 Mar 2016 06:56:23 +0300 -Subject: [PATCH] Reduce IO ops opening a new region file. - - -diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java -index 5bcbd718f..2bd85e2d1 100644 ---- a/src/main/java/net/minecraft/server/RegionFile.java -+++ b/src/main/java/net/minecraft/server/RegionFile.java -@@ -8,9 +8,12 @@ import java.io.ByteArrayInputStream; - import java.io.ByteArrayOutputStream; - import java.io.DataInputStream; - import java.io.DataOutputStream; -+import java.io.EOFException; - import java.io.File; - import java.io.IOException; - import java.io.RandomAccessFile; -+import java.nio.ByteBuffer; -+import java.nio.IntBuffer; - import java.util.List; - import java.util.zip.DeflaterOutputStream; - import java.util.zip.GZIPInputStream; -@@ -67,8 +70,16 @@ public class RegionFile { - - int k; - -+ // Paper Start -+ ByteBuffer header = ByteBuffer.allocate(8192); -+ while (header.hasRemaining()) { -+ if (this.c.getChannel().read(header) == -1) throw new EOFException(); -+ } -+ header.clear(); -+ IntBuffer headerAsInts = header.asIntBuffer(); -+ // Paper End - for (j = 0; j < 1024; ++j) { -- k = this.c.readInt(); -+ k = headerAsInts.get(); // Paper - this.d[j] = k; - if (k != 0 && (k >> 8) + (k & 255) <= this.f.size()) { - for (int l = 0; l < (k & 255); ++l) { -@@ -78,7 +89,7 @@ public class RegionFile { - } - - for (j = 0; j < 1024; ++j) { -- k = this.c.readInt(); -+ k = headerAsInts.get(); // Paper - this.e[j] = k; - } - } catch (IOException ioexception) { --- -2.18.0 - diff --git a/Spigot-Server-Patches/0099-Sanitise-RegionFileCache-and-make-configurable.patch b/Spigot-Server-Patches/0099-Sanitise-RegionFileCache-and-make-configurable.patch deleted file mode 100644 index f9e5e728e..000000000 --- a/Spigot-Server-Patches/0099-Sanitise-RegionFileCache-and-make-configurable.patch +++ /dev/null @@ -1,81 +0,0 @@ -From cd7e6fdcb9ae8a70617251f82975bb67c14d51a0 Mon Sep 17 00:00:00 2001 -From: Antony Riley -Date: Tue, 29 Mar 2016 08:22:55 +0300 -Subject: [PATCH] Sanitise RegionFileCache and make configurable. - -RegionFileCache prior to this patch would close every single open region -file upon reaching a size of 256. -This patch modifies that behaviour so it closes the the least recently -used RegionFile. -The implementation uses a LinkedHashMap as an LRU cache (modified from HashMap). -The maximum size of the RegionFileCache is also made configurable. - -diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 2f6e169f5..ec4643384 100644 ---- a/src/main/java/com/destroystokyo/paper/PaperConfig.java -+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java -@@ -215,4 +215,9 @@ public class PaperConfig { - private static void loadPermsBeforePlugins() { - loadPermsBeforePlugins = getBoolean("settings.load-permissions-yml-before-plugins", true); - } -+ -+ public static int regionFileCacheSize = 256; -+ private static void regionFileCacheSize() { -+ regionFileCacheSize = getInt("settings.region-file-cache-size", 256); -+ } - } -diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java -index 5f9e9ddef..7e7565807 100644 ---- a/src/main/java/net/minecraft/server/RegionFileCache.java -+++ b/src/main/java/net/minecraft/server/RegionFileCache.java -@@ -8,10 +8,12 @@ import java.io.File; - import java.io.IOException; - import java.util.Iterator; - import java.util.Map; -+import com.destroystokyo.paper.PaperConfig; // Paper -+import java.util.LinkedHashMap; // Paper - - public class RegionFileCache { - -- public static final Map a = Maps.newHashMap(); // Spigot - private -> public -+ public static final Map a = new LinkedHashMap(PaperConfig.regionFileCacheSize, 0.75f, true); // Spigot - private -> public, Paper - HashMap -> LinkedHashMap - - public static synchronized RegionFile a(File file, int i, int j) { - File file1 = new File(file, "region"); -@@ -25,8 +27,8 @@ public class RegionFileCache { - file1.mkdirs(); - } - -- if (RegionFileCache.a.size() >= 256) { -- a(); -+ if (RegionFileCache.a.size() >= PaperConfig.regionFileCacheSize) { // Paper -+ trimCache(); // Paper - } - - RegionFile regionfile1 = new RegionFile(file2); -@@ -57,6 +59,22 @@ public class RegionFileCache { - } - } - -+ // Paper Start -+ private static synchronized void trimCache() { -+ Iterator> itr = RegionFileCache.a.entrySet().iterator(); -+ int count = RegionFileCache.a.size() - PaperConfig.regionFileCacheSize; -+ while (count-- >= 0 && itr.hasNext()) { -+ try { -+ itr.next().getValue().c(); -+ } catch (IOException ioexception) { -+ ioexception.printStackTrace(); -+ ServerInternalException.reportInternalException(ioexception); -+ } -+ itr.remove(); -+ } -+ } -+ // Paper End -+ - public static synchronized void a() { - Iterator iterator = RegionFileCache.a.values().iterator(); - --- -2.18.0 - diff --git a/Spigot-Server-Patches/0100-Use-Optimized-Collections.patch b/Spigot-Server-Patches/0100-Use-Optimized-Collections.patch deleted file mode 100644 index c164ab130..000000000 --- a/Spigot-Server-Patches/0100-Use-Optimized-Collections.patch +++ /dev/null @@ -1,38 +0,0 @@ -From d97129376d57c631b43c07d37bf8bc5af9081036 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Wed, 30 Mar 2016 02:13:24 -0400 -Subject: [PATCH] Use Optimized Collections - -Swap out CraftBukkit LongObjectHashMap with Long2ObjectOpenHashMap -Swap out Integer key HashMap for a Int2ObjectOpenHashMap For ChunkProviderServer - -Amaranth, the creator of LongObjectHashMap, tested it vs fastutil and determined fastutil to be 3x faster -and could not create anything faster than fastutil. - -These collections are super fast as seen -http://java-performance.info/hashmap-overview-jdk-fastutil-goldman-sachs-hppc-koloboke-trove-january-2015/ - -diff --git a/src/main/java/net/minecraft/server/DataWatcher.java b/src/main/java/net/minecraft/server/DataWatcher.java -index 1507f97fd..fe8484453 100644 ---- a/src/main/java/net/minecraft/server/DataWatcher.java -+++ b/src/main/java/net/minecraft/server/DataWatcher.java -@@ -12,6 +12,7 @@ import java.util.Map; - import java.util.concurrent.locks.ReadWriteLock; - import java.util.concurrent.locks.ReentrantReadWriteLock; - import javax.annotation.Nullable; -+import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; // Paper - import org.apache.commons.lang3.ObjectUtils; - import org.apache.logging.log4j.LogManager; - import org.apache.logging.log4j.Logger; -@@ -21,7 +22,7 @@ public class DataWatcher { - private static final Logger a = LogManager.getLogger(); - private static final Map, Integer> b = Maps.newHashMap(); - private final Entity c; -- private final Map> d = Maps.newHashMap(); -+ private final Map> d = new Int2ObjectOpenHashMap<>(); // Paper - private final ReadWriteLock e = new ReentrantReadWriteLock(); - private boolean f = true; - private boolean g; --- -2.18.0 - diff --git a/Spigot-Server-Patches/0101-Do-not-load-chunks-for-light-checks.patch b/Spigot-Server-Patches/0101-Do-not-load-chunks-for-light-checks.patch deleted file mode 100644 index 0d1bd8417..000000000 --- a/Spigot-Server-Patches/0101-Do-not-load-chunks-for-light-checks.patch +++ /dev/null @@ -1,23 +0,0 @@ -From e684a193f95395b7881bd0d96a1961ac00aa40b9 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Thu, 31 Mar 2016 19:17:58 -0400 -Subject: [PATCH] Do not load chunks for light checks - -Should only happen for blocks on the edge that uses neighbors light level -(certain blocks). In that case, there will be 3-4 other neighbors to get a light level from. - -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 119cd0636..5d5003920 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -764,6 +764,7 @@ public abstract class World implements IBlockAccess { - if (blockposition.getY() >= 256) { - blockposition = new BlockPosition(blockposition.getX(), 255, blockposition.getZ()); - } -+ if (!this.isLoaded(blockposition)) return 0; // Paper - - Chunk chunk = this.getChunkAtWorldCoords(blockposition); - --- -2.18.0 - diff --git a/Spigot-Server-Patches/0102-Add-PlayerUseUnknownEntityEvent.patch b/Spigot-Server-Patches/0102-Add-PlayerUseUnknownEntityEvent.patch deleted file mode 100644 index b6fa875d7..000000000 --- a/Spigot-Server-Patches/0102-Add-PlayerUseUnknownEntityEvent.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 7ab10243bd61164ab6a53c0753019ad649d244ce Mon Sep 17 00:00:00 2001 -From: Jedediah Smith -Date: Sat, 2 Apr 2016 05:09:16 -0400 -Subject: [PATCH] Add PlayerUseUnknownEntityEvent - - -diff --git a/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java b/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java -index c67cb54a3..521f46262 100644 ---- a/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java -+++ b/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java -@@ -5,7 +5,7 @@ import javax.annotation.Nullable; - - public class PacketPlayInUseEntity implements Packet { - -- private int a; -+ private int a; public int getEntityId() { return this.a; } // Paper - add accessor - private PacketPlayInUseEntity.EnumEntityUseAction action; - private Vec3D c; - private EnumHand d; -diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index e1b85ebae..7c708a0de 100644 ---- a/src/main/java/net/minecraft/server/PlayerConnection.java -+++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1657,6 +1657,16 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { - } - } - } -+ // Paper start - fire event -+ else { -+ this.server.getPluginManager().callEvent(new com.destroystokyo.paper.event.player.PlayerUseUnknownEntityEvent( -+ this.getPlayer(), -+ packetplayinuseentity.getEntityId(), -+ packetplayinuseentity.a() == PacketPlayInUseEntity.EnumEntityUseAction.ATTACK, -+ packetplayinuseentity.b() == EnumHand.MAIN_HAND ? EquipmentSlot.HAND : EquipmentSlot.OFF_HAND -+ )); -+ } -+ // Paper end - - } - --- -2.18.0 - diff --git a/Spigot-Server-Patches/0103-Fix-reducedDebugInfo-not-initialized-on-client.patch b/Spigot-Server-Patches/0103-Fix-reducedDebugInfo-not-initialized-on-client.patch deleted file mode 100644 index 571220ca9..000000000 --- a/Spigot-Server-Patches/0103-Fix-reducedDebugInfo-not-initialized-on-client.patch +++ /dev/null @@ -1,21 +0,0 @@ -From a57a1c5796e35a26f93d9d93f7c5da66e2d39429 Mon Sep 17 00:00:00 2001 -From: Jedediah Smith -Date: Sat, 2 Apr 2016 20:37:03 -0400 -Subject: [PATCH] Fix reducedDebugInfo not initialized on client - - -diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index bf7aaebd6..baf288210 100644 ---- a/src/main/java/net/minecraft/server/PlayerList.java -+++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -160,6 +160,7 @@ public abstract class PlayerList { - playerconnection.sendPacket(new PacketPlayOutServerDifficulty(worlddata.getDifficulty(), worlddata.isDifficultyLocked())); - playerconnection.sendPacket(new PacketPlayOutAbilities(entityplayer.abilities)); - playerconnection.sendPacket(new PacketPlayOutHeldItemSlot(entityplayer.inventory.itemInHandIndex)); -+ playerconnection.sendPacket(new PacketPlayOutEntityStatus(entityplayer, (byte) (worldserver.getGameRules().getBoolean("reducedDebugInfo") ? 22 : 23))); // Paper - fix this rule not being initialized on the client - this.f(entityplayer); - entityplayer.getStatisticManager().c(); - entityplayer.F().a(entityplayer); --- -2.18.0 - diff --git a/Spigot-Server-Patches/0104-Configurable-Grass-Spread-Tick-Rate.patch b/Spigot-Server-Patches/0104-Configurable-Grass-Spread-Tick-Rate.patch deleted file mode 100644 index 7bcc30af1..000000000 --- a/Spigot-Server-Patches/0104-Configurable-Grass-Spread-Tick-Rate.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 1c4d9e55d2affd7f99f33105071fa181e6c11f07 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Sun, 3 Apr 2016 16:28:17 -0400 -Subject: [PATCH] Configurable Grass Spread Tick Rate - - -diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 54f23ea75..6555f1373 100644 ---- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -276,4 +276,10 @@ public class PaperWorldConfig { - private void useInhabitedTime() { - useInhabitedTime = getBoolean("use-chunk-inhabited-timer", true); - } -+ -+ public int grassUpdateRate = 1; -+ private void grassUpdateRate() { -+ grassUpdateRate = Math.max(0, getInt("grass-spread-tick-rate", grassUpdateRate)); -+ log("Grass Spread Tick Rate: " + grassUpdateRate); -+ } - } -diff --git a/src/main/java/net/minecraft/server/BlockGrass.java b/src/main/java/net/minecraft/server/BlockGrass.java -index 8fc736d6a..b656994b2 100644 ---- a/src/main/java/net/minecraft/server/BlockGrass.java -+++ b/src/main/java/net/minecraft/server/BlockGrass.java -@@ -28,6 +28,7 @@ public class BlockGrass extends Block implements IBlockFragilePlantElement { - } - - public void b(World world, BlockPosition blockposition, IBlockData iblockdata, Random random) { -+ if (world.paperConfig.grassUpdateRate != 1 && (world.paperConfig.grassUpdateRate < 1 || (MinecraftServer.currentTick + blockposition.hashCode()) % world.paperConfig.grassUpdateRate != 0)) { return; } // Paper - if (!world.isClientSide) { - int lightLevel = -1; // Paper - if (world.getType(blockposition.up()).c() > 2 && (lightLevel = world.getLightLevel(blockposition.up())) < 4) { // Paper - move light check to end to avoid unneeded light lookups --- -2.18.0 - diff --git a/Spigot-Server-Patches/0105-Configurable-Keep-Spawn-Loaded-range-per-world.patch b/Spigot-Server-Patches/0105-Configurable-Keep-Spawn-Loaded-range-per-world.patch deleted file mode 100644 index adb03c575..000000000 --- a/Spigot-Server-Patches/0105-Configurable-Keep-Spawn-Loaded-range-per-world.patch +++ /dev/null @@ -1,87 +0,0 @@ -From 1cf126b0bdcfd085600588c678c1a9816c2ed64f Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Sat, 13 Sep 2014 23:14:43 -0400 -Subject: [PATCH] Configurable Keep Spawn Loaded range per world - -This lets you disable it for some worlds and lower it for others. - -diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 6555f1373..abc1aabdd 100644 ---- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -282,4 +282,10 @@ public class PaperWorldConfig { - grassUpdateRate = Math.max(0, getInt("grass-spread-tick-rate", grassUpdateRate)); - log("Grass Spread Tick Rate: " + grassUpdateRate); - } -+ -+ public short keepLoadedRange; -+ private void keepLoadedRange() { -+ keepLoadedRange = (short) (getInt("keep-spawn-loaded-range", Math.min(spigotConfig.viewDistance, 8)) * 16); -+ log( "Keep Spawn Loaded Range: " + (keepLoadedRange/16)); -+ } - } -diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 4e8ce79ff..2300ee10b 100644 ---- a/src/main/java/net/minecraft/server/MinecraftServer.java -+++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -357,8 +357,11 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs - long j = aw(); - i = 0; - -- for (int k = -192; k <= 192 && this.isRunning(); k += 16) { -- for (int l = -192; l <= 192 && this.isRunning(); l += 16) { -+ // Paper start -+ short radius = worldserver.paperConfig.keepLoadedRange; -+ for (int k = -radius; k <= radius && this.isRunning(); k += 16) { -+ for (int l = -radius; l <= radius && this.isRunning(); l += 16) { -+ // Paper end - long i1 = aw(); - - if (i1 - j > 1000L) { -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 5d5003920..671927d5c 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -3200,8 +3200,9 @@ public abstract class World implements IBlockAccess { - int k = i * 16 + 8 - blockposition.getX(); - int l = j * 16 + 8 - blockposition.getZ(); - boolean flag = true; -+ short keepLoadedRange = paperConfig.keepLoadedRange; // Paper - -- return k >= -128 && k <= 128 && l >= -128 && l <= 128 && this.keepSpawnInMemory; // CraftBukkit - Added 'this.keepSpawnInMemory' -+ return k >= -keepLoadedRange && k <= keepLoadedRange && l >= -keepLoadedRange && l <= keepLoadedRange && this.keepSpawnInMemory; // CraftBukkit - Added 'this.keepSpawnInMemory' // Paper - Re-add range var - } - - public void a(Packet packet) { -diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index d3e949707..054ac1b47 100644 ---- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java -+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -961,7 +961,7 @@ public final class CraftServer implements Server { - System.out.println("Preparing start region for level " + (console.worlds.size() - 1) + " (Seed: " + internal.getSeed() + ")"); - - if (internal.getWorld().getKeepSpawnInMemory()) { -- short short1 = 196; -+ short short1 = internal.paperConfig.keepLoadedRange; // Paper - long i = System.currentTimeMillis(); - for (int j = -short1; j <= short1; j += 16) { - for (int k = -short1; k <= short1; k += 16) { -diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 01fc193db..69dc11e2b 100644 ---- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1283,8 +1283,9 @@ public class CraftWorld implements World { - int chunkCoordX = chunkcoordinates.getX() >> 4; - int chunkCoordZ = chunkcoordinates.getZ() >> 4; - // Cycle through the 25x25 Chunks around it to load/unload the chunks. -- for (int x = -12; x <= 12; x++) { -- for (int z = -12; z <= 12; z++) { -+ int radius = world.paperConfig.keepLoadedRange / 16; // Paper -+ for (int x = -radius; x <= radius; x++) { // Paper -+ for (int z = -radius; z <= radius; z++) { // Paper - if (keepLoaded) { - loadChunk(chunkCoordX + x, chunkCoordZ + z); - } else { --- -2.18.0 - diff --git a/Spigot-Server-Patches/0106-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch b/Spigot-Server-Patches/0106-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch deleted file mode 100644 index c39847ba7..000000000 --- a/Spigot-Server-Patches/0106-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch +++ /dev/null @@ -1,21 +0,0 @@ -From 028a5e25797aa9af68282959cf9ef89755eade7c Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Sun, 3 Apr 2016 17:48:50 -0400 -Subject: [PATCH] Fix Cancelling BlockPlaceEvent triggering physics - - -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 671927d5c..1189720de 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -536,6 +536,7 @@ public abstract class World implements IBlockAccess { - } - - public void applyPhysics(BlockPosition blockposition, Block block, boolean flag) { -+ if (captureBlockStates) { return; } // Paper - Cancel all physics during placement - this.a(blockposition.west(), block, blockposition); - this.a(blockposition.east(), block, blockposition); - this.a(blockposition.down(), block, blockposition); --- -2.18.0 - diff --git a/Spigot-Server-Patches/0107-Don-t-spam-reload-spawn-chunks-in-nether-end.patch b/Spigot-Server-Patches/0107-Don-t-spam-reload-spawn-chunks-in-nether-end.patch deleted file mode 100644 index 371d429a8..000000000 --- a/Spigot-Server-Patches/0107-Don-t-spam-reload-spawn-chunks-in-nether-end.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 98af7220cc151b5d19148fabfc24c66f15fca41c Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Tue, 5 Apr 2016 19:42:22 -0400 -Subject: [PATCH] Don't spam reload spawn chunks in nether/end - - -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 1189720de..ad422b24b 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -3196,6 +3196,7 @@ public abstract class World implements IBlockAccess { - return this.P; - } - -+ public boolean shouldStayLoaded(int i, int j) { return e(i, j); } // Paper - OBFHELPER - public boolean e(int i, int j) { - BlockPosition blockposition = this.getSpawn(); - int k = i * 16 + 8 - blockposition.getX(); -diff --git a/src/main/java/net/minecraft/server/WorldProvider.java b/src/main/java/net/minecraft/server/WorldProvider.java -index d0265f960..35d8d1a6e 100644 ---- a/src/main/java/net/minecraft/server/WorldProvider.java -+++ b/src/main/java/net/minecraft/server/WorldProvider.java -@@ -138,6 +138,6 @@ public abstract class WorldProvider { - public void s() {} - - public boolean c(int i, int j) { -- return true; -+ return !this.b.shouldStayLoaded(i, j); // Paper - Use shouldStayLoaded check for all worlds - } - } --- -2.18.0 - diff --git a/Spigot-Server-Patches/0108-Remove-Debug-checks-from-DataBits.patch b/Spigot-Server-Patches/0108-Remove-Debug-checks-from-DataBits.patch deleted file mode 100644 index d6011b762..000000000 --- a/Spigot-Server-Patches/0108-Remove-Debug-checks-from-DataBits.patch +++ /dev/null @@ -1,46 +0,0 @@ -From d097ae862c5d2aa16d9ba2999604b63ef62734e5 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Tue, 5 Apr 2016 21:38:58 -0400 -Subject: [PATCH] Remove Debug checks from DataBits - -These are super hot and causing noticeable hits - -Before: http://i.imgur.com/nQsMzAE.png -After: http://i.imgur.com/nJ46crB.png - -diff --git a/src/main/java/net/minecraft/server/DataBits.java b/src/main/java/net/minecraft/server/DataBits.java -index f3a6799a8..fa0fd8a9c 100644 ---- a/src/main/java/net/minecraft/server/DataBits.java -+++ b/src/main/java/net/minecraft/server/DataBits.java -@@ -10,7 +10,7 @@ public class DataBits { - private final int d; - - public DataBits(int i, int j) { -- Validate.inclusiveBetween(1L, 32L, (long) i); -+ //Validate.inclusiveBetween(1L, 32L, (long) i); // Paper - this.d = j; - this.b = i; - this.c = (1L << i) - 1L; -@@ -18,8 +18,8 @@ public class DataBits { - } - - public void a(int i, int j) { -- Validate.inclusiveBetween(0L, (long) (this.d - 1), (long) i); -- Validate.inclusiveBetween(0L, this.c, (long) j); -+ //Validate.inclusiveBetween(0L, (long) (this.d - 1), (long) i); // Paper -+ //Validate.inclusiveBetween(0L, this.c, (long) j); // Paper - int k = i * this.b; - int l = k / 64; - int i1 = ((i + 1) * this.b - 1) / 64; -@@ -36,7 +36,7 @@ public class DataBits { - } - - public int a(int i) { -- Validate.inclusiveBetween(0L, (long) (this.d - 1), (long) i); -+ //Validate.inclusiveBetween(0L, (long) (this.d - 1), (long) i); // Paper - int j = i * this.b; - int k = j / 64; - int l = ((i + 1) * this.b - 1) / 64; --- -2.18.0 - diff --git a/Spigot-Server-Patches/0109-Option-to-use-vanilla-per-world-scoreboard-coloring-.patch b/Spigot-Server-Patches/0109-Option-to-use-vanilla-per-world-scoreboard-coloring-.patch deleted file mode 100644 index 9ebe89918..000000000 --- a/Spigot-Server-Patches/0109-Option-to-use-vanilla-per-world-scoreboard-coloring-.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 90ca9d579f3d73834d58123205d8db9cfe179b56 Mon Sep 17 00:00:00 2001 -From: Zach Brown -Date: Wed, 6 Apr 2016 01:04:23 -0500 -Subject: [PATCH] Option to use vanilla per-world scoreboard coloring on names - - -diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index abc1aabdd..6ea608ba9 100644 ---- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -288,4 +288,9 @@ public class PaperWorldConfig { - keepLoadedRange = (short) (getInt("keep-spawn-loaded-range", Math.min(spigotConfig.viewDistance, 8)) * 16); - log( "Keep Spawn Loaded Range: " + (keepLoadedRange/16)); - } -+ -+ public boolean useVanillaScoreboardColoring; -+ private void useVanillaScoreboardColoring() { -+ useVanillaScoreboardColoring = getBoolean("use-vanilla-world-scoreboard-name-coloring", false); -+ } - } -diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index e2202ed0c..88faa4601 100644 ---- a/src/main/java/net/minecraft/server/Entity.java -+++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2122,6 +2122,7 @@ public abstract class Entity implements ICommandListener, KeyedObject { // Paper - return this.getFlag(5); - } - -+ @Nullable public ScoreboardTeamBase getTeam() { return this.aY(); } // Paper - OBFHELPER - @Nullable - public ScoreboardTeamBase aY() { - if (!this.world.paperConfig.nonPlayerEntitiesOnScoreboards && !(this instanceof EntityHuman)) { return null; } // Paper -diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index ba1cc267e..2b8162917 100644 ---- a/src/main/java/net/minecraft/server/PlayerConnection.java -+++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1390,7 +1390,14 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { - return; - } - -- s = String.format(event.getFormat(), event.getPlayer().getDisplayName(), event.getMessage()); -+ // Paper Start - (Meh) Support for vanilla world scoreboard name coloring -+ String displayName = event.getPlayer().getDisplayName(); -+ if (this.player.getWorld().paperConfig.useVanillaScoreboardColoring) { -+ displayName = ScoreboardTeam.getPlayerDisplayName(this.player.getTeam(), player.getDisplayName()); -+ } -+ -+ s = String.format(event.getFormat(), displayName, event.getMessage()); -+ // Paper end - minecraftServer.console.sendMessage(s); - if (((LazyPlayerSet) event.getRecipients()).isLazy()) { - for (Object recipient : minecraftServer.getPlayerList().players) { --- -2.18.0 - diff --git a/Spigot-Server-Patches/0110-Workaround-for-setting-passengers-on-players.patch b/Spigot-Server-Patches/0110-Workaround-for-setting-passengers-on-players.patch deleted file mode 100644 index e737bcb33..000000000 --- a/Spigot-Server-Patches/0110-Workaround-for-setting-passengers-on-players.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 4eddf67039422c5c5b56b11ec90359c231ad5e31 Mon Sep 17 00:00:00 2001 -From: Zach Brown -Date: Sun, 10 Apr 2016 03:23:32 -0500 -Subject: [PATCH] Workaround for setting passengers on players - -SPIGOT-1915 & GH-114 - -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index e1d34d46d..6e2773cbb 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -628,6 +628,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player { - return true; - } - -+ // Paper start - Ugly workaround for SPIGOT-1915 & GH-114 -+ @Override -+ public boolean setPassenger(org.bukkit.entity.Entity passenger) { -+ boolean wasSet = super.setPassenger(passenger); -+ if (wasSet) { -+ this.getHandle().playerConnection.sendPacket(new net.minecraft.server.PacketPlayOutMount(this.getHandle())); -+ } -+ return wasSet; -+ } -+ // Paper end -+ - @Override - public void setSneaking(boolean sneak) { - getHandle().setSneaking(sneak); --- -2.18.0 - diff --git a/Spigot-Server-Patches/0111-Remove-unused-World-Tile-Entity-List.patch b/Spigot-Server-Patches/0111-Remove-unused-World-Tile-Entity-List.patch deleted file mode 100644 index 641b0c4f9..000000000 --- a/Spigot-Server-Patches/0111-Remove-unused-World-Tile-Entity-List.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 924f55aabda02b31745c2c49433e560cd4f2d692 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Wed, 13 Apr 2016 00:25:28 -0400 -Subject: [PATCH] Remove unused World Tile Entity List - -Massive hit to performance and it is completely unnecessary. - -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index ad422b24b..5f92355db 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -69,7 +69,7 @@ public abstract class World implements IBlockAccess { - }; - // Spigot end - protected final Set f = Sets.newHashSet(); // Paper -- public final List tileEntityList = Lists.newArrayList(); -+ //public final List tileEntityList = Lists.newArrayList(); // Paper - remove unused list - public final List tileEntityListTick = Lists.newArrayList(); - private final List b = Lists.newArrayList(); - private final Set tileEntityListUnload = Sets.newHashSet(); // Paper -@@ -1570,7 +1570,7 @@ public abstract class World implements IBlockAccess { - timings.tileEntityTick.startTiming(); // Spigot - if (!this.tileEntityListUnload.isEmpty()) { - this.tileEntityListTick.removeAll(this.tileEntityListUnload); -- this.tileEntityList.removeAll(this.tileEntityListUnload); -+ //this.tileEntityList.removeAll(this.tileEntityListUnload); // Paper - remove unused list - this.tileEntityListUnload.clear(); - } - -@@ -1623,7 +1623,7 @@ public abstract class World implements IBlockAccess { - if (tileentity.y()) { - tilesThisCycle--; - this.tileEntityListTick.remove(tileTickPosition--); -- this.tileEntityList.remove(tileentity); -+ //this.tileEntityList.remove(tileentity); // Paper - remove unused list - if (this.isLoaded(tileentity.getPosition())) { - this.getChunkAtWorldCoords(tileentity.getPosition()).d(tileentity.getPosition()); - } -@@ -1653,7 +1653,7 @@ public abstract class World implements IBlockAccess { - this.notify(tileentity1.getPosition(), iblockdata, iblockdata, 3); - // CraftBukkit start - // From above, don't screw this up - SPIGOT-1746 -- if (!this.tileEntityList.contains(tileentity1)) { -+ if (true) { // Paper - remove unused list - this.a(tileentity1); - } - // CraftBukkit end -@@ -1673,9 +1673,9 @@ public abstract class World implements IBlockAccess { - protected void l() {} - - public boolean a(TileEntity tileentity) { -- boolean flag = this.tileEntityList.add(tileentity); -+ boolean flag = true; // Paper - remove unused list - -- if (flag && tileentity instanceof ITickable) { -+ if (flag && tileentity instanceof ITickable && !this.tileEntityListTick.contains(tileentity)) { // Paper - this.tileEntityListTick.add(tileentity); - } - -@@ -2114,7 +2114,7 @@ public abstract class World implements IBlockAccess { - } else { - if (tileentity != null) { - this.b.remove(tileentity); -- this.tileEntityList.remove(tileentity); -+ //this.tileEntityList.remove(tileentity); // Paper - remove unused list - this.tileEntityListTick.remove(tileentity); - } - --- -2.18.0 -