From 8599f95b4f62869804cbb313b7ac6a83b8b6f65a Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Fri, 11 Jun 2021 22:20:08 -0700 Subject: [PATCH] even more progress --- ...blocking-on-Network-Manager-creation.patch | 45 ------- ...3-Optional-TNT-doesn-t-move-in-water.patch | 121 ------------------ ...layer-View-Distance-API-placeholders.patch | 70 ---------- ...layer-View-Distance-API-placeholders.patch | 42 ++++++ ...patch => 0038-Add-BeaconEffectEvent.patch} | 0 ...igurable-container-update-tick-rate.patch} | 6 +- ...0040-Use-UserCache-for-player-heads.patch} | 0 ...> 0041-Disable-spigot-tick-limiters.patch} | 0 ...=> 0042-Add-PlayerInitialSpawnEvent.patch} | 0 ...rable-Disabling-Cat-Chest-Detection.patch} | 0 ...4-Ensure-commands-are-not-ran-async.patch} | 0 ...hunks-are-slime-spawn-chunks-toggle.patch} | 0 ...ch => 0046-Expose-server-CommandMap.patch} | 0 ...-informative-in-maxHealth-exception.patch} | 0 ...0048-Player-Tab-List-and-Title-APIs.patch} | 2 +- ...> 0049-Ensure-inv-drag-is-in-bounds.patch} | 0 ...d-configurable-portal-search-radius.patch} | 0 ...patch => 0051-Add-velocity-warnings.patch} | 0 ...le-inter-world-teleportation-safety.patch} | 4 +- ... 0053-Add-exception-reporting-event.patch} | 0 ...don-t-need-to-when-cerealising-text.patch} | 0 ...reboards-for-non-players-by-default.patch} | 0 ...orking-with-arrows-stuck-in-living-.patch} | 0 ... => 0057-Complete-resource-pack-API.patch} | 4 +- ....patch => 0058-Chunk-Save-Reattempt.patch} | 0 ...ding-permissions.yml-before-plugins.patch} | 0 ...low-Reloading-of-Custom-Permissions.patch} | 0 ...h => 0061-Remove-Metadata-on-reload.patch} | 0 ...62-Handle-Item-Meta-Inconsistencies.patch} | 0 ...rable-Non-Player-Arrow-Despawn-Rate.patch} | 0 ...atch => 0064-Add-World-Util-Methods.patch} | 0 ...-Custom-replacement-for-eaten-items.patch} | 0 ...h-absorb-values-and-repair-bad-data.patch} | 4 +- ...67-Use-a-Shared-Random-for-Entities.patch} | 0 ...e-spawn-chances-for-skeleton-horses.patch} | 0 ...ocation-getType-and-getBlockData-fo.patch} | 0 ...kPhysicsEvent-if-a-plugin-has-a-lis.patch} | 0 ...ntity-AddTo-RemoveFrom-World-Events.patch} | 0 ...2-Configurable-Chunk-Inhabited-Time.patch} | 0 ...t.patch => 0073-EntityPathfindEvent.patch} | 0 ...gionFileCache-and-make-configurable.patch} | 0 ...-Do-not-load-chunks-for-Pathfinding.patch} | 0 ...076-Add-PlayerUseUnknownEntityEvent.patch} | 0 ...DebugInfo-not-initialized-on-client.patch} | 0 ...Configurable-Grass-Spread-Tick-Rate.patch} | 0 ...-BlockPlaceEvent-triggering-physics.patch} | 0 ...its.patch => 0080-Optimize-DataBits.patch} | 0 ...illa-per-world-scoreboard-coloring-.patch} | 0 ...d-for-setting-passengers-on-players.patch} | 4 +- ... 0083-Configurable-Player-Collision.patch} | 0 ...nt-to-allow-plugins-to-handle-clien.patch} | 0 ...> 0085-Configurable-RCON-IP-address.patch} | 0 ...6-Implement-PlayerLocaleChangeEvent.patch} | 10 +- ...tyRegainHealthEvent-isFastRegen-API.patch} | 0 ...to-configure-frosted_ice-properties.patch} | 0 ...possibility-for-getServer-singleton.patch} | 0 ...tem-frames-performance-and-bug-fixe.patch} | 0 ...API-Replenishable-Lootables-Feature.patch} | 5 +- ...-scoreboard-teams-to-scoreboard.dat.patch} | 16 +-- ...em-property-for-disabling-watchdoge.patch} | 8 +- ...0094-Optimize-UserCache-Thread-Safe.patch} | 62 ++++----- ...5-Optional-TNT-doesn-t-move-in-water.patch | 82 ++++++++++++ ...-redstone-torch-rapid-clock-removal.patch} | 39 ++---- .../0097-Add-server-name-parameter.patch} | 2 +- ...n-Wither-Death-sounds-to-same-world.patch} | 16 +-- 65 files changed, 199 insertions(+), 343 deletions(-) delete mode 100644 patches/server-remapped/0102-Avoid-blocking-on-Network-Manager-creation.patch delete mode 100644 patches/server-remapped/0103-Optional-TNT-doesn-t-move-in-water.patch delete mode 100644 patches/server-remapped/0347-Per-Player-View-Distance-API-placeholders.patch create mode 100644 patches/server/0037-Per-Player-View-Distance-API-placeholders.patch rename patches/server/{0037-Add-BeaconEffectEvent.patch => 0038-Add-BeaconEffectEvent.patch} (100%) rename patches/server/{0038-Configurable-container-update-tick-rate.patch => 0039-Configurable-container-update-tick-rate.patch} (89%) rename patches/server/{0039-Use-UserCache-for-player-heads.patch => 0040-Use-UserCache-for-player-heads.patch} (100%) rename patches/server/{0040-Disable-spigot-tick-limiters.patch => 0041-Disable-spigot-tick-limiters.patch} (100%) rename patches/server/{0041-Add-PlayerInitialSpawnEvent.patch => 0042-Add-PlayerInitialSpawnEvent.patch} (100%) rename patches/server/{0042-Configurable-Disabling-Cat-Chest-Detection.patch => 0043-Configurable-Disabling-Cat-Chest-Detection.patch} (100%) rename patches/server/{0043-Ensure-commands-are-not-ran-async.patch => 0044-Ensure-commands-are-not-ran-async.patch} (100%) rename patches/server/{0044-All-chunks-are-slime-spawn-chunks-toggle.patch => 0045-All-chunks-are-slime-spawn-chunks-toggle.patch} (100%) rename patches/server/{0045-Expose-server-CommandMap.patch => 0046-Expose-server-CommandMap.patch} (100%) rename patches/server/{0046-Be-a-bit-more-informative-in-maxHealth-exception.patch => 0047-Be-a-bit-more-informative-in-maxHealth-exception.patch} (100%) rename patches/server/{0047-Player-Tab-List-and-Title-APIs.patch => 0048-Player-Tab-List-and-Title-APIs.patch} (98%) rename patches/server/{0048-Ensure-inv-drag-is-in-bounds.patch => 0049-Ensure-inv-drag-is-in-bounds.patch} (100%) rename patches/server/{0049-Add-configurable-portal-search-radius.patch => 0050-Add-configurable-portal-search-radius.patch} (100%) rename patches/server/{0050-Add-velocity-warnings.patch => 0051-Add-velocity-warnings.patch} (100%) rename patches/server/{0051-Configurable-inter-world-teleportation-safety.patch => 0052-Configurable-inter-world-teleportation-safety.patch} (93%) rename patches/server/{0052-Add-exception-reporting-event.patch => 0053-Add-exception-reporting-event.patch} (100%) rename patches/server/{0053-Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch => 0054-Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch} (100%) rename patches/server/{0054-Disable-Scoreboards-for-non-players-by-default.patch => 0055-Disable-Scoreboards-for-non-players-by-default.patch} (100%) rename patches/server/{0055-Add-methods-for-working-with-arrows-stuck-in-living-.patch => 0056-Add-methods-for-working-with-arrows-stuck-in-living-.patch} (100%) rename patches/server/{0056-Complete-resource-pack-API.patch => 0057-Complete-resource-pack-API.patch} (95%) rename patches/server/{0057-Chunk-Save-Reattempt.patch => 0058-Chunk-Save-Reattempt.patch} (100%) rename patches/server/{0058-Default-loading-permissions.yml-before-plugins.patch => 0059-Default-loading-permissions.yml-before-plugins.patch} (100%) rename patches/server/{0059-Allow-Reloading-of-Custom-Permissions.patch => 0060-Allow-Reloading-of-Custom-Permissions.patch} (100%) rename patches/server/{0060-Remove-Metadata-on-reload.patch => 0061-Remove-Metadata-on-reload.patch} (100%) rename patches/server/{0061-Handle-Item-Meta-Inconsistencies.patch => 0062-Handle-Item-Meta-Inconsistencies.patch} (100%) rename patches/server/{0062-Configurable-Non-Player-Arrow-Despawn-Rate.patch => 0063-Configurable-Non-Player-Arrow-Despawn-Rate.patch} (100%) rename patches/server/{0063-Add-World-Util-Methods.patch => 0064-Add-World-Util-Methods.patch} (100%) rename patches/server/{0064-Custom-replacement-for-eaten-items.patch => 0065-Custom-replacement-for-eaten-items.patch} (100%) rename patches/server/{0065-handle-NaN-health-absorb-values-and-repair-bad-data.patch => 0066-handle-NaN-health-absorb-values-and-repair-bad-data.patch} (94%) rename patches/server/{0066-Use-a-Shared-Random-for-Entities.patch => 0067-Use-a-Shared-Random-for-Entities.patch} (100%) rename patches/server/{0067-Configurable-spawn-chances-for-skeleton-horses.patch => 0068-Configurable-spawn-chances-for-skeleton-horses.patch} (100%) rename patches/server/{0068-Optimize-isValidLocation-getType-and-getBlockData-fo.patch => 0069-Optimize-isValidLocation-getType-and-getBlockData-fo.patch} (100%) rename patches/server/{0069-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch => 0070-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch} (100%) rename patches/server/{0070-Entity-AddTo-RemoveFrom-World-Events.patch => 0071-Entity-AddTo-RemoveFrom-World-Events.patch} (100%) rename patches/server/{0071-Configurable-Chunk-Inhabited-Time.patch => 0072-Configurable-Chunk-Inhabited-Time.patch} (100%) rename patches/server/{0072-EntityPathfindEvent.patch => 0073-EntityPathfindEvent.patch} (100%) rename patches/server/{0073-Sanitise-RegionFileCache-and-make-configurable.patch => 0074-Sanitise-RegionFileCache-and-make-configurable.patch} (100%) rename patches/server/{0074-Do-not-load-chunks-for-Pathfinding.patch => 0075-Do-not-load-chunks-for-Pathfinding.patch} (100%) rename patches/server/{0075-Add-PlayerUseUnknownEntityEvent.patch => 0076-Add-PlayerUseUnknownEntityEvent.patch} (100%) rename patches/server/{0076-Fix-reducedDebugInfo-not-initialized-on-client.patch => 0077-Fix-reducedDebugInfo-not-initialized-on-client.patch} (100%) rename patches/server/{0077-Configurable-Grass-Spread-Tick-Rate.patch => 0078-Configurable-Grass-Spread-Tick-Rate.patch} (100%) rename patches/server/{0078-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch => 0079-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch} (100%) rename patches/server/{0079-Optimize-DataBits.patch => 0080-Optimize-DataBits.patch} (100%) rename patches/server/{0080-Option-to-use-vanilla-per-world-scoreboard-coloring-.patch => 0081-Option-to-use-vanilla-per-world-scoreboard-coloring-.patch} (100%) rename patches/server/{0081-Workaround-for-setting-passengers-on-players.patch => 0082-Workaround-for-setting-passengers-on-players.patch} (87%) rename patches/server/{0082-Configurable-Player-Collision.patch => 0083-Configurable-Player-Collision.patch} (100%) rename patches/server/{0083-Add-handshake-event-to-allow-plugins-to-handle-clien.patch => 0084-Add-handshake-event-to-allow-plugins-to-handle-clien.patch} (100%) rename patches/server/{0084-Configurable-RCON-IP-address.patch => 0085-Configurable-RCON-IP-address.patch} (100%) rename patches/server/{0085-Implement-PlayerLocaleChangeEvent.patch => 0086-Implement-PlayerLocaleChangeEvent.patch} (85%) rename patches/server/{0086-EntityRegainHealthEvent-isFastRegen-API.patch => 0087-EntityRegainHealthEvent-isFastRegen-API.patch} (100%) rename patches/server/{0087-Add-ability-to-configure-frosted_ice-properties.patch => 0088-Add-ability-to-configure-frosted_ice-properties.patch} (100%) rename patches/server/{0088-remove-null-possibility-for-getServer-singleton.patch => 0089-remove-null-possibility-for-getServer-singleton.patch} (100%) rename patches/server/{0089-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch => 0090-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch} (100%) rename patches/server/{0090-LootTable-API-Replenishable-Lootables-Feature.patch => 0091-LootTable-API-Replenishable-Lootables-Feature.patch} (99%) rename patches/{server-remapped/0099-Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch => server/0092-Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch} (69%) rename patches/{server-remapped/0100-System-property-for-disabling-watchdoge.patch => server/0093-System-property-for-disabling-watchdoge.patch} (58%) rename patches/{server-remapped/0101-Optimize-UserCache-Thread-Safe.patch => server/0094-Optimize-UserCache-Thread-Safe.patch} (62%) create mode 100644 patches/server/0095-Optional-TNT-doesn-t-move-in-water.patch rename patches/{server-remapped/0104-Faster-redstone-torch-rapid-clock-removal.patch => server/0096-Faster-redstone-torch-rapid-clock-removal.patch} (69%) rename patches/{server-remapped/0105-Add-server-name-parameter.patch => server/0097-Add-server-name-parameter.patch} (90%) rename patches/{server-remapped/0106-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch => server/0098-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch} (80%) diff --git a/patches/server-remapped/0102-Avoid-blocking-on-Network-Manager-creation.patch b/patches/server-remapped/0102-Avoid-blocking-on-Network-Manager-creation.patch deleted file mode 100644 index ba69589d2f..0000000000 --- a/patches/server-remapped/0102-Avoid-blocking-on-Network-Manager-creation.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Mon, 16 May 2016 23:19:16 -0400 -Subject: [PATCH] Avoid blocking on Network Manager creation - -Per Paper issue 294 - -diff --git a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java -index 9680b0b3879c72776d6225a6a5a89fdfa3520598..6cb51a4fe3c11f53fbb556ce6b0d64b735254d51 100644 ---- a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java -+++ b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java -@@ -52,6 +52,15 @@ public class ServerConnectionListener { - public volatile boolean running; - private final List channels = Collections.synchronizedList(Lists.newArrayList()); - private final List connections = Collections.synchronizedList(Lists.newArrayList()); -+ // Paper start - prevent blocking on adding a new network manager while the server is ticking -+ private final java.util.Queue pending = new java.util.concurrent.ConcurrentLinkedQueue<>(); -+ private void addPending() { -+ Connection manager = null; -+ while ((manager = pending.poll()) != null) { -+ connections.add(manager); -+ } -+ } -+ // Paper end - - public ServerConnectionListener(MinecraftServer server) { - this.server = server; -@@ -87,7 +96,8 @@ public class ServerConnectionListener { - int j = ServerConnectionListener.this.server.getRateLimitPacketsPerSecond(); - Object object = j > 0 ? new RateKickingConnection(j) : new Connection(PacketFlow.SERVERBOUND); - -- ServerConnectionListener.this.connections.add((Connection) object); // CraftBukkit - decompile error -+ //ServerConnection.this.connectedChannels.add((NetworkManager) object); // CraftBukkit - decompile error -+ pending.add((Connection) object); // Paper - channel.pipeline().addLast("packet_handler", (ChannelHandler) object); - ((Connection) object).setListener(new ServerHandshakePacketListenerImpl(ServerConnectionListener.this.server, (Connection) object)); - } -@@ -126,6 +136,7 @@ public class ServerConnectionListener { - - synchronized (this.connections) { - // Spigot Start -+ this.addPending(); // Paper - // This prevents players from 'gaming' the server, and strategically relogging to increase their position in the tick order - if ( org.spigotmc.SpigotConfig.playerShuffle > 0 && MinecraftServer.currentTick % org.spigotmc.SpigotConfig.playerShuffle == 0 ) - { diff --git a/patches/server-remapped/0103-Optional-TNT-doesn-t-move-in-water.patch b/patches/server-remapped/0103-Optional-TNT-doesn-t-move-in-water.patch deleted file mode 100644 index cd8e56460f..0000000000 --- a/patches/server-remapped/0103-Optional-TNT-doesn-t-move-in-water.patch +++ /dev/null @@ -1,121 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Zach Brown -Date: Sun, 22 May 2016 20:20:55 -0500 -Subject: [PATCH] Optional TNT doesn't move in water - - -diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index eb04fdb172a50ec1f5b7fe78fa0e7655246abd60..6eca3f300020006f02dd36253b522db442e3cc33 100644 ---- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -2,7 +2,6 @@ package com.destroystokyo.paper; - - import java.util.List; - --import org.bukkit.Bukkit; - import org.bukkit.configuration.file.YamlConfiguration; - import org.spigotmc.SpigotWorldConfig; - -@@ -291,4 +290,14 @@ public class PaperWorldConfig { - ); - } - } -+ -+ public boolean preventTntFromMovingInWater; -+ private void preventTntFromMovingInWater() { -+ if (PaperConfig.version < 13) { -+ boolean oldVal = getBoolean("enable-old-tnt-cannon-behaviors", false); -+ set("prevent-tnt-from-moving-in-water", oldVal); -+ } -+ preventTntFromMovingInWater = getBoolean("prevent-tnt-from-moving-in-water", false); -+ log("Prevent TNT from moving in water: " + preventTntFromMovingInWater); -+ } - } -diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java -index fa6893055fa5617742bfb4b7eff60c8139395cb6..49c71b21b6b88bc41ca6ddf4c76186ce522ee456 100644 ---- a/src/main/java/net/minecraft/server/level/ServerEntity.java -+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java -@@ -66,7 +66,7 @@ public class ServerEntity { - private boolean wasRiding; - private boolean wasOnGround; - // CraftBukkit start -- private final Set trackedPlayers; -+ final Set trackedPlayers; // Paper - private -> package - // Paper start - private java.util.Map trackedPlayerMap = null; - -diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 171697e88f5a4d8c0be2a47b67b865bbdc4dfe8c..c3aece8e5001828edea304b2a8377e9a28b34cfe 100644 ---- a/src/main/java/net/minecraft/world/entity/Entity.java -+++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -2770,6 +2770,11 @@ public abstract class Entity implements Nameable, CommandSource, net.minecraft.s - } - - public boolean isPushedByFluid() { -+ // Paper start -+ return this.pushedByWater(); -+ } -+ public boolean pushedByWater() { -+ // Paper end - return true; - } - -diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java -index 661848084fd986321ef782317934dac19ed4dce3..347ac17643de8bcb0c8496c2ea5eb18c2e4d856b 100644 ---- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java -+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java -@@ -5,9 +5,13 @@ import net.minecraft.core.particles.ParticleTypes; - import net.minecraft.nbt.CompoundTag; - import net.minecraft.network.protocol.Packet; - import net.minecraft.network.protocol.game.ClientboundAddEntityPacket; -+import net.minecraft.network.protocol.game.ClientboundSetEntityMotionPacket; -+import net.minecraft.network.protocol.game.ClientboundTeleportEntityPacket; - import net.minecraft.network.syncher.EntityDataAccessor; - import net.minecraft.network.syncher.EntityDataSerializers; - import net.minecraft.network.syncher.SynchedEntityData; -+import net.minecraft.server.level.ChunkMap; -+import net.minecraft.server.level.ServerLevel; - import net.minecraft.world.entity.Entity; - import net.minecraft.world.entity.EntityDimensions; - import net.minecraft.world.entity.EntityType; -@@ -95,7 +99,27 @@ public class PrimedTnt extends Entity { - this.level.addParticle(ParticleTypes.SMOKE, this.getX(), this.getY() + 0.5D, this.getZ(), 0.0D, 0.0D, 0.0D); - } - } -- -+ // Paper start - Optional prevent TNT from moving in water -+ if (!this.removed && this.wasTouchingWater && this.level.paperConfig.preventTntFromMovingInWater) { -+ /* -+ * Author: Jedediah Smith -+ */ -+ // Send position and velocity updates to nearby players on every tick while the TNT is in water. -+ // This does pretty well at keeping their clients in sync with the server. -+ ChunkMap.TrackedEntity ete = ((ServerLevel)this.level).getChunkSource().chunkMap.entityMap.get(this.getId()); -+ if (ete != null) { -+ ClientboundSetEntityMotionPacket velocityPacket = new ClientboundSetEntityMotionPacket(this); -+ ClientboundTeleportEntityPacket positionPacket = new ClientboundTeleportEntityPacket(this); -+ -+ ete.seenBy.stream() -+ .filter(viewer -> (viewer.getX() - this.getX()) * (viewer.getY() - this.getY()) * (viewer.getZ() - this.getZ()) < 16 * 16) -+ .forEach(viewer -> { -+ viewer.connection.send(velocityPacket); -+ viewer.connection.send(positionPacket); -+ }); -+ } -+ } -+ // Paper end - } - - private void explode() { -@@ -164,4 +188,11 @@ public class PrimedTnt extends Entity { - public Packet getAddEntityPacket() { - return new ClientboundAddEntityPacket(this); - } -+ -+ // Paper start - Optional prevent TNT from moving in water -+ @Override -+ public boolean pushedByWater() { -+ return !level.paperConfig.preventTntFromMovingInWater && super.pushedByWater(); -+ } -+ // Paper end - } diff --git a/patches/server-remapped/0347-Per-Player-View-Distance-API-placeholders.patch b/patches/server-remapped/0347-Per-Player-View-Distance-API-placeholders.patch deleted file mode 100644 index 1dcd6ab30d..0000000000 --- a/patches/server-remapped/0347-Per-Player-View-Distance-API-placeholders.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Zach Brown -Date: Mon, 6 May 2019 01:29:25 -0400 -Subject: [PATCH] Per-Player View Distance API placeholders - -I hope to look at this more in-depth soon. It appears doable. -However this should not block the update. - -diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java -index 37a9e9df7f7f816c214c37e545288bf9329626ed..ec9436005a3a6fdfb4783d1092bb361224eb6414 100644 ---- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java -+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java -@@ -625,9 +625,10 @@ public class EnderDragon extends Mob implements Enemy { - if (this.dragonDeathTime == 1 && !this.isSilent()) { - // CraftBukkit start - Use relative location for far away sounds - // this.world.b(1028, this.getChunkCoordinates(), 0); -- //int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API -+ int viewDistance = ((ServerLevel) this.level).getCraftServer().getViewDistance() * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API - for (net.minecraft.server.level.ServerPlayer player : (List) ((ServerLevel)level).players()) { -- final int viewDistance = player.getViewDistance(); // TODO apply view distance api patch -+ // final int viewDistance = player.getViewDistance(); // TODO apply view distance api patch -+ // Paper end - double deltaX = this.getX() - player.getX(); - double deltaZ = this.getZ() - player.getZ(); - double distanceSquared = deltaX * deltaX + deltaZ * deltaZ; -diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java -index 3a80869dc3c16cb81ac87100f28d63eee722067f..edd231568b75330d0cffbecb03a7e9dbc55d5f94 100644 ---- a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java -+++ b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java -@@ -46,6 +46,7 @@ import net.minecraft.network.syncher.EntityDataSerializers; - import net.minecraft.network.syncher.SynchedEntityData; - import net.minecraft.server.MinecraftServer; - import net.minecraft.server.level.ServerBossEvent; -+import net.minecraft.server.level.ServerLevel; - import net.minecraft.server.level.ServerPlayer; - import net.minecraft.sounds.SoundEvent; - import net.minecraft.sounds.SoundEvents; -@@ -255,9 +256,9 @@ public class WitherBoss extends Monster implements RangedAttackMob { - if (!this.isSilent()) { - // CraftBukkit start - Use relative location for far away sounds - // this.world.b(1023, new BlockPosition(this), 0); -- //int viewDistance = ((WorldServer) this.world).getServer().getViewDistance() * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API -+ int viewDistance = ((ServerLevel) this.level).getCraftServer().getViewDistance() * 16; // Paper - updated to use worlds actual view distance incase we have to uncomment this due to removal of player view distance API - for (ServerPlayer player : (List)this.level.players()) { -- final int viewDistance = player.getViewDistance(); // TODO apply view distance api patch -+ // final int viewDistance = player.getViewDistance(); // TODO apply view distance api patch - double deltaX = this.getX() - player.getX(); - double deltaZ = this.getZ() - player.getZ(); - double distanceSquared = deltaX * deltaX + deltaZ * deltaZ; -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index c2c6eb54096ef85b01c0b700cbe6a8054b62729f..20de8e358789d05bb5ac15e4cdd7dda85b61b7f8 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2240,6 +2240,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { - super.remove(); - } - } -+ -+ @Override -+ public int getViewDistance() { -+ throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO -+ } -+ -+ @Override -+ public void setViewDistance(int viewDistance) { -+ throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO -+ } - // Paper end - - // Spigot start diff --git a/patches/server/0037-Per-Player-View-Distance-API-placeholders.patch b/patches/server/0037-Per-Player-View-Distance-API-placeholders.patch new file mode 100644 index 0000000000..4aaa11ddec --- /dev/null +++ b/patches/server/0037-Per-Player-View-Distance-API-placeholders.patch @@ -0,0 +1,42 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Zach Brown +Date: Mon, 6 May 2019 01:29:25 -0400 +Subject: [PATCH] Per-Player View Distance API placeholders + +I hope to look at this more in-depth soon. It appears doable. +However this should not block the update. + +diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java +index b25f9a2d2d7f0af0fef60c4f1817cf165fed9cd6..74b38b853bd7a59f4cf42afed5ee7ca86b34a8c7 100644 +--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java ++++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +@@ -170,6 +170,8 @@ import org.bukkit.inventory.MainHand; + + public class ServerPlayer extends Player { + ++ public final int getViewDistance() { return this.getLevel().getChunkSource().chunkMap.viewDistance - 1; } // Paper - placeholder ++ + private static final Logger LOGGER = LogManager.getLogger(); + private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_XZ = 32; + private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_Y = 10; +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +index 1392d4d5027b3d972b2196af7b19fb409977fb8d..9b4e113b542ca2fc00cf7206d2f50781755119e3 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +@@ -370,6 +370,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { + connection.disconnect(message == null ? net.kyori.adventure.text.Component.empty() : message); + } + } ++ ++ @Override ++ public int getViewDistance() { ++ throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO ++ } ++ ++ @Override ++ public void setViewDistance(int viewDistance) { ++ throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO ++ } + // Paper end + + @Override diff --git a/patches/server/0037-Add-BeaconEffectEvent.patch b/patches/server/0038-Add-BeaconEffectEvent.patch similarity index 100% rename from patches/server/0037-Add-BeaconEffectEvent.patch rename to patches/server/0038-Add-BeaconEffectEvent.patch diff --git a/patches/server/0038-Configurable-container-update-tick-rate.patch b/patches/server/0039-Configurable-container-update-tick-rate.patch similarity index 89% rename from patches/server/0038-Configurable-container-update-tick-rate.patch rename to patches/server/0039-Configurable-container-update-tick-rate.patch index 3fb2e0b00b..789bc82526 100644 --- a/patches/server/0038-Configurable-container-update-tick-rate.patch +++ b/patches/server/0039-Configurable-container-update-tick-rate.patch @@ -19,10 +19,10 @@ index 4de86b09c6bc3c1974ce61b550ccb73d37f6f170..5a4c3a8c511f22c8c3240c9c7cd83a65 + } } diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index b25f9a2d2d7f0af0fef60c4f1817cf165fed9cd6..b68a58abf254289a806636ca28521be39c13a82f 100644 +index 74b38b853bd7a59f4cf42afed5ee7ca86b34a8c7..f222721c7bfa555a45c34b489a9e7af59a1f183c 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -214,6 +214,7 @@ public class ServerPlayer extends Player { +@@ -216,6 +216,7 @@ public class ServerPlayer extends Player { private int containerCounter; public int latency; public boolean wonGame; @@ -30,7 +30,7 @@ index b25f9a2d2d7f0af0fef60c4f1817cf165fed9cd6..b68a58abf254289a806636ca28521be3 // CraftBukkit start public String displayName; -@@ -589,7 +590,12 @@ public class ServerPlayer extends Player { +@@ -591,7 +592,12 @@ public class ServerPlayer extends Player { --this.invulnerableTime; } diff --git a/patches/server/0039-Use-UserCache-for-player-heads.patch b/patches/server/0040-Use-UserCache-for-player-heads.patch similarity index 100% rename from patches/server/0039-Use-UserCache-for-player-heads.patch rename to patches/server/0040-Use-UserCache-for-player-heads.patch diff --git a/patches/server/0040-Disable-spigot-tick-limiters.patch b/patches/server/0041-Disable-spigot-tick-limiters.patch similarity index 100% rename from patches/server/0040-Disable-spigot-tick-limiters.patch rename to patches/server/0041-Disable-spigot-tick-limiters.patch diff --git a/patches/server/0041-Add-PlayerInitialSpawnEvent.patch b/patches/server/0042-Add-PlayerInitialSpawnEvent.patch similarity index 100% rename from patches/server/0041-Add-PlayerInitialSpawnEvent.patch rename to patches/server/0042-Add-PlayerInitialSpawnEvent.patch diff --git a/patches/server/0042-Configurable-Disabling-Cat-Chest-Detection.patch b/patches/server/0043-Configurable-Disabling-Cat-Chest-Detection.patch similarity index 100% rename from patches/server/0042-Configurable-Disabling-Cat-Chest-Detection.patch rename to patches/server/0043-Configurable-Disabling-Cat-Chest-Detection.patch diff --git a/patches/server/0043-Ensure-commands-are-not-ran-async.patch b/patches/server/0044-Ensure-commands-are-not-ran-async.patch similarity index 100% rename from patches/server/0043-Ensure-commands-are-not-ran-async.patch rename to patches/server/0044-Ensure-commands-are-not-ran-async.patch diff --git a/patches/server/0044-All-chunks-are-slime-spawn-chunks-toggle.patch b/patches/server/0045-All-chunks-are-slime-spawn-chunks-toggle.patch similarity index 100% rename from patches/server/0044-All-chunks-are-slime-spawn-chunks-toggle.patch rename to patches/server/0045-All-chunks-are-slime-spawn-chunks-toggle.patch diff --git a/patches/server/0045-Expose-server-CommandMap.patch b/patches/server/0046-Expose-server-CommandMap.patch similarity index 100% rename from patches/server/0045-Expose-server-CommandMap.patch rename to patches/server/0046-Expose-server-CommandMap.patch diff --git a/patches/server/0046-Be-a-bit-more-informative-in-maxHealth-exception.patch b/patches/server/0047-Be-a-bit-more-informative-in-maxHealth-exception.patch similarity index 100% rename from patches/server/0046-Be-a-bit-more-informative-in-maxHealth-exception.patch rename to patches/server/0047-Be-a-bit-more-informative-in-maxHealth-exception.patch diff --git a/patches/server/0047-Player-Tab-List-and-Title-APIs.patch b/patches/server/0048-Player-Tab-List-and-Title-APIs.patch similarity index 98% rename from patches/server/0047-Player-Tab-List-and-Title-APIs.patch rename to patches/server/0048-Player-Tab-List-and-Title-APIs.patch index 5a6bb6c55d..9c38b3fa48 100644 --- a/patches/server/0047-Player-Tab-List-and-Title-APIs.patch +++ b/patches/server/0048-Player-Tab-List-and-Title-APIs.patch @@ -33,7 +33,7 @@ index 02d19fa4abdee0c8331734932a83e64694356030..969aea457e76b853e34a67a8fd07e0ea public static MutableComponent fromJson(String json) { return (MutableComponent) GsonHelper.fromJson(Component.Serializer.GSON, json, MutableComponent.class, false); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 1392d4d5027b3d972b2196af7b19fb409977fb8d..145f1ae878a6a6d91f291573f150c66363f151fd 100644 +index 9b4e113b542ca2fc00cf7206d2f50781755119e3..9d29db04e3d83e98ae3819b34cbb19f3ec3bf43c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1,5 +1,6 @@ diff --git a/patches/server/0048-Ensure-inv-drag-is-in-bounds.patch b/patches/server/0049-Ensure-inv-drag-is-in-bounds.patch similarity index 100% rename from patches/server/0048-Ensure-inv-drag-is-in-bounds.patch rename to patches/server/0049-Ensure-inv-drag-is-in-bounds.patch diff --git a/patches/server/0049-Add-configurable-portal-search-radius.patch b/patches/server/0050-Add-configurable-portal-search-radius.patch similarity index 100% rename from patches/server/0049-Add-configurable-portal-search-radius.patch rename to patches/server/0050-Add-configurable-portal-search-radius.patch diff --git a/patches/server/0050-Add-velocity-warnings.patch b/patches/server/0051-Add-velocity-warnings.patch similarity index 100% rename from patches/server/0050-Add-velocity-warnings.patch rename to patches/server/0051-Add-velocity-warnings.patch diff --git a/patches/server/0051-Configurable-inter-world-teleportation-safety.patch b/patches/server/0052-Configurable-inter-world-teleportation-safety.patch similarity index 93% rename from patches/server/0051-Configurable-inter-world-teleportation-safety.patch rename to patches/server/0052-Configurable-inter-world-teleportation-safety.patch index d8ac211487..0571aa165d 100644 --- a/patches/server/0051-Configurable-inter-world-teleportation-safety.patch +++ b/patches/server/0052-Configurable-inter-world-teleportation-safety.patch @@ -30,10 +30,10 @@ index 670efbe53241a0ae32d618c83da601ccc1f26e37..abbbe1786eb68af02f9d39650aad730a + } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 145f1ae878a6a6d91f291573f150c66363f151fd..34c249bff7f32aa3e58c04a1bc0f65f5f410d714 100644 +index 9d29db04e3d83e98ae3819b34cbb19f3ec3bf43c..7a256faba6946f4f3847dd439e6c520e022b4354 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -864,7 +864,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -874,7 +874,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { if (fromWorld == toWorld) { entity.connection.teleport(to); } else { diff --git a/patches/server/0052-Add-exception-reporting-event.patch b/patches/server/0053-Add-exception-reporting-event.patch similarity index 100% rename from patches/server/0052-Add-exception-reporting-event.patch rename to patches/server/0053-Add-exception-reporting-event.patch diff --git a/patches/server/0053-Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch b/patches/server/0054-Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch similarity index 100% rename from patches/server/0053-Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch rename to patches/server/0054-Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch diff --git a/patches/server/0054-Disable-Scoreboards-for-non-players-by-default.patch b/patches/server/0055-Disable-Scoreboards-for-non-players-by-default.patch similarity index 100% rename from patches/server/0054-Disable-Scoreboards-for-non-players-by-default.patch rename to patches/server/0055-Disable-Scoreboards-for-non-players-by-default.patch diff --git a/patches/server/0055-Add-methods-for-working-with-arrows-stuck-in-living-.patch b/patches/server/0056-Add-methods-for-working-with-arrows-stuck-in-living-.patch similarity index 100% rename from patches/server/0055-Add-methods-for-working-with-arrows-stuck-in-living-.patch rename to patches/server/0056-Add-methods-for-working-with-arrows-stuck-in-living-.patch diff --git a/patches/server/0056-Complete-resource-pack-API.patch b/patches/server/0057-Complete-resource-pack-API.patch similarity index 95% rename from patches/server/0056-Complete-resource-pack-API.patch rename to patches/server/0057-Complete-resource-pack-API.patch index be7144661d..9a7ef1068c 100644 --- a/patches/server/0056-Complete-resource-pack-API.patch +++ b/patches/server/0057-Complete-resource-pack-API.patch @@ -23,7 +23,7 @@ index b38ca69d37d7f1af0e34297f45e63a98da754e35..714fb0d766b654ad05134dea9b1e1b62 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 34c249bff7f32aa3e58c04a1bc0f65f5f410d714..6aabe32512abc974e114e273a41e09804b349cb9 100644 +index 7a256faba6946f4f3847dd439e6c520e022b4354..56bdc8ba0e3bd09a12f6572542e99a1ea3a76670 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -141,6 +141,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -37,7 +37,7 @@ index 34c249bff7f32aa3e58c04a1bc0f65f5f410d714..6aabe32512abc974e114e273a41e0980 public CraftPlayer(CraftServer server, ServerPlayer entity) { super(server, entity); -@@ -1875,6 +1879,32 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1885,6 +1889,32 @@ public class CraftPlayer extends CraftHumanEntity implements Player { public boolean getAffectsSpawning() { return this.getHandle().affectsSpawning; } diff --git a/patches/server/0057-Chunk-Save-Reattempt.patch b/patches/server/0058-Chunk-Save-Reattempt.patch similarity index 100% rename from patches/server/0057-Chunk-Save-Reattempt.patch rename to patches/server/0058-Chunk-Save-Reattempt.patch diff --git a/patches/server/0058-Default-loading-permissions.yml-before-plugins.patch b/patches/server/0059-Default-loading-permissions.yml-before-plugins.patch similarity index 100% rename from patches/server/0058-Default-loading-permissions.yml-before-plugins.patch rename to patches/server/0059-Default-loading-permissions.yml-before-plugins.patch diff --git a/patches/server/0059-Allow-Reloading-of-Custom-Permissions.patch b/patches/server/0060-Allow-Reloading-of-Custom-Permissions.patch similarity index 100% rename from patches/server/0059-Allow-Reloading-of-Custom-Permissions.patch rename to patches/server/0060-Allow-Reloading-of-Custom-Permissions.patch diff --git a/patches/server/0060-Remove-Metadata-on-reload.patch b/patches/server/0061-Remove-Metadata-on-reload.patch similarity index 100% rename from patches/server/0060-Remove-Metadata-on-reload.patch rename to patches/server/0061-Remove-Metadata-on-reload.patch diff --git a/patches/server/0061-Handle-Item-Meta-Inconsistencies.patch b/patches/server/0062-Handle-Item-Meta-Inconsistencies.patch similarity index 100% rename from patches/server/0061-Handle-Item-Meta-Inconsistencies.patch rename to patches/server/0062-Handle-Item-Meta-Inconsistencies.patch diff --git a/patches/server/0062-Configurable-Non-Player-Arrow-Despawn-Rate.patch b/patches/server/0063-Configurable-Non-Player-Arrow-Despawn-Rate.patch similarity index 100% rename from patches/server/0062-Configurable-Non-Player-Arrow-Despawn-Rate.patch rename to patches/server/0063-Configurable-Non-Player-Arrow-Despawn-Rate.patch diff --git a/patches/server/0063-Add-World-Util-Methods.patch b/patches/server/0064-Add-World-Util-Methods.patch similarity index 100% rename from patches/server/0063-Add-World-Util-Methods.patch rename to patches/server/0064-Add-World-Util-Methods.patch diff --git a/patches/server/0064-Custom-replacement-for-eaten-items.patch b/patches/server/0065-Custom-replacement-for-eaten-items.patch similarity index 100% rename from patches/server/0064-Custom-replacement-for-eaten-items.patch rename to patches/server/0065-Custom-replacement-for-eaten-items.patch diff --git a/patches/server/0065-handle-NaN-health-absorb-values-and-repair-bad-data.patch b/patches/server/0066-handle-NaN-health-absorb-values-and-repair-bad-data.patch similarity index 94% rename from patches/server/0065-handle-NaN-health-absorb-values-and-repair-bad-data.patch rename to patches/server/0066-handle-NaN-health-absorb-values-and-repair-bad-data.patch index d2ec2e60a6..26d4160aff 100644 --- a/patches/server/0065-handle-NaN-health-absorb-values-and-repair-bad-data.patch +++ b/patches/server/0066-handle-NaN-health-absorb-values-and-repair-bad-data.patch @@ -49,10 +49,10 @@ index 89db2afd198366ab94c9c074890aa668d3771a79..83eaa3c6581c1a3f588278124fed4c81 } + diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 6aabe32512abc974e114e273a41e09804b349cb9..2f8bcf5290d02cfc41496fd3ae8a63c08d514af8 100644 +index 56bdc8ba0e3bd09a12f6572542e99a1ea3a76670..836692160077935c45b25f7002079111ebb91a6e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1681,6 +1681,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1691,6 +1691,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void setRealHealth(double health) { diff --git a/patches/server/0066-Use-a-Shared-Random-for-Entities.patch b/patches/server/0067-Use-a-Shared-Random-for-Entities.patch similarity index 100% rename from patches/server/0066-Use-a-Shared-Random-for-Entities.patch rename to patches/server/0067-Use-a-Shared-Random-for-Entities.patch diff --git a/patches/server/0067-Configurable-spawn-chances-for-skeleton-horses.patch b/patches/server/0068-Configurable-spawn-chances-for-skeleton-horses.patch similarity index 100% rename from patches/server/0067-Configurable-spawn-chances-for-skeleton-horses.patch rename to patches/server/0068-Configurable-spawn-chances-for-skeleton-horses.patch diff --git a/patches/server/0068-Optimize-isValidLocation-getType-and-getBlockData-fo.patch b/patches/server/0069-Optimize-isValidLocation-getType-and-getBlockData-fo.patch similarity index 100% rename from patches/server/0068-Optimize-isValidLocation-getType-and-getBlockData-fo.patch rename to patches/server/0069-Optimize-isValidLocation-getType-and-getBlockData-fo.patch diff --git a/patches/server/0069-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch b/patches/server/0070-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch similarity index 100% rename from patches/server/0069-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch rename to patches/server/0070-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch diff --git a/patches/server/0070-Entity-AddTo-RemoveFrom-World-Events.patch b/patches/server/0071-Entity-AddTo-RemoveFrom-World-Events.patch similarity index 100% rename from patches/server/0070-Entity-AddTo-RemoveFrom-World-Events.patch rename to patches/server/0071-Entity-AddTo-RemoveFrom-World-Events.patch diff --git a/patches/server/0071-Configurable-Chunk-Inhabited-Time.patch b/patches/server/0072-Configurable-Chunk-Inhabited-Time.patch similarity index 100% rename from patches/server/0071-Configurable-Chunk-Inhabited-Time.patch rename to patches/server/0072-Configurable-Chunk-Inhabited-Time.patch diff --git a/patches/server/0072-EntityPathfindEvent.patch b/patches/server/0073-EntityPathfindEvent.patch similarity index 100% rename from patches/server/0072-EntityPathfindEvent.patch rename to patches/server/0073-EntityPathfindEvent.patch diff --git a/patches/server/0073-Sanitise-RegionFileCache-and-make-configurable.patch b/patches/server/0074-Sanitise-RegionFileCache-and-make-configurable.patch similarity index 100% rename from patches/server/0073-Sanitise-RegionFileCache-and-make-configurable.patch rename to patches/server/0074-Sanitise-RegionFileCache-and-make-configurable.patch diff --git a/patches/server/0074-Do-not-load-chunks-for-Pathfinding.patch b/patches/server/0075-Do-not-load-chunks-for-Pathfinding.patch similarity index 100% rename from patches/server/0074-Do-not-load-chunks-for-Pathfinding.patch rename to patches/server/0075-Do-not-load-chunks-for-Pathfinding.patch diff --git a/patches/server/0075-Add-PlayerUseUnknownEntityEvent.patch b/patches/server/0076-Add-PlayerUseUnknownEntityEvent.patch similarity index 100% rename from patches/server/0075-Add-PlayerUseUnknownEntityEvent.patch rename to patches/server/0076-Add-PlayerUseUnknownEntityEvent.patch diff --git a/patches/server/0076-Fix-reducedDebugInfo-not-initialized-on-client.patch b/patches/server/0077-Fix-reducedDebugInfo-not-initialized-on-client.patch similarity index 100% rename from patches/server/0076-Fix-reducedDebugInfo-not-initialized-on-client.patch rename to patches/server/0077-Fix-reducedDebugInfo-not-initialized-on-client.patch diff --git a/patches/server/0077-Configurable-Grass-Spread-Tick-Rate.patch b/patches/server/0078-Configurable-Grass-Spread-Tick-Rate.patch similarity index 100% rename from patches/server/0077-Configurable-Grass-Spread-Tick-Rate.patch rename to patches/server/0078-Configurable-Grass-Spread-Tick-Rate.patch diff --git a/patches/server/0078-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch b/patches/server/0079-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch similarity index 100% rename from patches/server/0078-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch rename to patches/server/0079-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch diff --git a/patches/server/0079-Optimize-DataBits.patch b/patches/server/0080-Optimize-DataBits.patch similarity index 100% rename from patches/server/0079-Optimize-DataBits.patch rename to patches/server/0080-Optimize-DataBits.patch diff --git a/patches/server/0080-Option-to-use-vanilla-per-world-scoreboard-coloring-.patch b/patches/server/0081-Option-to-use-vanilla-per-world-scoreboard-coloring-.patch similarity index 100% rename from patches/server/0080-Option-to-use-vanilla-per-world-scoreboard-coloring-.patch rename to patches/server/0081-Option-to-use-vanilla-per-world-scoreboard-coloring-.patch diff --git a/patches/server/0081-Workaround-for-setting-passengers-on-players.patch b/patches/server/0082-Workaround-for-setting-passengers-on-players.patch similarity index 87% rename from patches/server/0081-Workaround-for-setting-passengers-on-players.patch rename to patches/server/0082-Workaround-for-setting-passengers-on-players.patch index 0a081245dd..1a1869f691 100644 --- a/patches/server/0081-Workaround-for-setting-passengers-on-players.patch +++ b/patches/server/0082-Workaround-for-setting-passengers-on-players.patch @@ -6,10 +6,10 @@ 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 2f8bcf5290d02cfc41496fd3ae8a63c08d514af8..b93a02dce55952321874528016ea48e5a35bd772 100644 +index 836692160077935c45b25f7002079111ebb91a6e..2605f2b34206f8eaffcb0e5ae0b928261ab366d2 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -873,6 +873,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -883,6 +883,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return true; } diff --git a/patches/server/0082-Configurable-Player-Collision.patch b/patches/server/0083-Configurable-Player-Collision.patch similarity index 100% rename from patches/server/0082-Configurable-Player-Collision.patch rename to patches/server/0083-Configurable-Player-Collision.patch diff --git a/patches/server/0083-Add-handshake-event-to-allow-plugins-to-handle-clien.patch b/patches/server/0084-Add-handshake-event-to-allow-plugins-to-handle-clien.patch similarity index 100% rename from patches/server/0083-Add-handshake-event-to-allow-plugins-to-handle-clien.patch rename to patches/server/0084-Add-handshake-event-to-allow-plugins-to-handle-clien.patch diff --git a/patches/server/0084-Configurable-RCON-IP-address.patch b/patches/server/0085-Configurable-RCON-IP-address.patch similarity index 100% rename from patches/server/0084-Configurable-RCON-IP-address.patch rename to patches/server/0085-Configurable-RCON-IP-address.patch diff --git a/patches/server/0085-Implement-PlayerLocaleChangeEvent.patch b/patches/server/0086-Implement-PlayerLocaleChangeEvent.patch similarity index 85% rename from patches/server/0085-Implement-PlayerLocaleChangeEvent.patch rename to patches/server/0086-Implement-PlayerLocaleChangeEvent.patch index 8aa65a2052..c633928f6f 100644 --- a/patches/server/0085-Implement-PlayerLocaleChangeEvent.patch +++ b/patches/server/0086-Implement-PlayerLocaleChangeEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Implement PlayerLocaleChangeEvent diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index b68a58abf254289a806636ca28521be39c13a82f..0a59e3b405d5074ab326e6ddb265a714e4038e86 100644 +index f222721c7bfa555a45c34b489a9e7af59a1f183c..f48d7205242fc38c00e496c88090e0e98e394b39 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -1712,7 +1712,7 @@ public class ServerPlayer extends Player { +@@ -1714,7 +1714,7 @@ public class ServerPlayer extends Player { return s; } @@ -17,7 +17,7 @@ index b68a58abf254289a806636ca28521be39c13a82f..0a59e3b405d5074ab326e6ddb265a714 public java.util.Locale adventure$locale = java.util.Locale.US; // Paper public void updateOptions(ServerboundClientInformationPacket packet) { // CraftBukkit start -@@ -1720,9 +1720,10 @@ public class ServerPlayer extends Player { +@@ -1722,9 +1722,10 @@ public class ServerPlayer extends Player { PlayerChangedMainHandEvent event = new PlayerChangedMainHandEvent(this.getBukkitEntity(), getMainArm() == HumanoidArm.LEFT ? MainHand.LEFT : MainHand.RIGHT); this.server.server.getPluginManager().callEvent(event); } @@ -30,10 +30,10 @@ index b68a58abf254289a806636ca28521be39c13a82f..0a59e3b405d5074ab326e6ddb265a714 this.locale = packet.language; // Paper start diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index b93a02dce55952321874528016ea48e5a35bd772..b9320aa8e3fc3216753f7d4e3d4b2bda9ec403ef 100644 +index 2605f2b34206f8eaffcb0e5ae0b928261ab366d2..d50ce7fc675fcc57f591e90eb0bbb99a4ab21b02 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1878,8 +1878,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1888,8 +1888,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public String getLocale() { diff --git a/patches/server/0086-EntityRegainHealthEvent-isFastRegen-API.patch b/patches/server/0087-EntityRegainHealthEvent-isFastRegen-API.patch similarity index 100% rename from patches/server/0086-EntityRegainHealthEvent-isFastRegen-API.patch rename to patches/server/0087-EntityRegainHealthEvent-isFastRegen-API.patch diff --git a/patches/server/0087-Add-ability-to-configure-frosted_ice-properties.patch b/patches/server/0088-Add-ability-to-configure-frosted_ice-properties.patch similarity index 100% rename from patches/server/0087-Add-ability-to-configure-frosted_ice-properties.patch rename to patches/server/0088-Add-ability-to-configure-frosted_ice-properties.patch diff --git a/patches/server/0088-remove-null-possibility-for-getServer-singleton.patch b/patches/server/0089-remove-null-possibility-for-getServer-singleton.patch similarity index 100% rename from patches/server/0088-remove-null-possibility-for-getServer-singleton.patch rename to patches/server/0089-remove-null-possibility-for-getServer-singleton.patch diff --git a/patches/server/0089-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch b/patches/server/0090-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch similarity index 100% rename from patches/server/0089-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch rename to patches/server/0090-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch diff --git a/patches/server/0090-LootTable-API-Replenishable-Lootables-Feature.patch b/patches/server/0091-LootTable-API-Replenishable-Lootables-Feature.patch similarity index 99% rename from patches/server/0090-LootTable-API-Replenishable-Lootables-Feature.patch rename to patches/server/0091-LootTable-API-Replenishable-Lootables-Feature.patch index 8b4517c77d..d1eee7245f 100644 --- a/patches/server/0090-LootTable-API-Replenishable-Lootables-Feature.patch +++ b/patches/server/0091-LootTable-API-Replenishable-Lootables-Feature.patch @@ -82,13 +82,12 @@ index 0000000000000000000000000000000000000000..70ca5625ff5d13a8e9cd64953066a7e1 +} diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperLootableEntityInventory.java b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableEntityInventory.java new file mode 100644 -index 0000000000000000000000000000000000000000..292d5ef8a1c428893af729b298eecd32b4c4659a +index 0000000000000000000000000000000000000000..2fba5bc0f982e143ad5f5bda55d768edc5f847df --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableEntityInventory.java -@@ -0,0 +1,29 @@ +@@ -0,0 +1,28 @@ +package com.destroystokyo.paper.loottable; + -+import LootableInventory; +import net.minecraft.world.level.Level; +import org.bukkit.entity.Entity; + diff --git a/patches/server-remapped/0099-Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch b/patches/server/0092-Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch similarity index 69% rename from patches/server-remapped/0099-Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch rename to patches/server/0092-Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch index f9fbbc4e75..512d352730 100644 --- a/patches/server-remapped/0099-Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch +++ b/patches/server/0092-Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch @@ -19,14 +19,14 @@ index 504efea7b6f50a0d17f4f353781953dfb18bdeca..1b8e5671c9dc8c15ce33d351c1bb20f2 + } } diff --git a/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java b/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java -index 36a922029687b9fa3ca3a986ae42a373ced87a0e..b9e14d1c54b690f0b975bda5733c4cb4f6449f77 100644 +index 90a97a87fe67d8c3bbc60f08c9911faa4259349e..2153e7035535990b5307b85d8bc3dab50c0a3ae8 100644 --- a/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java +++ b/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java -@@ -182,6 +182,7 @@ public class ScoreboardSaveData extends SavedData { +@@ -144,6 +144,7 @@ public class ScoreboardSaveData extends SavedData { + ListTag listTag = new ListTag(); - while (iterator.hasNext()) { - PlayerTeam scoreboardteam = (PlayerTeam) iterator.next(); -+ if (!com.destroystokyo.paper.PaperConfig.saveEmptyScoreboardTeams && scoreboardteam.getPlayers().isEmpty()) continue; // Paper - CompoundTag nbttagcompound = new CompoundTag(); - - nbttagcompound.putString("Name", scoreboardteam.getName()); + for(PlayerTeam playerTeam : this.scoreboard.getPlayerTeams()) { ++ if (!com.destroystokyo.paper.PaperConfig.saveEmptyScoreboardTeams && playerTeam.getPlayers().isEmpty()) continue; // Paper + CompoundTag compoundTag = new CompoundTag(); + compoundTag.putString("Name", playerTeam.getName()); + compoundTag.putString("DisplayName", Component.Serializer.toJson(playerTeam.getDisplayName())); diff --git a/patches/server-remapped/0100-System-property-for-disabling-watchdoge.patch b/patches/server/0093-System-property-for-disabling-watchdoge.patch similarity index 58% rename from patches/server-remapped/0100-System-property-for-disabling-watchdoge.patch rename to patches/server/0093-System-property-for-disabling-watchdoge.patch index d8a22a7f5f..8d880e6928 100644 --- a/patches/server-remapped/0100-System-property-for-disabling-watchdoge.patch +++ b/patches/server/0093-System-property-for-disabling-watchdoge.patch @@ -5,15 +5,15 @@ Subject: [PATCH] System property for disabling watchdoge diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java -index 0ed95268364ea7f6a92a39b726a1e03bc815be07..ee0cca25ef458f2f0f7e450a2edea2b2adb7e846 100644 +index 2693cc933d746e40d8a47d96c6cb6799f0a2472f..6e1fa4f0616ccfd258acd1b4f5b08fc0ad4c9529 100644 --- a/src/main/java/org/spigotmc/WatchdogThread.java +++ b/src/main/java/org/spigotmc/WatchdogThread.java @@ -61,7 +61,7 @@ public class WatchdogThread extends Thread - while ( !stopping ) + while ( !this.stopping ) { // -- if ( lastTick != 0 && timeoutTime > 0 && monotonicMillis() > lastTick + timeoutTime ) -+ if ( lastTick != 0 && timeoutTime > 0 && monotonicMillis() > lastTick + timeoutTime && !Boolean.getBoolean("disable.watchdog")) // Paper - Add property to disable +- if ( this.lastTick != 0 && this.timeoutTime > 0 && WatchdogThread.monotonicMillis() > this.lastTick + this.timeoutTime ) ++ if ( this.lastTick != 0 && this.timeoutTime > 0 && WatchdogThread.monotonicMillis() > this.lastTick + this.timeoutTime && !Boolean.getBoolean("disable.watchdog")) // Paper - Add property to disable { Logger log = Bukkit.getServer().getLogger(); log.log( Level.SEVERE, "------------------------------" ); diff --git a/patches/server-remapped/0101-Optimize-UserCache-Thread-Safe.patch b/patches/server/0094-Optimize-UserCache-Thread-Safe.patch similarity index 62% rename from patches/server-remapped/0101-Optimize-UserCache-Thread-Safe.patch rename to patches/server/0094-Optimize-UserCache-Thread-Safe.patch index 4b08a22748..70a622d00d 100644 --- a/patches/server-remapped/0101-Optimize-UserCache-Thread-Safe.patch +++ b/patches/server/0094-Optimize-UserCache-Thread-Safe.patch @@ -9,105 +9,99 @@ easier to do this than replace the entire thing. Additionally, move Saving of the User cache to be done async, incase the user never changed the default setting for Spigot's save on stop only. +1.17: TODO does this need the synchronized blocks anymore? + diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 4e468cb7ccf683b8fc9e04a48cfc25779775e25f..211251fe7cd08074c040df2f4642f37d5f90d856 100644 +index ef231e11b90b24418a77b62f5fe766c9ac10c09b..74073d3f8c9dda6f10e9fb34071dae079b73fb24 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -905,7 +905,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { // Paper try { BufferedWriter bufferedwriter = Files.newWriter(this.file, StandardCharsets.UTF_8); -@@ -268,6 +270,14 @@ public class GameProfileCache { +@@ -305,6 +306,14 @@ public class GameProfileCache { } catch (IOException ioexception) { ; } + // Paper start + }; + if (asyncSave) { -+ MCUtil.scheduleAsyncTask(save); ++ net.minecraft.server.MCUtil.scheduleAsyncTask(save); + } else { + save.run(); + } diff --git a/patches/server/0095-Optional-TNT-doesn-t-move-in-water.patch b/patches/server/0095-Optional-TNT-doesn-t-move-in-water.patch new file mode 100644 index 0000000000..efbfcf82f0 --- /dev/null +++ b/patches/server/0095-Optional-TNT-doesn-t-move-in-water.patch @@ -0,0 +1,82 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Zach Brown +Date: Sun, 22 May 2016 20:20:55 -0500 +Subject: [PATCH] Optional TNT doesn't move in water + + +diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +index eb04fdb172a50ec1f5b7fe78fa0e7655246abd60..9b2e9a02ff31c3cb37b67135d0a03441f247d8e2 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java ++++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +@@ -291,4 +291,14 @@ public class PaperWorldConfig { + ); + } + } ++ ++ public boolean preventTntFromMovingInWater; ++ private void preventTntFromMovingInWater() { ++ if (PaperConfig.version < 13) { ++ boolean oldVal = getBoolean("enable-old-tnt-cannon-behaviors", false); ++ set("prevent-tnt-from-moving-in-water", oldVal); ++ } ++ preventTntFromMovingInWater = getBoolean("prevent-tnt-from-moving-in-water", false); ++ log("Prevent TNT from moving in water: " + preventTntFromMovingInWater); ++ } + } +diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java +index ac57bfb00edd9268e89a7fd7cea36097d61d6951..ad9bbda31a4cdb306ca40f2b99e4b815c4f136bd 100644 +--- a/src/main/java/net/minecraft/server/level/ServerEntity.java ++++ b/src/main/java/net/minecraft/server/level/ServerEntity.java +@@ -68,7 +68,7 @@ public class ServerEntity { + private boolean wasRiding; + private boolean wasOnGround; + // CraftBukkit start +- private final Set trackedPlayers; ++ final Set trackedPlayers; // Paper - private -> package + + public ServerEntity(ServerLevel worldserver, Entity entity, int i, boolean flag, Consumer> consumer, Set trackedPlayers) { + this.trackedPlayers = trackedPlayers; +diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java +index abc62c560816d945642d830a020deb28ff2efa37..5a16de4f080c31d6e278363fd1d3e23d48be3db5 100644 +--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java ++++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java +@@ -97,6 +97,27 @@ public class PrimedTnt extends Entity { + } + } + ++ // Paper start - Optional prevent TNT from moving in water ++ if (!this.isRemoved() && this.wasTouchingWater && this.level.paperConfig.preventTntFromMovingInWater) { ++ /* ++ * Author: Jedediah Smith ++ */ ++ // Send position and velocity updates to nearby players on every tick while the TNT is in water. ++ // This does pretty well at keeping their clients in sync with the server. ++ net.minecraft.server.level.ChunkMap.TrackedEntity ete = ((net.minecraft.server.level.ServerLevel)this.level).getChunkSource().chunkMap.entityMap.get(this.getId()); ++ if (ete != null) { ++ net.minecraft.network.protocol.game.ClientboundSetEntityMotionPacket velocityPacket = new net.minecraft.network.protocol.game.ClientboundSetEntityMotionPacket(this); ++ net.minecraft.network.protocol.game.ClientboundTeleportEntityPacket positionPacket = new net.minecraft.network.protocol.game.ClientboundTeleportEntityPacket(this); ++ ++ ete.seenBy.stream() ++ .filter(viewer -> (viewer.getPlayer().getX() - this.getX()) * (viewer.getPlayer().getY() - this.getY()) * (viewer.getPlayer().getZ() - this.getZ()) < 16 * 16) ++ .forEach(viewer -> { ++ viewer.send(velocityPacket); ++ viewer.send(positionPacket); ++ }); ++ } ++ } ++ // Paper end + } + + private void explode() { +@@ -152,4 +173,11 @@ public class PrimedTnt extends Entity { + public Packet getAddEntityPacket() { + return new ClientboundAddEntityPacket(this); + } ++ ++ // Paper start - Optional prevent TNT from moving in water ++ @Override ++ public boolean isPushedByFluid() { ++ return !level.paperConfig.preventTntFromMovingInWater && super.isPushedByFluid(); ++ } ++ // Paper end + } diff --git a/patches/server-remapped/0104-Faster-redstone-torch-rapid-clock-removal.patch b/patches/server/0096-Faster-redstone-torch-rapid-clock-removal.patch similarity index 69% rename from patches/server-remapped/0104-Faster-redstone-torch-rapid-clock-removal.patch rename to patches/server/0096-Faster-redstone-torch-rapid-clock-removal.patch index cc437e7353..89a9e109f6 100644 --- a/patches/server-remapped/0104-Faster-redstone-torch-rapid-clock-removal.patch +++ b/patches/server/0096-Faster-redstone-torch-rapid-clock-removal.patch @@ -6,27 +6,19 @@ Subject: [PATCH] Faster redstone torch rapid clock removal Only resize the the redstone torch list once, since resizing arrays / lists is costly diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 8f0fec38b482465285057d3fd27d456cf036f2fd..5f3d17cb247156fc8aaa7a763e402c2bbb42a7ec 100644 +index fa567322ca3f09d81479826b0119ddc922c41d11..e26cb05a91cf2b3ac059dcb55bc52f1e4f30b362 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -48,6 +48,7 @@ import net.minecraft.world.level.biome.BiomeManager; - import net.minecraft.world.level.block.BaseFireBlock; - import net.minecraft.world.level.block.Block; - import net.minecraft.world.level.block.Blocks; -+import net.minecraft.world.level.block.RedstoneTorchBlock; - import net.minecraft.world.level.block.entity.BlockEntity; - import net.minecraft.world.level.block.entity.BlockEntityType; - import net.minecraft.world.level.block.entity.TickableBlockEntity; -@@ -142,6 +143,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -159,6 +159,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { private org.spigotmc.TickLimiter tileLimiter; private int tileTickPosition; public final Map explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions -+ public java.util.ArrayDeque redstoneUpdateInfos; // Paper - Move from Map in BlockRedstoneTorch to here ++ public java.util.ArrayDeque redstoneUpdateInfos; // Paper - Move from Map in BlockRedstoneTorch to here public CraftWorld getWorld() { return this.world; diff --git a/src/main/java/net/minecraft/world/level/block/RedstoneTorchBlock.java b/src/main/java/net/minecraft/world/level/block/RedstoneTorchBlock.java -index 7d71c99c2268174fbea4297f028b75a3a0f43c11..dd4391086aff05bdea81e62b950b88cfab5ac6b8 100644 +index 28e785813628e5763576812ec6201d1e5b1def23..47df36208d91dad126849e29c0e410f95b168f23 100644 --- a/src/main/java/net/minecraft/world/level/block/RedstoneTorchBlock.java +++ b/src/main/java/net/minecraft/world/level/block/RedstoneTorchBlock.java @@ -21,7 +21,7 @@ import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit @@ -35,10 +27,10 @@ index 7d71c99c2268174fbea4297f028b75a3a0f43c11..dd4391086aff05bdea81e62b950b88cf public static final BooleanProperty LIT = BlockStateProperties.LIT; - private static final Map> RECENT_TOGGLES = new WeakHashMap(); + // Paper - Move the mapped list to World - - protected RedstoneTorchBlock(BlockBehaviour.Properties settings) { - super(settings, DustParticleOptions.REDSTONE); -@@ -68,11 +68,15 @@ public class RedstoneTorchBlock extends TorchBlock { + public static final int RECENT_TOGGLE_TIMER = 60; + public static final int MAX_RECENT_TOGGLES = 8; + public static final int RESTART_DELAY = 160; +@@ -72,11 +72,15 @@ public class RedstoneTorchBlock extends TorchBlock { @Override public void tick(BlockState state, ServerLevel world, BlockPos pos, Random random) { boolean flag = this.hasNeighborSignal((Level) world, pos, state); @@ -50,7 +42,7 @@ index 7d71c99c2268174fbea4297f028b75a3a0f43c11..dd4391086aff05bdea81e62b950b88cf + java.util.ArrayDeque redstoneUpdateInfos = world.redstoneUpdateInfos; + if (redstoneUpdateInfos != null) { + RedstoneTorchBlock.Toggle curr; -+ while ((curr = redstoneUpdateInfos.peek()) != null && world.getGameTime() - curr.getTime() > 60L) { ++ while ((curr = redstoneUpdateInfos.peek()) != null && world.getGameTime() - curr.when > 60L) { + redstoneUpdateInfos.poll(); + } } @@ -58,7 +50,7 @@ index 7d71c99c2268174fbea4297f028b75a3a0f43c11..dd4391086aff05bdea81e62b950b88cf // CraftBukkit start org.bukkit.plugin.PluginManager manager = world.getCraftServer().getPluginManager(); -@@ -137,9 +141,12 @@ public class RedstoneTorchBlock extends TorchBlock { +@@ -152,9 +156,12 @@ public class RedstoneTorchBlock extends TorchBlock { } private static boolean isToggledTooFrequently(Level world, BlockPos pos, boolean addNew) { @@ -74,7 +66,7 @@ index 7d71c99c2268174fbea4297f028b75a3a0f43c11..dd4391086aff05bdea81e62b950b88cf if (addNew) { list.add(new RedstoneTorchBlock.Toggle(pos.immutable(), world.getGameTime())); -@@ -147,9 +154,9 @@ public class RedstoneTorchBlock extends TorchBlock { +@@ -162,9 +169,9 @@ public class RedstoneTorchBlock extends TorchBlock { int i = 0; @@ -87,12 +79,3 @@ index 7d71c99c2268174fbea4297f028b75a3a0f43c11..dd4391086aff05bdea81e62b950b88cf if (blockredstonetorch_redstoneupdateinfo.pos.equals(pos)) { ++i; if (i >= 8) { -@@ -164,7 +171,7 @@ public class RedstoneTorchBlock extends TorchBlock { - public static class Toggle { - - private final BlockPos pos; -- private final long when; -+ private final long when; final long getTime() { return this.when; } // Paper - OBFHELPER - - public Toggle(BlockPos pos, long time) { - this.pos = pos; diff --git a/patches/server-remapped/0105-Add-server-name-parameter.patch b/patches/server/0097-Add-server-name-parameter.patch similarity index 90% rename from patches/server-remapped/0105-Add-server-name-parameter.patch rename to patches/server/0097-Add-server-name-parameter.patch index 50ec621547..91becbdb5d 100644 --- a/patches/server-remapped/0105-Add-server-name-parameter.patch +++ b/patches/server/0097-Add-server-name-parameter.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add server-name parameter diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index e8c225fcd1a3fa5a7e1971683b1876dd6462a1e2..b849b2afd009da433fe6cea5837b3ee9bb5c52b4 100644 +index 399cb06c7ae3570d08430e8675f141657d1026d4..6985e8dc3d520eb65ae7d885138be81836452c01 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -143,6 +143,14 @@ public class Main { diff --git a/patches/server-remapped/0106-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch b/patches/server/0098-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch similarity index 80% rename from patches/server-remapped/0106-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch rename to patches/server/0098-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch index e84fc6a07e..a8e8cec032 100644 --- a/patches/server-remapped/0106-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch +++ b/patches/server/0098-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Only send Dragon/Wither Death sounds to same world Also fix view distance lookup diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java -index 8d1b3cbb21fe798c27ad2d39bccffa9cc983cf96..39298b69918da890c3faa516f80d1a69adb88fe2 100644 +index 3a2a20c407374e5e62aa8ef2967a5b189d4e9658..9d6d8bf5f38ec11f26665ae676c46e4ef089670b 100644 --- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java +++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java -@@ -619,8 +619,9 @@ public class EnderDragon extends Mob implements Enemy { +@@ -640,8 +640,9 @@ public class EnderDragon extends Mob implements Enemy { if (this.dragonDeathTime == 1 && !this.isSilent()) { // CraftBukkit start - Use relative location for far away sounds // this.world.b(1028, this.getChunkCoordinates(), 0); @@ -22,18 +22,10 @@ index 8d1b3cbb21fe798c27ad2d39bccffa9cc983cf96..39298b69918da890c3faa516f80d1a69 double deltaZ = this.getZ() - player.getZ(); double distanceSquared = deltaX * deltaX + deltaZ * deltaZ; diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java -index 61c982ead18334a29438ef8e024d97ead178a2c8..3a80869dc3c16cb81ac87100f28d63eee722067f 100644 +index e231bb4d0bbb19b219ec78e4c1084103c0070733..03263689479d0f163fceb834bda07e7be13b798d 100644 --- a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java +++ b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java -@@ -46,7 +46,6 @@ import net.minecraft.network.syncher.EntityDataSerializers; - import net.minecraft.network.syncher.SynchedEntityData; - import net.minecraft.server.MinecraftServer; - import net.minecraft.server.level.ServerBossEvent; --import net.minecraft.server.level.ServerLevel; - import net.minecraft.server.level.ServerPlayer; - import net.minecraft.sounds.SoundEvent; - import net.minecraft.sounds.SoundEvents; -@@ -256,8 +255,9 @@ public class WitherBoss extends Monster implements RangedAttackMob { +@@ -260,8 +260,9 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob if (!this.isSilent()) { // CraftBukkit start - Use relative location for far away sounds // this.world.b(1023, new BlockPosition(this), 0);