From 6a05c851766945f58696d376cf7b252b38f6d0b9 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Thu, 13 Jun 2024 10:30:39 -0700 Subject: [PATCH] 117 --- .../server/Add-EntityZapEvent.patch | 0 .../Add-PlayerUseUnknownEntityEvent.patch | 0 .../server/Add-ProjectileCollideEvent.patch | 0 .../server/Add-World-Util-Methods.patch | 0 ...-to-configure-frosted_ice-properties.patch | 0 .../Add-exception-reporting-event.patch | 35 ++++++------------- ...ent-to-allow-plugins-to-handle-clien.patch | 2 +- ...working-with-arrows-stuck-in-living-.patch | 0 .../server/Add-server-name-parameter.patch | 0 ...setting-for-proxy-online-mode-status.patch | 0 .../Add-source-to-PlayerExpChangeEvent.patch | 2 +- .../Allow-Reloading-of-Command-Aliases.patch | 0 ...llow-Reloading-of-Custom-Permissions.patch | 0 .../Async-GameProfileCache-saving.patch | 0 ...blocking-on-Network-Manager-creation.patch | 0 .../Bound-Treasure-Maps-to-World-Border.patch | 6 ++-- .../Cache-user-authenticator-threads.patch | 0 .../server/Chunk-Save-Reattempt.patch | 0 .../server/Complete-resource-pack-API.patch | 0 .../Configurable-Chunk-Inhabited-Time.patch | 0 ...urable-Non-Player-Arrow-Despawn-Rate.patch | 0 .../Configurable-Player-Collision.patch | 0 .../server/Configurable-RCON-IP-address.patch | 0 .../Configurable-flying-kick-messages.patch | 4 +-- ...onfigurable-packet-in-spam-threshold.patch | 0 ...gurable-random-tick-rates-for-blocks.patch | 0 ...le-spawn-chances-for-skeleton-horses.patch | 0 .../Custom-replacement-for-eaten-items.patch | 0 ...ading-permissions.yml-before-plugins.patch | 0 ...oreboards-for-non-players-by-default.patch | 0 .../Do-not-load-chunks-for-Pathfinding.patch | 0 ...e-profiles-that-have-no-UUID-and-no-.patch | 0 ...y-scoreboard-teams-to-scoreboard.dat.patch | 0 ...Entity-AddTo-RemoveFrom-World-Events.patch | 0 .../server/EntityPathfindEvent.patch | 0 ...ityRegainHealthEvent-isFastRegen-API.patch | 0 ...r-redstone-torch-rapid-clock-removal.patch | 0 ...-entity-nbt-data-from-falling-blocks.patch | 0 ...g-BlockPlaceEvent-triggering-physics.patch | 0 .../server/Fix-global-sound-handling.patch | 4 +-- .../Handle-Item-Meta-Inconsistencies.patch | 20 +++++------ ...able-API-and-replenishable-lootables.patch | 4 +-- ...ckPhysicsEvent-if-a-plugin-has-a-lis.patch | 0 ...ptimise-BlockState-s-hashCode-equals.patch | 0 .../server/Optimize-DataBits.patch | 0 ...ize-Level.hasChunkAt-BlockPosition-Z.patch | 0 ...nilla-per-world-scoreboard-coloring-.patch | 0 .../Optional-TNT-doesn-t-move-in-water.patch | 4 +-- ...vent-Pathfinding-out-of-World-Border.patch | 0 .../server/Remove-Metadata-on-reload.patch | 0 ...egionFileCache-and-make-configurable.patch | 0 ...tem-property-for-disabling-watchdoge.patch | 0 .../Use-a-Shared-Random-for-Entities.patch | 0 ...th-absorb-values-and-repair-bad-data.patch | 4 +-- ...-possibility-for-getServer-singleton.patch | 2 +- 55 files changed, 36 insertions(+), 51 deletions(-) rename patches/{unapplied => }/server/Add-EntityZapEvent.patch (100%) rename patches/{unapplied => }/server/Add-PlayerUseUnknownEntityEvent.patch (100%) rename patches/{unapplied => }/server/Add-ProjectileCollideEvent.patch (100%) rename patches/{unapplied => }/server/Add-World-Util-Methods.patch (100%) rename patches/{unapplied => }/server/Add-ability-to-configure-frosted_ice-properties.patch (100%) rename patches/{unapplied => }/server/Add-exception-reporting-event.patch (88%) rename patches/{unapplied => }/server/Add-handshake-event-to-allow-plugins-to-handle-clien.patch (98%) rename patches/{unapplied => }/server/Add-methods-for-working-with-arrows-stuck-in-living-.patch (100%) rename patches/{unapplied => }/server/Add-server-name-parameter.patch (100%) rename patches/{unapplied => }/server/Add-setting-for-proxy-online-mode-status.patch (100%) rename patches/{unapplied => }/server/Add-source-to-PlayerExpChangeEvent.patch (96%) rename patches/{unapplied => }/server/Allow-Reloading-of-Command-Aliases.patch (100%) rename patches/{unapplied => }/server/Allow-Reloading-of-Custom-Permissions.patch (100%) rename patches/{unapplied => }/server/Async-GameProfileCache-saving.patch (100%) rename patches/{unapplied => }/server/Avoid-blocking-on-Network-Manager-creation.patch (100%) rename patches/{unapplied => }/server/Bound-Treasure-Maps-to-World-Border.patch (85%) rename patches/{unapplied => }/server/Cache-user-authenticator-threads.patch (100%) rename patches/{unapplied => }/server/Chunk-Save-Reattempt.patch (100%) rename patches/{unapplied => }/server/Complete-resource-pack-API.patch (100%) rename patches/{unapplied => }/server/Configurable-Chunk-Inhabited-Time.patch (100%) rename patches/{unapplied => }/server/Configurable-Non-Player-Arrow-Despawn-Rate.patch (100%) rename patches/{unapplied => }/server/Configurable-Player-Collision.patch (100%) rename patches/{unapplied => }/server/Configurable-RCON-IP-address.patch (100%) rename patches/{unapplied => }/server/Configurable-flying-kick-messages.patch (90%) rename patches/{unapplied => }/server/Configurable-packet-in-spam-threshold.patch (100%) rename patches/{unapplied => }/server/Configurable-random-tick-rates-for-blocks.patch (100%) rename patches/{unapplied => }/server/Configurable-spawn-chances-for-skeleton-horses.patch (100%) rename patches/{unapplied => }/server/Custom-replacement-for-eaten-items.patch (100%) rename patches/{unapplied => }/server/Default-loading-permissions.yml-before-plugins.patch (100%) rename patches/{unapplied => }/server/Disable-Scoreboards-for-non-players-by-default.patch (100%) rename patches/{unapplied => }/server/Do-not-load-chunks-for-Pathfinding.patch (100%) rename patches/{unapplied => }/server/Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch (100%) rename patches/{unapplied => }/server/Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch (100%) rename patches/{unapplied => }/server/Entity-AddTo-RemoveFrom-World-Events.patch (100%) rename patches/{unapplied => }/server/EntityPathfindEvent.patch (100%) rename patches/{unapplied => }/server/EntityRegainHealthEvent-isFastRegen-API.patch (100%) rename patches/{unapplied => }/server/Faster-redstone-torch-rapid-clock-removal.patch (100%) rename patches/{unapplied => }/server/Filter-bad-block-entity-nbt-data-from-falling-blocks.patch (100%) rename patches/{unapplied => }/server/Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch (100%) rename patches/{unapplied => }/server/Fix-global-sound-handling.patch (99%) rename patches/{unapplied => }/server/Handle-Item-Meta-Inconsistencies.patch (95%) rename patches/{unapplied => }/server/LootTable-API-and-replenishable-lootables.patch (99%) rename patches/{unapplied => }/server/Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch (100%) rename patches/{unapplied => }/server/Optimise-BlockState-s-hashCode-equals.patch (100%) rename patches/{unapplied => }/server/Optimize-DataBits.patch (100%) rename patches/{unapplied => }/server/Optimize-Level.hasChunkAt-BlockPosition-Z.patch (100%) rename patches/{unapplied => }/server/Option-to-use-vanilla-per-world-scoreboard-coloring-.patch (100%) rename patches/{unapplied => }/server/Optional-TNT-doesn-t-move-in-water.patch (95%) rename patches/{unapplied => }/server/Prevent-Pathfinding-out-of-World-Border.patch (100%) rename patches/{unapplied => }/server/Remove-Metadata-on-reload.patch (100%) rename patches/{unapplied => }/server/Sanitise-RegionFileCache-and-make-configurable.patch (100%) rename patches/{unapplied => }/server/System-property-for-disabling-watchdoge.patch (100%) rename patches/{unapplied => }/server/Use-a-Shared-Random-for-Entities.patch (100%) rename patches/{unapplied => }/server/handle-NaN-health-absorb-values-and-repair-bad-data.patch (95%) rename patches/{unapplied => }/server/remove-null-possibility-for-getServer-singleton.patch (95%) diff --git a/patches/unapplied/server/Add-EntityZapEvent.patch b/patches/server/Add-EntityZapEvent.patch similarity index 100% rename from patches/unapplied/server/Add-EntityZapEvent.patch rename to patches/server/Add-EntityZapEvent.patch diff --git a/patches/unapplied/server/Add-PlayerUseUnknownEntityEvent.patch b/patches/server/Add-PlayerUseUnknownEntityEvent.patch similarity index 100% rename from patches/unapplied/server/Add-PlayerUseUnknownEntityEvent.patch rename to patches/server/Add-PlayerUseUnknownEntityEvent.patch diff --git a/patches/unapplied/server/Add-ProjectileCollideEvent.patch b/patches/server/Add-ProjectileCollideEvent.patch similarity index 100% rename from patches/unapplied/server/Add-ProjectileCollideEvent.patch rename to patches/server/Add-ProjectileCollideEvent.patch diff --git a/patches/unapplied/server/Add-World-Util-Methods.patch b/patches/server/Add-World-Util-Methods.patch similarity index 100% rename from patches/unapplied/server/Add-World-Util-Methods.patch rename to patches/server/Add-World-Util-Methods.patch diff --git a/patches/unapplied/server/Add-ability-to-configure-frosted_ice-properties.patch b/patches/server/Add-ability-to-configure-frosted_ice-properties.patch similarity index 100% rename from patches/unapplied/server/Add-ability-to-configure-frosted_ice-properties.patch rename to patches/server/Add-ability-to-configure-frosted_ice-properties.patch diff --git a/patches/unapplied/server/Add-exception-reporting-event.patch b/patches/server/Add-exception-reporting-event.patch similarity index 88% rename from patches/unapplied/server/Add-exception-reporting-event.patch rename to patches/server/Add-exception-reporting-event.patch index 4b3fca44a4..b6240f4cfc 100644 --- a/patches/unapplied/server/Add-exception-reporting-event.patch +++ b/patches/server/Add-exception-reporting-event.patch @@ -126,35 +126,22 @@ diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -@@ -0,0 +0,0 @@ - package net.minecraft.world.level.chunk; - - import com.google.common.collect.ImmutableList; -+import com.destroystokyo.paper.exception.ServerInternalException; - import com.google.common.collect.Maps; - import com.google.common.collect.UnmodifiableIterator; - import com.mojang.logging.LogUtils; @@ -0,0 +0,0 @@ public class LevelChunk extends ChunkAccess { + BlockState iblockdata = this.getBlockState(blockposition); - // CraftBukkit start - } else { -- System.out.println("Attempted to place a tile entity (" + blockEntity + ") at " + blockEntity.getBlockPos().getX() + "," + blockEntity.getBlockPos().getY() + "," + blockEntity.getBlockPos().getZ() -- + " (" + this.getBlockState(blockposition) + ") where there was no entity tile!"); -- System.out.println("Chunk coordinates: " + (this.chunkPos.x * 16) + "," + (this.chunkPos.z * 16)); -- new Exception().printStackTrace(); + if (!iblockdata.hasBlockEntity()) { +- LevelChunk.LOGGER.warn("Trying to set block entity {} at position {}, but state {} does not allow it", new Object[]{blockEntity, blockposition, iblockdata}); +- new Exception().printStackTrace(); // CraftBukkit + // Paper start - ServerExceptionEvent -+ ServerInternalException e = new ServerInternalException( -+ "Attempted to place a tile entity (" + blockEntity + ") at " + blockEntity.getBlockPos().getX() + "," -+ + blockEntity.getBlockPos().getY() + "," + blockEntity.getBlockPos().getZ() -+ + " (" + getBlockState(blockposition) + ") where there was no entity tile!\n" + -+ "Chunk coordinates: " + (this.chunkPos.x * 16) + "," + (this.chunkPos.z * 16) + -+ "\nWorld: " + level.getLevel().dimension().location()); ++ com.destroystokyo.paper.exception.ServerInternalException e = new com.destroystokyo.paper.exception.ServerInternalException( ++ "Trying to set block entity %s at position %s, but state %s does not allow it".formatted(blockEntity, blockposition, iblockdata) ++ ); + e.printStackTrace(); -+ ServerInternalException.reportInternalException(e); ++ com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(e); + // Paper end - ServerExceptionEvent - // CraftBukkit end - } - } + } else { + BlockState iblockdata1 = blockEntity.getBlockState(); + @@ -0,0 +0,0 @@ public class LevelChunk extends ChunkAccess { // Paper start - Prevent block entity and entity crashes final String msg = String.format("BlockEntity threw exception at %s:%s,%s,%s", LevelChunk.this.getLevel().getWorld().getName(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ()); diff --git a/patches/unapplied/server/Add-handshake-event-to-allow-plugins-to-handle-clien.patch b/patches/server/Add-handshake-event-to-allow-plugins-to-handle-clien.patch similarity index 98% rename from patches/unapplied/server/Add-handshake-event-to-allow-plugins-to-handle-clien.patch rename to patches/server/Add-handshake-event-to-allow-plugins-to-handle-clien.patch index 32faf813e2..3e7b3ac7f7 100644 --- a/patches/unapplied/server/Add-handshake-event-to-allow-plugins-to-handle-clien.patch +++ b/patches/server/Add-handshake-event-to-allow-plugins-to-handle-clien.patch @@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java @@ -0,0 +0,0 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL - this.connection.disconnect(ichatmutablecomponent); + this.connection.disconnect((Component) ichatmutablecomponent); } else { this.connection.setupInboundProtocol(LoginProtocols.SERVERBOUND, new ServerLoginPacketListenerImpl(this.server, this.connection, transfer)); + // Paper start - PlayerHandshakeEvent diff --git a/patches/unapplied/server/Add-methods-for-working-with-arrows-stuck-in-living-.patch b/patches/server/Add-methods-for-working-with-arrows-stuck-in-living-.patch similarity index 100% rename from patches/unapplied/server/Add-methods-for-working-with-arrows-stuck-in-living-.patch rename to patches/server/Add-methods-for-working-with-arrows-stuck-in-living-.patch diff --git a/patches/unapplied/server/Add-server-name-parameter.patch b/patches/server/Add-server-name-parameter.patch similarity index 100% rename from patches/unapplied/server/Add-server-name-parameter.patch rename to patches/server/Add-server-name-parameter.patch diff --git a/patches/unapplied/server/Add-setting-for-proxy-online-mode-status.patch b/patches/server/Add-setting-for-proxy-online-mode-status.patch similarity index 100% rename from patches/unapplied/server/Add-setting-for-proxy-online-mode-status.patch rename to patches/server/Add-setting-for-proxy-online-mode-status.patch diff --git a/patches/unapplied/server/Add-source-to-PlayerExpChangeEvent.patch b/patches/server/Add-source-to-PlayerExpChangeEvent.patch similarity index 96% rename from patches/unapplied/server/Add-source-to-PlayerExpChangeEvent.patch rename to patches/server/Add-source-to-PlayerExpChangeEvent.patch index 49b1a821fa..1c4e9e94a5 100644 --- a/patches/unapplied/server/Add-source-to-PlayerExpChangeEvent.patch +++ b/patches/server/Add-source-to-PlayerExpChangeEvent.patch @@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java +++ b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java @@ -0,0 +0,0 @@ public class ExperienceOrb extends Entity { - int i = this.repairPlayerItems(player, this.value); + int i = this.repairPlayerItems(entityplayer, this.value); if (i > 0) { - player.giveExperiencePoints(CraftEventFactory.callPlayerExpChangeEvent(player, i).getAmount()); // CraftBukkit - this.value -> event.getAmount() diff --git a/patches/unapplied/server/Allow-Reloading-of-Command-Aliases.patch b/patches/server/Allow-Reloading-of-Command-Aliases.patch similarity index 100% rename from patches/unapplied/server/Allow-Reloading-of-Command-Aliases.patch rename to patches/server/Allow-Reloading-of-Command-Aliases.patch diff --git a/patches/unapplied/server/Allow-Reloading-of-Custom-Permissions.patch b/patches/server/Allow-Reloading-of-Custom-Permissions.patch similarity index 100% rename from patches/unapplied/server/Allow-Reloading-of-Custom-Permissions.patch rename to patches/server/Allow-Reloading-of-Custom-Permissions.patch diff --git a/patches/unapplied/server/Async-GameProfileCache-saving.patch b/patches/server/Async-GameProfileCache-saving.patch similarity index 100% rename from patches/unapplied/server/Async-GameProfileCache-saving.patch rename to patches/server/Async-GameProfileCache-saving.patch diff --git a/patches/unapplied/server/Avoid-blocking-on-Network-Manager-creation.patch b/patches/server/Avoid-blocking-on-Network-Manager-creation.patch similarity index 100% rename from patches/unapplied/server/Avoid-blocking-on-Network-Manager-creation.patch rename to patches/server/Avoid-blocking-on-Network-Manager-creation.patch diff --git a/patches/unapplied/server/Bound-Treasure-Maps-to-World-Border.patch b/patches/server/Bound-Treasure-Maps-to-World-Border.patch similarity index 85% rename from patches/unapplied/server/Bound-Treasure-Maps-to-World-Border.patch rename to patches/server/Bound-Treasure-Maps-to-World-Border.patch index 56ffb5a684..4645354cba 100644 --- a/patches/unapplied/server/Bound-Treasure-Maps-to-World-Border.patch +++ b/patches/server/Bound-Treasure-Maps-to-World-Border.patch @@ -15,7 +15,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/level/border/WorldBorder.java +++ b/src/main/java/net/minecraft/world/level/border/WorldBorder.java @@ -0,0 +0,0 @@ public class WorldBorder { - return (double) (pos.getX() + 1) > this.getMinX() && (double) pos.getX() < this.getMaxX() && (double) (pos.getZ() + 1) > this.getMinZ() && (double) pos.getZ() < this.getMaxZ(); + return this.isWithinBounds((double) chunkPos.getMinBlockX(), (double) chunkPos.getMinBlockZ()) && this.isWithinBounds((double) chunkPos.getMaxBlockX(), (double) chunkPos.getMaxBlockZ()); } + // Paper start - Bound treasure maps to world border @@ -30,8 +30,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + // Paper end - Bound treasure maps to world border + - public boolean isWithinBounds(ChunkPos pos) { - return (double) pos.getMaxBlockX() > this.getMinX() && (double) pos.getMinBlockX() < this.getMaxX() && (double) pos.getMaxBlockZ() > this.getMinZ() && (double) pos.getMinBlockZ() < this.getMaxZ(); + public boolean isWithinBounds(AABB box) { + return this.isWithinBounds(box.minX, box.minZ, box.maxX - 9.999999747378752E-6D, box.maxZ - 9.999999747378752E-6D); } diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 diff --git a/patches/unapplied/server/Cache-user-authenticator-threads.patch b/patches/server/Cache-user-authenticator-threads.patch similarity index 100% rename from patches/unapplied/server/Cache-user-authenticator-threads.patch rename to patches/server/Cache-user-authenticator-threads.patch diff --git a/patches/unapplied/server/Chunk-Save-Reattempt.patch b/patches/server/Chunk-Save-Reattempt.patch similarity index 100% rename from patches/unapplied/server/Chunk-Save-Reattempt.patch rename to patches/server/Chunk-Save-Reattempt.patch diff --git a/patches/unapplied/server/Complete-resource-pack-API.patch b/patches/server/Complete-resource-pack-API.patch similarity index 100% rename from patches/unapplied/server/Complete-resource-pack-API.patch rename to patches/server/Complete-resource-pack-API.patch diff --git a/patches/unapplied/server/Configurable-Chunk-Inhabited-Time.patch b/patches/server/Configurable-Chunk-Inhabited-Time.patch similarity index 100% rename from patches/unapplied/server/Configurable-Chunk-Inhabited-Time.patch rename to patches/server/Configurable-Chunk-Inhabited-Time.patch diff --git a/patches/unapplied/server/Configurable-Non-Player-Arrow-Despawn-Rate.patch b/patches/server/Configurable-Non-Player-Arrow-Despawn-Rate.patch similarity index 100% rename from patches/unapplied/server/Configurable-Non-Player-Arrow-Despawn-Rate.patch rename to patches/server/Configurable-Non-Player-Arrow-Despawn-Rate.patch diff --git a/patches/unapplied/server/Configurable-Player-Collision.patch b/patches/server/Configurable-Player-Collision.patch similarity index 100% rename from patches/unapplied/server/Configurable-Player-Collision.patch rename to patches/server/Configurable-Player-Collision.patch diff --git a/patches/unapplied/server/Configurable-RCON-IP-address.patch b/patches/server/Configurable-RCON-IP-address.patch similarity index 100% rename from patches/unapplied/server/Configurable-RCON-IP-address.patch rename to patches/server/Configurable-RCON-IP-address.patch diff --git a/patches/unapplied/server/Configurable-flying-kick-messages.patch b/patches/server/Configurable-flying-kick-messages.patch similarity index 90% rename from patches/unapplied/server/Configurable-flying-kick-messages.patch rename to patches/server/Configurable-flying-kick-messages.patch index b2d871a645..5c25851403 100644 --- a/patches/unapplied/server/Configurable-flying-kick-messages.patch +++ b/patches/server/Configurable-flying-kick-messages.patch @@ -12,7 +12,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (this.clientIsFloating && !this.player.isSleeping() && !this.player.isPassenger() && !this.player.isDeadOrDying()) { if (++this.aboveGroundTickCount > this.getMaximumFlyingTicks(this.player)) { ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked for floating too long!", this.player.getName().getString()); -- this.disconnect(Component.translatable("multiplayer.disconnect.flying")); +- this.disconnect((Component) Component.translatable("multiplayer.disconnect.flying")); + this.disconnect(io.papermc.paper.configuration.GlobalConfiguration.get().messages.kick.flyingPlayer); // Paper - use configurable kick message return; } @@ -21,7 +21,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (this.clientVehicleIsFloating && this.lastVehicle.getControllingPassenger() == this.player) { if (++this.aboveGroundVehicleTickCount > this.getMaximumFlyingTicks(this.lastVehicle)) { ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked for floating a vehicle too long!", this.player.getName().getString()); -- this.disconnect(Component.translatable("multiplayer.disconnect.flying")); +- this.disconnect((Component) Component.translatable("multiplayer.disconnect.flying")); + this.disconnect(io.papermc.paper.configuration.GlobalConfiguration.get().messages.kick.flyingVehicle); // Paper - use configurable kick message return; } diff --git a/patches/unapplied/server/Configurable-packet-in-spam-threshold.patch b/patches/server/Configurable-packet-in-spam-threshold.patch similarity index 100% rename from patches/unapplied/server/Configurable-packet-in-spam-threshold.patch rename to patches/server/Configurable-packet-in-spam-threshold.patch diff --git a/patches/unapplied/server/Configurable-random-tick-rates-for-blocks.patch b/patches/server/Configurable-random-tick-rates-for-blocks.patch similarity index 100% rename from patches/unapplied/server/Configurable-random-tick-rates-for-blocks.patch rename to patches/server/Configurable-random-tick-rates-for-blocks.patch diff --git a/patches/unapplied/server/Configurable-spawn-chances-for-skeleton-horses.patch b/patches/server/Configurable-spawn-chances-for-skeleton-horses.patch similarity index 100% rename from patches/unapplied/server/Configurable-spawn-chances-for-skeleton-horses.patch rename to patches/server/Configurable-spawn-chances-for-skeleton-horses.patch diff --git a/patches/unapplied/server/Custom-replacement-for-eaten-items.patch b/patches/server/Custom-replacement-for-eaten-items.patch similarity index 100% rename from patches/unapplied/server/Custom-replacement-for-eaten-items.patch rename to patches/server/Custom-replacement-for-eaten-items.patch diff --git a/patches/unapplied/server/Default-loading-permissions.yml-before-plugins.patch b/patches/server/Default-loading-permissions.yml-before-plugins.patch similarity index 100% rename from patches/unapplied/server/Default-loading-permissions.yml-before-plugins.patch rename to patches/server/Default-loading-permissions.yml-before-plugins.patch diff --git a/patches/unapplied/server/Disable-Scoreboards-for-non-players-by-default.patch b/patches/server/Disable-Scoreboards-for-non-players-by-default.patch similarity index 100% rename from patches/unapplied/server/Disable-Scoreboards-for-non-players-by-default.patch rename to patches/server/Disable-Scoreboards-for-non-players-by-default.patch diff --git a/patches/unapplied/server/Do-not-load-chunks-for-Pathfinding.patch b/patches/server/Do-not-load-chunks-for-Pathfinding.patch similarity index 100% rename from patches/unapplied/server/Do-not-load-chunks-for-Pathfinding.patch rename to patches/server/Do-not-load-chunks-for-Pathfinding.patch diff --git a/patches/unapplied/server/Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch b/patches/server/Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch similarity index 100% rename from patches/unapplied/server/Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch rename to patches/server/Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch diff --git a/patches/unapplied/server/Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch b/patches/server/Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch similarity index 100% rename from patches/unapplied/server/Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch rename to patches/server/Don-t-save-empty-scoreboard-teams-to-scoreboard.dat.patch diff --git a/patches/unapplied/server/Entity-AddTo-RemoveFrom-World-Events.patch b/patches/server/Entity-AddTo-RemoveFrom-World-Events.patch similarity index 100% rename from patches/unapplied/server/Entity-AddTo-RemoveFrom-World-Events.patch rename to patches/server/Entity-AddTo-RemoveFrom-World-Events.patch diff --git a/patches/unapplied/server/EntityPathfindEvent.patch b/patches/server/EntityPathfindEvent.patch similarity index 100% rename from patches/unapplied/server/EntityPathfindEvent.patch rename to patches/server/EntityPathfindEvent.patch diff --git a/patches/unapplied/server/EntityRegainHealthEvent-isFastRegen-API.patch b/patches/server/EntityRegainHealthEvent-isFastRegen-API.patch similarity index 100% rename from patches/unapplied/server/EntityRegainHealthEvent-isFastRegen-API.patch rename to patches/server/EntityRegainHealthEvent-isFastRegen-API.patch diff --git a/patches/unapplied/server/Faster-redstone-torch-rapid-clock-removal.patch b/patches/server/Faster-redstone-torch-rapid-clock-removal.patch similarity index 100% rename from patches/unapplied/server/Faster-redstone-torch-rapid-clock-removal.patch rename to patches/server/Faster-redstone-torch-rapid-clock-removal.patch diff --git a/patches/unapplied/server/Filter-bad-block-entity-nbt-data-from-falling-blocks.patch b/patches/server/Filter-bad-block-entity-nbt-data-from-falling-blocks.patch similarity index 100% rename from patches/unapplied/server/Filter-bad-block-entity-nbt-data-from-falling-blocks.patch rename to patches/server/Filter-bad-block-entity-nbt-data-from-falling-blocks.patch diff --git a/patches/unapplied/server/Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch b/patches/server/Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch similarity index 100% rename from patches/unapplied/server/Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch rename to patches/server/Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch diff --git a/patches/unapplied/server/Fix-global-sound-handling.patch b/patches/server/Fix-global-sound-handling.patch similarity index 99% rename from patches/unapplied/server/Fix-global-sound-handling.patch rename to patches/server/Fix-global-sound-handling.patch index 512167cf42..5d4073b197 100644 --- a/patches/unapplied/server/Fix-global-sound-handling.patch +++ b/patches/server/Fix-global-sound-handling.patch @@ -85,8 +85,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -0,0 +0,0 @@ public abstract class Level implements LevelAccessor, AutoCloseable { - - private ExplosionInteraction() {} + return this.id; + } } + // Paper start - respect global sound events gamerule + public List getPlayersForGlobalSoundGamerule() { diff --git a/patches/unapplied/server/Handle-Item-Meta-Inconsistencies.patch b/patches/server/Handle-Item-Meta-Inconsistencies.patch similarity index 95% rename from patches/unapplied/server/Handle-Item-Meta-Inconsistencies.patch rename to patches/server/Handle-Item-Meta-Inconsistencies.patch index e9e0f1cf22..0c92e288a8 100644 --- a/patches/unapplied/server/Handle-Item-Meta-Inconsistencies.patch +++ b/patches/server/Handle-Item-Meta-Inconsistencies.patch @@ -35,20 +35,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + private static final java.util.Comparator> ENCHANTMENT_ORDER = java.util.Comparator.comparing(Holder::getRegisteredName); + public static final ItemEnchantments EMPTY = new ItemEnchantments(new Object2IntAVLTreeMap<>(ENCHANTMENT_ORDER), true); + // Paper end - public static final int MAX_LEVEL = 255; private static final Codec LEVEL_CODEC = Codec.intRange(0, 255); -- private static final Codec>> LEVELS_CODEC = Codec.unboundedMap( -+ private static final Codec>> LEVELS_CODEC = Codec.unboundedMap( // Paper - BuiltInRegistries.ENCHANTMENT.holderByNameCodec(), LEVEL_CODEC - ) +- private static final Codec>> LEVELS_CODEC = Codec.unboundedMap(Enchantment.CODEC, LEVEL_CODEC) - .xmap(Object2IntOpenHashMap::new, Function.identity()); -+ // Paper start - sort enchantments ++ private static final Codec>> LEVELS_CODEC = Codec.unboundedMap( ++ Enchantment.CODEC, LEVEL_CODEC ++ )// Paper start - sort enchantments + .xmap(m -> { + final Object2IntAVLTreeMap> map = new Object2IntAVLTreeMap<>(ENCHANTMENT_ORDER); + map.putAll(m); + return map; + }, Function.identity()); -+ // Paper end - sort enchantments ++ // Paper end - sort enchantments private static final Codec FULL_CODEC = RecordCodecBuilder.create( instance -> instance.group( LEVELS_CODEC.fieldOf("levels").forGetter(component -> component.enchantments), @@ -56,8 +54,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 ); public static final Codec CODEC = Codec.withAlternative(FULL_CODEC, LEVELS_CODEC, map -> new ItemEnchantments(map, true)); public static final StreamCodec STREAM_CODEC = StreamCodec.composite( -- ByteBufCodecs.map(Object2IntOpenHashMap::new, ByteBufCodecs.holderRegistry(Registries.ENCHANTMENT), ByteBufCodecs.VAR_INT), -+ ByteBufCodecs.map((v) -> new Object2IntAVLTreeMap<>(ENCHANTMENT_ORDER), ByteBufCodecs.holderRegistry(Registries.ENCHANTMENT), ByteBufCodecs.VAR_INT), // Paper +- ByteBufCodecs.map(Object2IntOpenHashMap::new, Enchantment.STREAM_CODEC, ByteBufCodecs.VAR_INT), ++ ByteBufCodecs.map((v) -> new Object2IntAVLTreeMap<>(ENCHANTMENT_ORDER), Enchantment.STREAM_CODEC, ByteBufCodecs.VAR_INT), component -> component.enchantments, ByteBufCodecs.BOOL, component -> component.showInTooltip, @@ -102,7 +100,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + this.setItemMeta(itemMeta); } - ItemEnchantments.Mutable listCopy = new ItemEnchantments.Mutable(list); -- listCopy.set(CraftEnchantment.bukkitToMinecraft(ench), level); +- listCopy.set(CraftEnchantment.bukkitToMinecraftHolder(ench), level); - this.handle.set(DataComponents.ENCHANTMENTS, listCopy.toImmutable()); + // Paper end } @@ -135,7 +133,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } - - ItemEnchantments.Mutable listCopy = new ItemEnchantments.Mutable(list); -- listCopy.set(CraftEnchantment.bukkitToMinecraft(ench), -1); // Negative to remove +- listCopy.set(CraftEnchantment.bukkitToMinecraftHolder(ench), -1); // Negative to remove - this.handle.set(DataComponents.ENCHANTMENTS, listCopy.toImmutable()); + // Paper end diff --git a/patches/unapplied/server/LootTable-API-and-replenishable-lootables.patch b/patches/server/LootTable-API-and-replenishable-lootables.patch similarity index 99% rename from patches/unapplied/server/LootTable-API-and-replenishable-lootables.patch rename to patches/server/LootTable-API-and-replenishable-lootables.patch index b69e9e4ef7..4d01ae070f 100644 --- a/patches/unapplied/server/LootTable-API-and-replenishable-lootables.patch +++ b/patches/server/LootTable-API-and-replenishable-lootables.patch @@ -530,7 +530,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public interface RandomizableContainer extends Container { default boolean tryLoadLootTable(CompoundTag nbt) { if (nbt.contains("LootTable", 8)) { - this.setLootTable(ResourceKey.create(Registries.LOOT_TABLE, new ResourceLocation(nbt.getString("LootTable")))); + this.setLootTable(ResourceKey.create(Registries.LOOT_TABLE, ResourceLocation.parse(nbt.getString("LootTable")))); + if (this.lootableData() != null && this.getLootTable() != null) this.lootableData().loadNbt(nbt); // Paper - LootTable API if (nbt.contains("LootTableSeed", 4)) { this.setLootTableSeed(nbt.getLong("LootTableSeed")); @@ -663,7 +663,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 default void readChestVehicleSaveData(CompoundTag nbt, HolderLookup.Provider registriesLookup) { this.clearItemStacks(); if (nbt.contains("LootTable", 8)) { - this.setLootTable(ResourceKey.create(Registries.LOOT_TABLE, new ResourceLocation(nbt.getString("LootTable")))); + this.setLootTable(ResourceKey.create(Registries.LOOT_TABLE, ResourceLocation.parse(nbt.getString("LootTable")))); + // Paper start - LootTable API + if (this.getLootTable() != null) { + this.lootableData().loadNbt(nbt); diff --git a/patches/unapplied/server/Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch b/patches/server/Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch similarity index 100% rename from patches/unapplied/server/Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch rename to patches/server/Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch diff --git a/patches/unapplied/server/Optimise-BlockState-s-hashCode-equals.patch b/patches/server/Optimise-BlockState-s-hashCode-equals.patch similarity index 100% rename from patches/unapplied/server/Optimise-BlockState-s-hashCode-equals.patch rename to patches/server/Optimise-BlockState-s-hashCode-equals.patch diff --git a/patches/unapplied/server/Optimize-DataBits.patch b/patches/server/Optimize-DataBits.patch similarity index 100% rename from patches/unapplied/server/Optimize-DataBits.patch rename to patches/server/Optimize-DataBits.patch diff --git a/patches/unapplied/server/Optimize-Level.hasChunkAt-BlockPosition-Z.patch b/patches/server/Optimize-Level.hasChunkAt-BlockPosition-Z.patch similarity index 100% rename from patches/unapplied/server/Optimize-Level.hasChunkAt-BlockPosition-Z.patch rename to patches/server/Optimize-Level.hasChunkAt-BlockPosition-Z.patch diff --git a/patches/unapplied/server/Option-to-use-vanilla-per-world-scoreboard-coloring-.patch b/patches/server/Option-to-use-vanilla-per-world-scoreboard-coloring-.patch similarity index 100% rename from patches/unapplied/server/Option-to-use-vanilla-per-world-scoreboard-coloring-.patch rename to patches/server/Option-to-use-vanilla-per-world-scoreboard-coloring-.patch diff --git a/patches/unapplied/server/Optional-TNT-doesn-t-move-in-water.patch b/patches/server/Optional-TNT-doesn-t-move-in-water.patch similarity index 95% rename from patches/unapplied/server/Optional-TNT-doesn-t-move-in-water.patch rename to patches/server/Optional-TNT-doesn-t-move-in-water.patch index fb9532a5ab..8f1b42eb96 100644 --- a/patches/unapplied/server/Optional-TNT-doesn-t-move-in-water.patch +++ b/patches/server/Optional-TNT-doesn-t-move-in-water.patch @@ -37,8 +37,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 private void explode() { @@ -0,0 +0,0 @@ public class PrimedTnt extends Entity implements TraceableEntity { - public BlockState getBlockState() { - return (BlockState) this.entityData.get(PrimedTnt.DATA_BLOCK_STATE_ID); + + return entity; } + + // Paper start - Option to prevent TNT from moving in water diff --git a/patches/unapplied/server/Prevent-Pathfinding-out-of-World-Border.patch b/patches/server/Prevent-Pathfinding-out-of-World-Border.patch similarity index 100% rename from patches/unapplied/server/Prevent-Pathfinding-out-of-World-Border.patch rename to patches/server/Prevent-Pathfinding-out-of-World-Border.patch diff --git a/patches/unapplied/server/Remove-Metadata-on-reload.patch b/patches/server/Remove-Metadata-on-reload.patch similarity index 100% rename from patches/unapplied/server/Remove-Metadata-on-reload.patch rename to patches/server/Remove-Metadata-on-reload.patch diff --git a/patches/unapplied/server/Sanitise-RegionFileCache-and-make-configurable.patch b/patches/server/Sanitise-RegionFileCache-and-make-configurable.patch similarity index 100% rename from patches/unapplied/server/Sanitise-RegionFileCache-and-make-configurable.patch rename to patches/server/Sanitise-RegionFileCache-and-make-configurable.patch diff --git a/patches/unapplied/server/System-property-for-disabling-watchdoge.patch b/patches/server/System-property-for-disabling-watchdoge.patch similarity index 100% rename from patches/unapplied/server/System-property-for-disabling-watchdoge.patch rename to patches/server/System-property-for-disabling-watchdoge.patch diff --git a/patches/unapplied/server/Use-a-Shared-Random-for-Entities.patch b/patches/server/Use-a-Shared-Random-for-Entities.patch similarity index 100% rename from patches/unapplied/server/Use-a-Shared-Random-for-Entities.patch rename to patches/server/Use-a-Shared-Random-for-Entities.patch diff --git a/patches/unapplied/server/handle-NaN-health-absorb-values-and-repair-bad-data.patch b/patches/server/handle-NaN-health-absorb-values-and-repair-bad-data.patch similarity index 95% rename from patches/unapplied/server/handle-NaN-health-absorb-values-and-repair-bad-data.patch rename to patches/server/handle-NaN-health-absorb-values-and-repair-bad-data.patch index 97ca9a420d..682cbe36ad 100644 --- a/patches/unapplied/server/handle-NaN-health-absorb-values-and-repair-bad-data.patch +++ b/patches/server/handle-NaN-health-absorb-values-and-repair-bad-data.patch @@ -20,8 +20,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + this.internalSetAbsorptionAmount(absorptionAmount); + // Paper end - Check for NaN - if (nbt.contains("Attributes", 9) && this.level() != null && !this.level().isClientSide) { - this.getAttributes().load(nbt.getList("Attributes", 10)); + if (nbt.contains("attributes", 9) && this.level() != null && !this.level().isClientSide) { + this.getAttributes().load(nbt.getList("attributes", 10)); } @@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { } diff --git a/patches/unapplied/server/remove-null-possibility-for-getServer-singleton.patch b/patches/server/remove-null-possibility-for-getServer-singleton.patch similarity index 95% rename from patches/unapplied/server/remove-null-possibility-for-getServer-singleton.patch rename to patches/server/remove-null-possibility-for-getServer-singleton.patch index fa5c1c85dd..56f257aa1d 100644 --- a/patches/unapplied/server/remove-null-possibility-for-getServer-singleton.patch +++ b/patches/server/remove-null-possibility-for-getServer-singleton.patch @@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ import co.aikar.timings.MinecraftTimings; // Paper - public abstract class MinecraftServer extends ReentrantBlockableEventLoop implements ServerInfo, CommandSource, AutoCloseable { + public abstract class MinecraftServer extends ReentrantBlockableEventLoop implements ServerInfo, ChunkIOErrorReporter, CommandSource, AutoCloseable { + private static MinecraftServer SERVER; // Paper public static final Logger LOGGER = LogUtils.getLogger();