diff --git a/patches/unapplied/server/Add-PlayerUseUnknownEntityEvent.patch b/patches/server/Add-PlayerUseUnknownEntityEvent.patch similarity index 97% rename from patches/unapplied/server/Add-PlayerUseUnknownEntityEvent.patch rename to patches/server/Add-PlayerUseUnknownEntityEvent.patch index 0c9fc55745..c31824f99b 100644 --- a/patches/unapplied/server/Add-PlayerUseUnknownEntityEvent.patch +++ b/patches/server/Add-PlayerUseUnknownEntityEvent.patch @@ -31,7 +31,7 @@ diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListener index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl }); } } 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-configurable-portal-search-radius.patch b/patches/server/Add-configurable-portal-search-radius.patch similarity index 85% rename from patches/unapplied/server/Add-configurable-portal-search-radius.patch rename to patches/server/Add-configurable-portal-search-radius.patch index 4d653fd7af..ca257ce63e 100644 --- a/patches/unapplied/server/Add-configurable-portal-search-radius.patch +++ b/patches/server/Add-configurable-portal-search-radius.patch @@ -12,14 +12,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 double d0 = DimensionType.getTeleportationScale(this.level().dimensionType(), destination.dimensionType()); BlockPos blockposition = worldborder.clampToBounds(this.getX() * d0, this.getY(), this.getZ() * d0); // CraftBukkit start -- CraftPortalEvent event = this.callPortalEvent(this, destination, new PositionImpl(blockposition.getX(), blockposition.getY(), blockposition.getZ()), PlayerTeleportEvent.TeleportCause.NETHER_PORTAL, flag2 ? 16 : 128, 16); +- CraftPortalEvent event = this.callPortalEvent(this, destination, new Vec3(blockposition.getX(), blockposition.getY(), blockposition.getZ()), PlayerTeleportEvent.TeleportCause.NETHER_PORTAL, flag2 ? 16 : 128, 16); + // Paper start + int portalSearchRadius = destination.paperConfig().environment.portalSearchRadius; + if (level.paperConfig().environment.portalSearchVanillaDimensionScaling && flag2) { // == THE_NETHER + portalSearchRadius = (int) (portalSearchRadius / destination.dimensionType().coordinateScale()); + } + // Paper end -+ CraftPortalEvent event = this.callPortalEvent(this, destination, new PositionImpl(blockposition.getX(), blockposition.getY(), blockposition.getZ()), PlayerTeleportEvent.TeleportCause.NETHER_PORTAL, portalSearchRadius, destination.paperConfig().environment.portalCreateRadius); // Paper start - configurable portal radius ++ CraftPortalEvent event = this.callPortalEvent(this, destination, new Vec3(blockposition.getX(), blockposition.getY(), blockposition.getZ()), PlayerTeleportEvent.TeleportCause.NETHER_PORTAL, portalSearchRadius, destination.paperConfig().environment.portalCreateRadius); // Paper start - configurable portal radius if (event == null) { return null; } diff --git a/patches/unapplied/server/Add-exception-reporting-event.patch b/patches/server/Add-exception-reporting-event.patch similarity index 100% rename from patches/unapplied/server/Add-exception-reporting-event.patch rename to patches/server/Add-exception-reporting-event.patch 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 96% 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 8e96df3f30..31a89cc11a 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 @@ -38,12 +38,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + } // Spigot Start - String[] split = packet.hostName.split("\00"); + String[] split = packet.hostName().split("\00"); - if (org.spigotmc.SpigotConfig.bungee) { + // Don't try and handle default logic if it's been handled by the event. + if (!handledByEvent && proxyLogicEnabled) { + // Paper end + // if (org.spigotmc.SpigotConfig.bungee) { // Paper - comment out, we check above! if ( ( split.length == 3 || split.length == 4 ) && ( ServerHandshakePacketListenerImpl.HOST_PATTERN.matcher( split[1] ).matches() ) ) { - packet.hostName = split[0]; + connection.hostname = split[0]; connection.address = new java.net.InetSocketAddress(split[1], ((java.net.InetSocketAddress) this.connection.getRemoteAddress()).getPort()); 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-velocity-warnings.patch b/patches/server/Add-velocity-warnings.patch similarity index 95% rename from patches/unapplied/server/Add-velocity-warnings.patch rename to patches/server/Add-velocity-warnings.patch index 814b5c62d6..f7fa993bbd 100644 --- a/patches/unapplied/server/Add-velocity-warnings.patch +++ b/patches/server/Add-velocity-warnings.patch @@ -65,7 +65,7 @@ diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/spigotmc/WatchdogThread.java +++ b/src/main/java/org/spigotmc/WatchdogThread.java -@@ -0,0 +0,0 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa +@@ -0,0 +0,0 @@ public class WatchdogThread extends Thread log.log( Level.SEVERE, "During the run of the server, a physics stackoverflow was supressed" ); log.log( Level.SEVERE, "near " + net.minecraft.world.level.Level.lastPhysicsProblem ); } @@ -85,4 +85,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end log.log( Level.SEVERE, "------------------------------" ); log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Paper!):" ); // Paper - io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.dumpAllChunkLoadInfo(isLongTimeout); // Paper // Paper - rewrite chunk system + WatchdogThread.dumpThread( ManagementFactory.getThreadMXBean().getThreadInfo( MinecraftServer.getServer().serverThread.getId(), Integer.MAX_VALUE ), log ); diff --git a/patches/unapplied/server/All-chunks-are-slime-spawn-chunks-toggle.patch b/patches/server/All-chunks-are-slime-spawn-chunks-toggle.patch similarity index 100% rename from patches/unapplied/server/All-chunks-are-slime-spawn-chunks-toggle.patch rename to patches/server/All-chunks-are-slime-spawn-chunks-toggle.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 97% rename from patches/unapplied/server/Async-GameProfileCache-saving.patch rename to patches/server/Async-GameProfileCache-saving.patch index 6c9a19c7ca..97a7b667a3 100644 --- a/patches/unapplied/server/Async-GameProfileCache-saving.patch +++ b/patches/server/Async-GameProfileCache-saving.patch @@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + this.getProfileCache().save(false); // Paper } // Spigot end - io.papermc.paper.chunk.system.io.RegionFileIOThread.close(true); // Paper // Paper - rewrite chunk system + diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java diff --git a/patches/unapplied/server/Be-a-bit-more-informative-in-maxHealth-exception.patch b/patches/server/Be-a-bit-more-informative-in-maxHealth-exception.patch similarity index 100% rename from patches/unapplied/server/Be-a-bit-more-informative-in-maxHealth-exception.patch rename to patches/server/Be-a-bit-more-informative-in-maxHealth-exception.patch diff --git a/patches/unapplied/server/Chunk-Save-Reattempt.patch b/patches/server/Chunk-Save-Reattempt.patch similarity index 85% rename from patches/unapplied/server/Chunk-Save-Reattempt.patch rename to patches/server/Chunk-Save-Reattempt.patch index 6d260baab6..854dcf977a 100644 --- a/patches/unapplied/server/Chunk-Save-Reattempt.patch +++ b/patches/server/Chunk-Save-Reattempt.patch @@ -22,15 +22,15 @@ diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileSto index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java -@@ -0,0 +0,0 @@ public class RegionFileStorage implements AutoCloseable { - } - // Paper end - rewrite chunk system - try { // Paper +@@ -0,0 +0,0 @@ public final class RegionFileStorage implements AutoCloseable { + + protected void write(ChunkPos pos, @Nullable CompoundTag nbt) throws IOException { + RegionFile regionfile = this.getRegionFile(pos, false); // CraftBukkit + int attempts = 0; Exception laste = null; while (attempts++ < 5) { try { // Paper if (nbt == null) { regionfile.clear(pos); -@@ -0,0 +0,0 @@ public class RegionFileStorage implements AutoCloseable { +@@ -0,0 +0,0 @@ public final class RegionFileStorage implements AutoCloseable { dataoutputstream.close(); } } @@ -46,6 +46,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + net.minecraft.server.MinecraftServer.LOGGER.error("Failed to save chunk " + pos, laste); + } + // Paper end - } finally { // Paper start - regionfile.fileLock.unlock(); - } // Paper end + } + + public void close() throws IOException { diff --git a/patches/unapplied/server/Complete-resource-pack-API.patch b/patches/server/Complete-resource-pack-API.patch similarity index 83% rename from patches/unapplied/server/Complete-resource-pack-API.patch rename to patches/server/Complete-resource-pack-API.patch index 5abbbc8202..650886d65c 100644 --- a/patches/unapplied/server/Complete-resource-pack-API.patch +++ b/patches/server/Complete-resource-pack-API.patch @@ -4,24 +4,23 @@ Date: Sat, 4 Apr 2015 23:17:52 -0400 Subject: [PATCH] Complete resource pack API -diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - ServerGamePacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack rejection", this.player.getName()); +--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java ++++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +@@ -0,0 +0,0 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack + ServerCommonPacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack rejection", this.playerProfile().getName()); this.disconnect(Component.translatable("multiplayer.requiredTexturePrompt.disconnect")); } -- this.cserver.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(this.getCraftPlayer(), PlayerResourcePackStatusEvent.Status.values()[packet.action.ordinal()])); // CraftBukkit -- +- this.cserver.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(this.getCraftPlayer(), PlayerResourcePackStatusEvent.Status.values()[packet.getAction().ordinal()])); // CraftBukkit + // Paper start -+ PlayerResourcePackStatusEvent.Status packStatus = PlayerResourcePackStatusEvent.Status.values()[packet.action.ordinal()]; ++ PlayerResourcePackStatusEvent.Status packStatus = PlayerResourcePackStatusEvent.Status.values()[packet.getAction().ordinal()]; + player.getBukkitEntity().setResourcePackStatus(packStatus); + this.cserver.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(this.getCraftPlayer(), packStatus)); // CraftBukkit + // Paper end + } - @Override diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 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-Grass-Spread-Tick-Rate.patch b/patches/server/Configurable-Grass-Spread-Tick-Rate.patch similarity index 100% rename from patches/unapplied/server/Configurable-Grass-Spread-Tick-Rate.patch rename to patches/server/Configurable-Grass-Spread-Tick-Rate.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 98% rename from patches/unapplied/server/Configurable-Player-Collision.patch rename to patches/server/Configurable-Player-Collision.patch index e3587047c9..68a78038be 100644 --- a/patches/unapplied/server/Configurable-Player-Collision.patch +++ b/patches/server/Configurable-Player-Collision.patch @@ -46,8 +46,8 @@ diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/ma index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -0,0 +0,0 @@ import net.minecraft.world.level.storage.PlayerDataStorage; - import net.minecraft.world.phys.Vec3; +@@ -0,0 +0,0 @@ import net.minecraft.world.phys.Vec3; + import net.minecraft.world.scores.DisplaySlot; import net.minecraft.world.scores.Objective; import net.minecraft.world.scores.PlayerTeam; +import net.minecraft.world.scores.Scoreboard; // Paper 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-inter-world-teleportation-safety.patch b/patches/server/Configurable-inter-world-teleportation-safety.patch similarity index 100% rename from patches/unapplied/server/Configurable-inter-world-teleportation-safety.patch rename to patches/server/Configurable-inter-world-teleportation-safety.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 94% rename from patches/unapplied/server/Configurable-spawn-chances-for-skeleton-horses.patch rename to patches/server/Configurable-spawn-chances-for-skeleton-horses.patch index 1b6ce66f14..9df500ec0a 100644 --- a/patches/unapplied/server/Configurable-spawn-chances-for-skeleton-horses.patch +++ b/patches/server/Configurable-spawn-chances-for-skeleton-horses.patch @@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel { - blockposition = this.findLightningTargetAround(this.getBlockRandomPos(j, 0, k, 15)); + if (this.isRainingAt(blockposition)) { DifficultyInstance difficultydamagescaler = this.getCurrentDifficultyAt(blockposition); - boolean flag1 = this.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.getEffectiveDifficulty() * 0.01D && !this.getBlockState(blockposition.below()).is(Blocks.LIGHTNING_ROD); 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-nest-if-we-don-t-need-to-when-cerealising-text.patch b/patches/server/Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch similarity index 100% rename from patches/unapplied/server/Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch rename to patches/server/Don-t-nest-if-we-don-t-need-to-when-cerealising-text.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 84% rename from patches/unapplied/server/EntityPathfindEvent.patch rename to patches/server/EntityPathfindEvent.patch index 5f1c28f97d..194d464502 100644 --- a/patches/unapplied/server/EntityPathfindEvent.patch +++ b/patches/server/EntityPathfindEvent.patch @@ -28,30 +28,25 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override - public Path createPath(BlockPos target, int distance) { + public Path createPath(BlockPos target, @javax.annotation.Nullable Entity entity, int distance) { // Paper - if (this.level.getBlockState(target).isAir()) { - BlockPos blockPos; - for(blockPos = target.below(); blockPos.getY() > this.level.getMinBuildHeight() && this.level.getBlockState(blockPos).isAir(); blockPos = blockPos.below()) { - } - - if (blockPos.getY() > this.level.getMinBuildHeight()) { -- return super.createPath(blockPos.above(), distance); -+ return super.createPath(blockPos.above(), entity, distance); // Paper - } - - while(blockPos.getY() < this.level.getMaxBuildHeight() && this.level.getBlockState(blockPos).isAir()) { + LevelChunk levelChunk = this.level.getChunkSource().getChunkNow(SectionPos.blockToSectionCoord(target.getX()), SectionPos.blockToSectionCoord(target.getZ())); + if (levelChunk == null) { + return null; @@ -0,0 +0,0 @@ public class GroundPathNavigation extends PathNavigation { - } + } - if (!this.level.getBlockState(target).isSolid()) { -- return super.createPath(target, distance); -+ return super.createPath(target, entity, distance); // Paper - } else { - BlockPos blockPos2; - for(blockPos2 = target.above(); blockPos2.getY() < this.level.getMaxBuildHeight() && this.level.getBlockState(blockPos2).isSolid(); blockPos2 = blockPos2.above()) { + if (blockPos.getY() > this.level.getMinBuildHeight()) { +- return super.createPath(blockPos.above(), distance); ++ return super.createPath(blockPos.above(), entity, distance); // Paper + } + + while(blockPos.getY() < this.level.getMaxBuildHeight() && levelChunk.getBlockState(blockPos).isAir()) { +@@ -0,0 +0,0 @@ public class GroundPathNavigation extends PathNavigation { + for(blockPos2 = target.above(); blockPos2.getY() < this.level.getMaxBuildHeight() && levelChunk.getBlockState(blockPos2).isSolid(); blockPos2 = blockPos2.above()) { + } + +- return super.createPath(blockPos2, distance); ++ return super.createPath(blockPos2, entity, distance); // Paper } - -- return super.createPath(blockPos2, distance); -+ return super.createPath(blockPos2, entity, distance); // Paper } } 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/Expose-server-CommandMap.patch b/patches/server/Expose-server-CommandMap.patch similarity index 100% rename from patches/unapplied/server/Expose-server-CommandMap.patch rename to patches/server/Expose-server-CommandMap.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 85% rename from patches/unapplied/server/Faster-redstone-torch-rapid-clock-removal.patch rename to patches/server/Faster-redstone-torch-rapid-clock-removal.patch index 6a7e2258d7..b02286fd01 100644 --- a/patches/unapplied/server/Faster-redstone-torch-rapid-clock-removal.patch +++ b/patches/server/Faster-redstone-torch-rapid-clock-removal.patch @@ -66,16 +66,3 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (addNew) { list.add(new RedstoneTorchBlock.Toggle(pos.immutable(), world.getGameTime())); -@@ -0,0 +0,0 @@ public class RedstoneTorchBlock extends TorchBlock { - - int i = 0; - -- for (int j = 0; j < list.size(); ++j) { -- RedstoneTorchBlock.Toggle blockredstonetorch_redstoneupdateinfo = (RedstoneTorchBlock.Toggle) list.get(j); -- -+ for (java.util.Iterator iterator = list.iterator(); iterator.hasNext();) { -+ RedstoneTorchBlock.Toggle blockredstonetorch_redstoneupdateinfo = iterator.next(); -+ // Paper end - if (blockredstonetorch_redstoneupdateinfo.pos.equals(pos)) { - ++i; - if (i >= 8) { 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/Handle-Item-Meta-Inconsistencies.patch b/patches/server/Handle-Item-Meta-Inconsistencies.patch similarity index 100% rename from patches/unapplied/server/Handle-Item-Meta-Inconsistencies.patch rename to patches/server/Handle-Item-Meta-Inconsistencies.patch diff --git a/patches/unapplied/server/Improve-Maps-in-item-frames-performance-and-bug-fixe.patch b/patches/server/Improve-Maps-in-item-frames-performance-and-bug-fixe.patch similarity index 100% rename from patches/unapplied/server/Improve-Maps-in-item-frames-performance-and-bug-fixe.patch rename to patches/server/Improve-Maps-in-item-frames-performance-and-bug-fixe.patch diff --git a/patches/unapplied/server/Improve-Player-chat-API-handling.patch b/patches/server/Improve-Player-chat-API-handling.patch similarity index 95% rename from patches/unapplied/server/Improve-Player-chat-API-handling.patch rename to patches/server/Improve-Player-chat-API-handling.patch index 2215c60c04..5daa7a6e5b 100644 --- a/patches/unapplied/server/Improve-Player-chat-API-handling.patch +++ b/patches/server/Improve-Player-chat-API-handling.patch @@ -20,7 +20,7 @@ diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListener index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } OutgoingChatMessage outgoing = OutgoingChatMessage.create(original); @@ -29,7 +29,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.handleCommand(s); } else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) { // Do nothing, this is coming from a plugin -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } } diff --git a/patches/unapplied/server/LootTable-API-Replenishable-Lootables-Feature.patch b/patches/server/LootTable-API-Replenishable-Lootables-Feature.patch similarity index 100% rename from patches/unapplied/server/LootTable-API-Replenishable-Lootables-Feature.patch rename to patches/server/LootTable-API-Replenishable-Lootables-Feature.patch 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/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-isInWorldBounds-and-getBlockState-for-inlin.patch b/patches/server/Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch similarity index 100% rename from patches/unapplied/server/Optimize-isInWorldBounds-and-getBlockState-for-inlin.patch rename to patches/server/Optimize-isInWorldBounds-and-getBlockState-for-inlin.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 100% 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 diff --git a/patches/unapplied/server/Player-Tab-List-and-Title-APIs.patch b/patches/server/Player-Tab-List-and-Title-APIs.patch similarity index 98% rename from patches/unapplied/server/Player-Tab-List-and-Title-APIs.patch rename to patches/server/Player-Tab-List-and-Title-APIs.patch index 09eab38195..b166c82280 100644 --- a/patches/unapplied/server/Player-Tab-List-and-Title-APIs.patch +++ b/patches/server/Player-Tab-List-and-Title-APIs.patch @@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java @@ -0,0 +0,0 @@ public class FriendlyByteBuf extends ByteBuf { public FriendlyByteBuf writeComponent(final net.kyori.adventure.text.Component component) { - return this.writeUtf(PaperAdventure.asJsonString(component, this.adventure$locale), 262144); + return this.writeUtf(io.papermc.paper.adventure.PaperAdventure.asJsonString(component, this.adventure$locale), 262144); } + + @Deprecated 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 87% rename from patches/unapplied/server/Sanitise-RegionFileCache-and-make-configurable.patch rename to patches/server/Sanitise-RegionFileCache-and-make-configurable.patch index 1d713471f4..09ce5ea938 100644 --- a/patches/unapplied/server/Sanitise-RegionFileCache-and-make-configurable.patch +++ b/patches/server/Sanitise-RegionFileCache-and-make-configurable.patch @@ -14,10 +14,10 @@ diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileSto index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java -@@ -0,0 +0,0 @@ public class RegionFileStorage implements AutoCloseable { - return null; - } - // Paper end - cache regionfile does not exist state +@@ -0,0 +0,0 @@ public final class RegionFileStorage implements AutoCloseable { + if (regionfile != null) { + return regionfile; + } else { - if (this.regionCache.size() >= 256) { + if (this.regionCache.size() >= io.papermc.paper.configuration.GlobalConfiguration.get().misc.regionFileCacheSize) { // Paper - configurable ((RegionFile) this.regionCache.removeLast()).close(); diff --git a/patches/unapplied/server/Strip-raytracing-for-EntityLiving-hasLineOfSight.patch b/patches/server/Strip-raytracing-for-EntityLiving-hasLineOfSight.patch similarity index 100% rename from patches/unapplied/server/Strip-raytracing-for-EntityLiving-hasLineOfSight.patch rename to patches/server/Strip-raytracing-for-EntityLiving-hasLineOfSight.patch diff --git a/patches/unapplied/server/System-property-for-disabling-watchdoge.patch b/patches/server/System-property-for-disabling-watchdoge.patch similarity index 91% rename from patches/unapplied/server/System-property-for-disabling-watchdoge.patch rename to patches/server/System-property-for-disabling-watchdoge.patch index 8b145e16e3..c5213c8c5a 100644 --- a/patches/unapplied/server/System-property-for-disabling-watchdoge.patch +++ b/patches/server/System-property-for-disabling-watchdoge.patch @@ -8,7 +8,7 @@ diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/spigotmc/WatchdogThread.java +++ b/src/main/java/org/spigotmc/WatchdogThread.java -@@ -0,0 +0,0 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa +@@ -0,0 +0,0 @@ public class WatchdogThread extends Thread while ( !this.stopping ) { // 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 81% 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 3893921e36..d1649d2052 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 @@ -12,13 +12,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override public void readAdditionalSaveData(CompoundTag nbt) { -- this.setAbsorptionAmount(nbt.getFloat("AbsorptionAmount")); +- this.internalSetAbsorptionAmount(nbt.getFloat("AbsorptionAmount")); + // Paper start - jvm keeps optimizing the setter + float absorptionAmount = nbt.getFloat("AbsorptionAmount"); + if (Float.isNaN(absorptionAmount)) { + absorptionAmount = 0; + } -+ this.setAbsorptionAmount(absorptionAmount); ++ this.internalSetAbsorptionAmount(absorptionAmount); + // Paper end if (nbt.contains("Attributes", 9) && this.level() != null && !this.level().isClientSide) { this.getAttributes().load(nbt.getList("Attributes", 10)); @@ -37,12 +37,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { } - public void setAbsorptionAmount(float amount) { -- if (amount < 0.0F) { -+ if (amount < 0.0F || Float.isNaN(amount)) { // Paper - amount = 0.0F; - } + public final void setAbsorptionAmount(float absorptionAmount) { +- this.internalSetAbsorptionAmount(Mth.clamp(absorptionAmount, 0.0F, this.getMaxAbsorption())); ++ this.internalSetAbsorptionAmount(!Float.isNaN(absorptionAmount) ? Mth.clamp(absorptionAmount, 0.0F, this.getMaxAbsorption()) : 0.0F); // Paper + } + protected void internalSetAbsorptionAmount(float absorptionAmount) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 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 96% rename from patches/unapplied/server/remove-null-possibility-for-getServer-singleton.patch rename to patches/server/remove-null-possibility-for-getServer-singleton.patch index 934cff6303..f04d691751 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 CommandSource, AutoCloseable { + public abstract class MinecraftServer extends ReentrantBlockableEventLoop implements ServerInfo, CommandSource, AutoCloseable { + private static MinecraftServer SERVER; // Paper public static final Logger LOGGER = LogUtils.getLogger();