From 79da0788dd4818e1c401ead8bb1a44cecbb92928 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Thu, 13 Jun 2024 10:12:48 -0700 Subject: [PATCH] 62 --- build.gradle.kts | 2 +- .../server/Add-BeaconEffectEvent.patch | 2 +- .../server/Add-PlayerInitialSpawnEvent.patch | 0 .../server/Add-TickThread.patch | 0 ...-option-to-load-extra-plugin-jars-no.patch | 0 ...onfigurable-entity-despawn-distances.patch | 2 +- ...dd-configurable-portal-search-radius.patch | 38 +++++ ...ties-to-activation-range-ignore-list.patch | 0 .../server/Add-velocity-warnings.patch | 0 .../{unapplied => }/server/Adventure.patch | 80 ++++------ ...chunks-are-slime-spawn-chunks-toggle.patch | 0 .../server/Allow-nerfed-mobs-to-jump.patch | 4 +- ...e-informative-in-maxHealth-exception.patch | 0 .../server/Build-system-changes.patch | 6 +- patches/{unapplied => }/server/CB-fixes.patch | 0 ...e-before-converting-and-renaming-pla.patch | 0 .../server/ConcurrentUtil.patch | 0 ...urable-Disabling-Cat-Chest-Detection.patch | 0 ...figurable-baby-zombie-movement-speed.patch | 17 +- ...cactus-bamboo-and-reed-growth-height.patch | 0 ...figurable-container-update-tick-rate.patch | 4 +- patches/server/Configurable-end-credits.patch | 18 +++ .../Configurable-fishing-time-ranges.patch | 8 +- .../Configurable-mob-spawner-tick-rate.patch | 0 ...nfigurable-top-of-nether-void-damage.patch | 18 +-- ...ktraces-in-log-messages-crash-report.patch | 0 .../server/Disable-explosion-knockback.patch | 4 +- .../server/Disable-ice-and-snow.patch | 0 .../server/Disable-spigot-tick-limiters.patch | 0 .../server/Disable-thunder.patch | 0 ...ck-and-tnt-entities-at-the-specified.patch | 6 +- .../server/Entity-Origin-API.patch | 0 .../server/Expose-server-CommandMap.patch | 0 .../Expose-server-build-information.patch | 2 +- ...-explosions-processing-dead-entities.patch | 0 .../Further-improve-server-tick-loop.patch | 0 ...n-prefixes-using-Log4J-configuration.patch | 0 .../server/Hook-into-CB-plugin-rewrites.patch | 2 +- .../Implement-PlayerLocaleChangeEvent.patch | 6 +- ...e-Log4J-Configuration-Plugin-Loggers.patch | 0 .../Improve-Player-chat-API-handling.patch | 0 .../{unapplied => }/server/MC-Dev-fixes.patch | 0 patches/{unapplied => }/server/MC-Utils.patch | 145 ++++++++---------- .../Only-refresh-abilities-if-needed.patch | 0 .../server/Optimize-explosions.patch | 0 .../server/Paper-Metrics.patch | 0 .../server/Paper-Plugins.patch | 0 .../server/Paper-command.patch | 0 .../server/Paper-config-files.patch | 4 +- .../Player-Tab-List-and-Title-APIs.patch | 0 .../server/Player-affects-spawning-API.patch | 6 +- .../server/Plugin-remapping.patch | 0 ...vent-block-entity-and-entity-crashes.patch | 0 .../{unapplied => }/server/Remap-fixes.patch | 6 +- ...ion-calls-in-plugins-using-internals.patch | 2 +- ...s-to-contain-the-source-jars-in-stac.patch | 0 .../server/Setup-Gradle-project.patch | 16 +- .../Support-components-in-ItemMeta.patch | 0 .../{unapplied => }/server/Test-changes.patch | 0 .../{unapplied => }/server/Timings-v2.patch | 6 +- ...r-to-keep-logging-IO-off-main-thread.patch | 4 +- ...oleAppender-for-console-improvements.patch | 4 +- .../Use-UserCache-for-player-heads.patch | 0 ...dd-configurable-portal-search-radius.patch | 38 ----- .../server/Configurable-end-credits.patch | 18 --- ...ble-inter-world-teleportation-safety.patch | 30 ---- 66 files changed, 214 insertions(+), 284 deletions(-) rename patches/{unapplied => }/server/Add-BeaconEffectEvent.patch (99%) rename patches/{unapplied => }/server/Add-PlayerInitialSpawnEvent.patch (100%) rename patches/{unapplied => }/server/Add-TickThread.patch (100%) rename patches/{unapplied => }/server/Add-command-line-option-to-load-extra-plugin-jars-no.patch (100%) rename patches/{unapplied => }/server/Add-configurable-entity-despawn-distances.patch (97%) create mode 100644 patches/server/Add-configurable-portal-search-radius.patch rename patches/{unapplied => }/server/Add-more-entities-to-activation-range-ignore-list.patch (100%) rename patches/{unapplied => }/server/Add-velocity-warnings.patch (100%) rename patches/{unapplied => }/server/Adventure.patch (99%) rename patches/{unapplied => }/server/All-chunks-are-slime-spawn-chunks-toggle.patch (100%) rename patches/{unapplied => }/server/Allow-nerfed-mobs-to-jump.patch (97%) rename patches/{unapplied => }/server/Be-a-bit-more-informative-in-maxHealth-exception.patch (100%) rename patches/{unapplied => }/server/Build-system-changes.patch (97%) rename patches/{unapplied => }/server/CB-fixes.patch (100%) rename patches/{unapplied => }/server/Check-online-mode-before-converting-and-renaming-pla.patch (100%) rename patches/{unapplied => }/server/ConcurrentUtil.patch (100%) rename patches/{unapplied => }/server/Configurable-Disabling-Cat-Chest-Detection.patch (100%) rename patches/{unapplied => }/server/Configurable-baby-zombie-movement-speed.patch (51%) rename patches/{unapplied => }/server/Configurable-cactus-bamboo-and-reed-growth-height.patch (100%) rename patches/{unapplied => }/server/Configurable-container-update-tick-rate.patch (88%) create mode 100644 patches/server/Configurable-end-credits.patch rename patches/{unapplied => }/server/Configurable-fishing-time-ranges.patch (85%) rename patches/{unapplied => }/server/Configurable-mob-spawner-tick-rate.patch (100%) rename patches/{unapplied => }/server/Configurable-top-of-nether-void-damage.patch (76%) rename patches/{unapplied => }/server/Deobfuscate-stacktraces-in-log-messages-crash-report.patch (100%) rename patches/{unapplied => }/server/Disable-explosion-knockback.patch (80%) rename patches/{unapplied => }/server/Disable-ice-and-snow.patch (100%) rename patches/{unapplied => }/server/Disable-spigot-tick-limiters.patch (100%) rename patches/{unapplied => }/server/Disable-thunder.patch (100%) rename patches/{unapplied => }/server/Drop-falling-block-and-tnt-entities-at-the-specified.patch (91%) rename patches/{unapplied => }/server/Entity-Origin-API.patch (100%) rename patches/{unapplied => }/server/Expose-server-CommandMap.patch (100%) rename patches/{unapplied => }/server/Expose-server-build-information.patch (99%) rename patches/{unapplied => }/server/Fix-lag-from-explosions-processing-dead-entities.patch (100%) rename patches/{unapplied => }/server/Further-improve-server-tick-loop.patch (100%) rename patches/{unapplied => }/server/Handle-plugin-prefixes-using-Log4J-configuration.patch (100%) rename patches/{unapplied => }/server/Hook-into-CB-plugin-rewrites.patch (98%) rename patches/{unapplied => }/server/Implement-PlayerLocaleChangeEvent.patch (91%) rename patches/{unapplied => }/server/Improve-Log4J-Configuration-Plugin-Loggers.patch (100%) rename patches/{unapplied => }/server/Improve-Player-chat-API-handling.patch (100%) rename patches/{unapplied => }/server/MC-Dev-fixes.patch (100%) rename patches/{unapplied => }/server/MC-Utils.patch (98%) rename patches/{unapplied => }/server/Only-refresh-abilities-if-needed.patch (100%) rename patches/{unapplied => }/server/Optimize-explosions.patch (100%) rename patches/{unapplied => }/server/Paper-Metrics.patch (100%) rename patches/{unapplied => }/server/Paper-Plugins.patch (100%) rename patches/{unapplied => }/server/Paper-command.patch (100%) rename patches/{unapplied => }/server/Paper-config-files.patch (99%) rename patches/{unapplied => }/server/Player-Tab-List-and-Title-APIs.patch (100%) rename patches/{unapplied => }/server/Player-affects-spawning-API.patch (98%) rename patches/{unapplied => }/server/Plugin-remapping.patch (100%) rename patches/{unapplied => }/server/Prevent-block-entity-and-entity-crashes.patch (100%) rename patches/{unapplied => }/server/Remap-fixes.patch (96%) rename patches/{unapplied => }/server/Remap-reflection-calls-in-plugins-using-internals.patch (99%) rename patches/{unapplied => }/server/Rewrite-LogEvents-to-contain-the-source-jars-in-stac.patch (100%) rename patches/{unapplied => }/server/Setup-Gradle-project.patch (98%) rename patches/{unapplied => }/server/Support-components-in-ItemMeta.patch (100%) rename patches/{unapplied => }/server/Test-changes.patch (100%) rename patches/{unapplied => }/server/Timings-v2.patch (99%) rename patches/{unapplied => }/server/Use-AsyncAppender-to-keep-logging-IO-off-main-thread.patch (94%) rename patches/{unapplied => }/server/Use-TerminalConsoleAppender-for-console-improvements.patch (99%) rename patches/{unapplied => }/server/Use-UserCache-for-player-heads.patch (100%) delete mode 100644 patches/unapplied/server/Add-configurable-portal-search-radius.patch delete mode 100644 patches/unapplied/server/Configurable-end-credits.patch delete mode 100644 patches/unapplied/server/Configurable-inter-world-teleportation-safety.patch diff --git a/build.gradle.kts b/build.gradle.kts index d57853bb3c..e9fb8e46e3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -67,7 +67,7 @@ repositories { } dependencies { - paramMappings("net.fabricmc:yarn:1.20.6+build.1:mergedv2") + paramMappings("net.fabricmc:yarn:1.21+build.1:mergedv2") remapper("net.fabricmc:tiny-remapper:0.10.2:fat") decompiler("org.vineflower:vineflower:1.10.1") spigotDecompiler("io.papermc:patched-spigot-fernflower:0.1+build.13") diff --git a/patches/unapplied/server/Add-BeaconEffectEvent.patch b/patches/server/Add-BeaconEffectEvent.patch similarity index 99% rename from patches/unapplied/server/Add-BeaconEffectEvent.patch rename to patches/server/Add-BeaconEffectEvent.patch index 822ec5d128..a53a42ece8 100644 --- a/patches/unapplied/server/Add-BeaconEffectEvent.patch +++ b/patches/server/Add-BeaconEffectEvent.patch @@ -14,7 +14,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +import com.destroystokyo.paper.event.block.BeaconEffectEvent; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; - import java.util.Arrays; + import java.util.Collection; @@ -0,0 +0,0 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.Heightmap; import net.minecraft.world.phys.AABB; diff --git a/patches/unapplied/server/Add-PlayerInitialSpawnEvent.patch b/patches/server/Add-PlayerInitialSpawnEvent.patch similarity index 100% rename from patches/unapplied/server/Add-PlayerInitialSpawnEvent.patch rename to patches/server/Add-PlayerInitialSpawnEvent.patch diff --git a/patches/unapplied/server/Add-TickThread.patch b/patches/server/Add-TickThread.patch similarity index 100% rename from patches/unapplied/server/Add-TickThread.patch rename to patches/server/Add-TickThread.patch diff --git a/patches/unapplied/server/Add-command-line-option-to-load-extra-plugin-jars-no.patch b/patches/server/Add-command-line-option-to-load-extra-plugin-jars-no.patch similarity index 100% rename from patches/unapplied/server/Add-command-line-option-to-load-extra-plugin-jars-no.patch rename to patches/server/Add-command-line-option-to-load-extra-plugin-jars-no.patch diff --git a/patches/unapplied/server/Add-configurable-entity-despawn-distances.patch b/patches/server/Add-configurable-entity-despawn-distances.patch similarity index 97% rename from patches/unapplied/server/Add-configurable-entity-despawn-distances.patch rename to patches/server/Add-configurable-entity-despawn-distances.patch index 3fee0c272b..15311ad1e8 100644 --- a/patches/unapplied/server/Add-configurable-entity-despawn-distances.patch +++ b/patches/server/Add-configurable-entity-despawn-distances.patch @@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/n index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti +@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab if (entityhuman != null) { double d0 = entityhuman.distanceToSqr((Entity) this); diff --git a/patches/server/Add-configurable-portal-search-radius.patch b/patches/server/Add-configurable-portal-search-radius.patch new file mode 100644 index 0000000000..92b684ca88 --- /dev/null +++ b/patches/server/Add-configurable-portal-search-radius.patch @@ -0,0 +1,38 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Joseph Hirschfeld +Date: Thu, 3 Mar 2016 02:46:17 -0600 +Subject: [PATCH] Add configurable portal search radius + + +diff --git a/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java b/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java ++++ b/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java +@@ -0,0 +0,0 @@ public class NetherPortalBlock extends Block implements Portal { + WorldBorder worldborder = worldserver1.getWorldBorder(); + double d0 = DimensionType.getTeleportationScale(world.dimensionType(), worldserver1.dimensionType()); + BlockPos blockposition1 = worldborder.clampToBounds(entity.getX() * d0, entity.getY(), entity.getZ() * d0); ++ // Paper start - Configurable portal search radius ++ int portalSearchRadius = worldserver1.paperConfig().environment.portalSearchRadius; ++ if (entity.level().paperConfig().environment.portalSearchVanillaDimensionScaling && flag) { // flag = is going to nether ++ portalSearchRadius = (int) (portalSearchRadius / worldserver1.dimensionType().coordinateScale()); ++ } ++ // Paper end - Configurable portal search radius + // CraftBukkit start +- CraftPortalEvent event = entity.callPortalEvent(entity, CraftLocation.toBukkit(blockposition1, worldserver1.getWorld()), PlayerTeleportEvent.TeleportCause.NETHER_PORTAL, flag ? 16 : 128, 16); ++ CraftPortalEvent event = entity.callPortalEvent(entity, CraftLocation.toBukkit(blockposition1, worldserver1.getWorld()), PlayerTeleportEvent.TeleportCause.NETHER_PORTAL, portalSearchRadius, 16); // Paper - use custom portal search radius + if (event == null) { + return null; + } +diff --git a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java ++++ b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java +@@ -0,0 +0,0 @@ public class PortalForcer { + this.level = world; + } + ++ @io.papermc.paper.annotation.DoNotUse // Paper + public Optional findClosestPortalPosition(BlockPos pos, boolean destIsNether, WorldBorder worldBorder) { + // CraftBukkit start + return this.findClosestPortalPosition(pos, worldBorder, destIsNether ? 16 : 128); // Search Radius diff --git a/patches/unapplied/server/Add-more-entities-to-activation-range-ignore-list.patch b/patches/server/Add-more-entities-to-activation-range-ignore-list.patch similarity index 100% rename from patches/unapplied/server/Add-more-entities-to-activation-range-ignore-list.patch rename to patches/server/Add-more-entities-to-activation-range-ignore-list.patch diff --git a/patches/unapplied/server/Add-velocity-warnings.patch b/patches/server/Add-velocity-warnings.patch similarity index 100% rename from patches/unapplied/server/Add-velocity-warnings.patch rename to patches/server/Add-velocity-warnings.patch diff --git a/patches/unapplied/server/Adventure.patch b/patches/server/Adventure.patch similarity index 99% rename from patches/unapplied/server/Adventure.patch rename to patches/server/Adventure.patch index d0ee9f098d..802b12a6c1 100644 --- a/patches/unapplied/server/Adventure.patch +++ b/patches/server/Adventure.patch @@ -2600,7 +2600,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.SpigotTimings; // Spigot - public abstract class MinecraftServer extends ReentrantBlockableEventLoop implements ServerInfo, CommandSource, AutoCloseable { + public abstract class MinecraftServer extends ReentrantBlockableEventLoop implements ServerInfo, ChunkIOErrorReporter, CommandSource, AutoCloseable { public static final Logger LOGGER = LogUtils.getLogger(); + public static final net.kyori.adventure.text.logger.slf4j.ComponentLogger COMPONENT_LOGGER = net.kyori.adventure.text.logger.slf4j.ComponentLogger.logger(LOGGER.getName()); // Paper @@ -2692,7 +2692,7 @@ diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/ma index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -0,0 +0,0 @@ import net.minecraft.world.damagesource.CombatTracker; +@@ -0,0 +0,0 @@ import net.minecraft.world.item.trading.MerchantOffers; import net.minecraft.world.scores.Scoreboard; import net.minecraft.world.scores.Team; import net.minecraft.world.scores.criteria.ObjectiveCriteria; @@ -2700,7 +2700,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.WeatherType; -@@ -0,0 +0,0 @@ public class ServerPlayer extends Player { +@@ -0,0 +0,0 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { private boolean disconnected; private int requestedViewDistance; public String language = "en_us"; // CraftBukkit - default @@ -2708,7 +2708,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Nullable private Vec3 startingToFallPosition; @Nullable -@@ -0,0 +0,0 @@ public class ServerPlayer extends Player { +@@ -0,0 +0,0 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { // CraftBukkit start public CraftPlayer.TransferCookieConnection transferCookieConnection; public String displayName; @@ -2716,7 +2716,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public Component listName; public org.bukkit.Location compassTarget; public int newExp = 0; -@@ -0,0 +0,0 @@ public class ServerPlayer extends Player { +@@ -0,0 +0,0 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { // CraftBukkit start this.displayName = this.getScoreboardName(); @@ -2724,7 +2724,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.bukkitPickUpLoot = true; this.maxHealthCache = this.getMaxHealth(); } -@@ -0,0 +0,0 @@ public class ServerPlayer extends Player { +@@ -0,0 +0,0 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { String deathmessage = defaultMessage.getString(); this.keepLevel = keepInventory; // SPIGOT-2222: pre-set keepLevel @@ -2751,7 +2751,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.connection.send(new ClientboundPlayerCombatKillPacket(this.getId(), ichatbasecomponent), PacketSendListener.exceptionallySend(() -> { boolean flag1 = true; -@@ -0,0 +0,0 @@ public class ServerPlayer extends Player { +@@ -0,0 +0,0 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { } public void sendChatMessage(OutgoingChatMessage message, boolean filterMaskEnabled, ChatType.Bound params) { @@ -2766,7 +2766,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } } -@@ -0,0 +0,0 @@ public class ServerPlayer extends Player { +@@ -0,0 +0,0 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { } // CraftBukkit end this.language = clientOptions.language(); @@ -2797,7 +2797,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.server = minecraftserver; @@ -0,0 +0,0 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack ServerCommonPacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack {} rejection", this.playerProfile().getName(), packet.id()); - this.disconnect(Component.translatable("multiplayer.requiredTexturePrompt.disconnect")); + this.disconnect((Component) Component.translatable("multiplayer.requiredTexturePrompt.disconnect")); } + // Paper start - adventure pack callbacks + // call the callbacks before the previously-existing event so the event has final say @@ -2815,36 +2815,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } @@ -0,0 +0,0 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack - - // CraftBukkit start - @Deprecated -- public void disconnect(Component reason) { -- this.disconnect(CraftChatMessage.fromComponent(reason)); -+ public void disconnect(String s) { // Paper -+ this.disconnect(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(s)); // Paper + } } - // CraftBukkit end -- public void disconnect(String s) { -+ // Paper start -+ public void disconnect(final Component reason) { -+ this.disconnect(io.papermc.paper.adventure.PaperAdventure.asAdventure(reason)); ++ // Paper start - adventure ++ public void disconnect(@Nullable final net.kyori.adventure.text.Component reason) { ++ this.disconnect(io.papermc.paper.adventure.PaperAdventure.asVanilla(reason)); + } ++ // Paper end - adventure + -+ public void disconnect(net.kyori.adventure.text.Component reason) { -+ // Paper end - // CraftBukkit start - fire PlayerKickEvent - if (this.processedDisconnect) { - return; -@@ -0,0 +0,0 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack - Waitable waitable = new Waitable() { - @Override - protected Object evaluate() { -- ServerCommonPacketListenerImpl.this.disconnect(s); -+ ServerCommonPacketListenerImpl.this.disconnect(reason); // Paper - adventure - return null; - } - }; + public void disconnect(Component reason) { + this.disconnect(new DisconnectionDetails(reason)); + } @@ -0,0 +0,0 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack return; } @@ -2852,8 +2834,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - String leaveMessage = ChatFormatting.YELLOW + this.player.getScoreboardName() + " left the game."; + net.kyori.adventure.text.Component leaveMessage = net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? this.player.getBukkitEntity().displayName() : net.kyori.adventure.text.Component.text(this.player.getScoreboardName())); // Paper - Adventure -- PlayerKickEvent event = new PlayerKickEvent(this.player.getBukkitEntity(), s, leaveMessage); -+ PlayerKickEvent event = new PlayerKickEvent(this.player.getBukkitEntity(), reason, leaveMessage); // Paper - adventure +- PlayerKickEvent event = new PlayerKickEvent(this.player.getBukkitEntity(), CraftChatMessage.fromComponent(disconnectionInfo.reason()), leaveMessage); ++ PlayerKickEvent event = new PlayerKickEvent(this.player.getBukkitEntity(), io.papermc.paper.adventure.PaperAdventure.asAdventure(disconnectionInfo.reason()), leaveMessage); // Paper - adventure if (this.cserver.getServer().isRunning()) { this.cserver.getPluginManager().callEvent(event); @@ -2861,11 +2843,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } this.player.kickLeaveMessage = event.getLeaveMessage(); // CraftBukkit - SPIGOT-3034: Forward leave message to PlayerQuitEvent // Send the possibly modified leave message -- final Component ichatbasecomponent = CraftChatMessage.fromString(event.getReason(), true)[0]; -+ final Component ichatbasecomponent = io.papermc.paper.adventure.PaperAdventure.asVanilla(event.reason()); // Paper - Adventure - // CraftBukkit end +- this.disconnect0(new DisconnectionDetails(CraftChatMessage.fromString(event.getReason(), true)[0], disconnectionInfo.report(), disconnectionInfo.bugReportLink())); ++ this.disconnect0(new DisconnectionDetails(io.papermc.paper.adventure.PaperAdventure.asVanilla(event.reason()), disconnectionInfo.report(), disconnectionInfo.bugReportLink())); // Paper - Adventure + } - this.connection.send(new ClientboundDisconnectPacket(ichatbasecomponent), PacketSendListener.thenRun(() -> { + private void disconnect0(DisconnectionDetails disconnectiondetails) { diff --git a/src/main/java/net/minecraft/server/network/ServerConfigurationPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerConfigurationPacketListenerImpl.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/network/ServerConfigurationPacketListenerImpl.java @@ -2882,9 +2864,9 @@ 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 @@ import net.minecraft.core.registries.Registries; - import net.minecraft.nbt.CompoundTag; +@@ -0,0 +0,0 @@ import net.minecraft.nbt.CompoundTag; import net.minecraft.network.Connection; + import net.minecraft.network.DisconnectionDetails; import net.minecraft.network.TickablePacketListener; +import net.minecraft.network.chat.ChatDecorator; import net.minecraft.network.chat.ChatType; @@ -3099,7 +3081,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public void removeAll() { // CraftBukkit start - disconnect safely for (ServerPlayer player : this.players) { -- player.connection.disconnect(this.server.server.getShutdownMessage()); // CraftBukkit - add custom shutdown message +- player.connection.disconnect(CraftChatMessage.fromStringOrEmpty(this.server.server.getShutdownMessage())); // CraftBukkit - add custom shutdown message + player.connection.disconnect(this.server.server.shutdownMessage()); // CraftBukkit - add custom shutdown message // Paper - Adventure } // CraftBukkit end @@ -3978,7 +3960,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java @@ -0,0 +0,0 @@ public class CraftEnchantment extends Enchantment implements Handleable drops, net.kyori.adventure.text.Component deathMessage, boolean keepInventory) { // Paper - Adventure CraftPlayer entity = victim.getBukkitEntity(); CraftDamageSource bukkitDamageSource = new CraftDamageSource(damageSource); - PlayerDeathEvent event = new PlayerDeathEvent(entity, bukkitDamageSource, drops, victim.getExpReward(), 0, deathMessage); + PlayerDeathEvent event = new PlayerDeathEvent(entity, bukkitDamageSource, drops, victim.getExpReward(damageSource.getEntity()), 0, deathMessage); @@ -0,0 +0,0 @@ public class CraftEventFactory { * Server methods */ @@ -4782,8 +4764,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java @@ -0,0 +0,0 @@ public final class CraftItemFactory implements ItemFactory { - CraftItemStack craft = (CraftItemStack) itemStack; - return CraftItemStack.asCraftMirror(EnchantmentHelper.enchantItem(MinecraftServer.getServer().getWorldData().enabledFeatures(), source, craft.handle, level, allowTreasures)); + Optional> optional = (allowTreasures) ? Optional.empty() : registry.registryOrThrow(Registries.ENCHANTMENT).getTag(EnchantmentTags.IN_ENCHANTING_TABLE); + return CraftItemStack.asCraftMirror(EnchantmentHelper.enchantItem(source, craft.handle, level, registry, optional)); } + + // Paper start - Adventure 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-nerfed-mobs-to-jump.patch b/patches/server/Allow-nerfed-mobs-to-jump.patch similarity index 97% rename from patches/unapplied/server/Allow-nerfed-mobs-to-jump.patch rename to patches/server/Allow-nerfed-mobs-to-jump.patch index 15222c8905..53a79a2043 100644 --- a/patches/unapplied/server/Allow-nerfed-mobs-to-jump.patch +++ b/patches/server/Allow-nerfed-mobs-to-jump.patch @@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/n index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti +@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab private final BodyRotationControl bodyRotationControl; protected PathNavigation navigation; public GoalSelector goalSelector; @@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public GoalSelector targetSelector; @Nullable private LivingEntity target; -@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti +@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab @Override protected final void serverAiStep() { ++this.noActionTime; 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/Build-system-changes.patch b/patches/server/Build-system-changes.patch similarity index 97% rename from patches/unapplied/server/Build-system-changes.patch rename to patches/server/Build-system-changes.patch index 6cb114801c..6c4e97188a 100644 --- a/patches/unapplied/server/Build-system-changes.patch +++ b/patches/server/Build-system-changes.patch @@ -22,7 +22,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + implementation("org.apache.logging.log4j:log4j-iostreams:2.22.1") // Paper - remove exclusion implementation("org.ow2.asm:asm-commons:9.7") implementation("commons-lang:commons-lang:2.6") - runtimeOnly("org.xerial:sqlite-jdbc:3.45.3.0") + runtimeOnly("org.xerial:sqlite-jdbc:3.46.0.0") @@ -0,0 +0,0 @@ tasks.jar { val gitHash = git("rev-parse", "--short=7", "HEAD").getText().trim() val implementationVersion = System.getenv("BUILD_NUMBER") ?: "\"$gitHash\"" @@ -69,7 +69,7 @@ diff --git a/src/main/java/net/minecraft/resources/ResourceLocation.java b/src/m index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/resources/ResourceLocation.java +++ b/src/main/java/net/minecraft/resources/ResourceLocation.java -@@ -0,0 +0,0 @@ public class ResourceLocation implements Comparable { +@@ -0,0 +0,0 @@ public final class ResourceLocation implements Comparable { public static final char NAMESPACE_SEPARATOR = ':'; public static final String DEFAULT_NAMESPACE = "minecraft"; public static final String REALMS_NAMESPACE = "realms"; @@ -142,7 +142,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + Date buildDate = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z").parse(Main.class.getPackage().getImplementationVendor()); // Paper Calendar deadline = Calendar.getInstance(); - deadline.add(Calendar.DAY_OF_YEAR, -21); + deadline.add(Calendar.DAY_OF_YEAR, -3); diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java diff --git a/patches/unapplied/server/CB-fixes.patch b/patches/server/CB-fixes.patch similarity index 100% rename from patches/unapplied/server/CB-fixes.patch rename to patches/server/CB-fixes.patch diff --git a/patches/unapplied/server/Check-online-mode-before-converting-and-renaming-pla.patch b/patches/server/Check-online-mode-before-converting-and-renaming-pla.patch similarity index 100% rename from patches/unapplied/server/Check-online-mode-before-converting-and-renaming-pla.patch rename to patches/server/Check-online-mode-before-converting-and-renaming-pla.patch diff --git a/patches/unapplied/server/ConcurrentUtil.patch b/patches/server/ConcurrentUtil.patch similarity index 100% rename from patches/unapplied/server/ConcurrentUtil.patch rename to patches/server/ConcurrentUtil.patch diff --git a/patches/unapplied/server/Configurable-Disabling-Cat-Chest-Detection.patch b/patches/server/Configurable-Disabling-Cat-Chest-Detection.patch similarity index 100% rename from patches/unapplied/server/Configurable-Disabling-Cat-Chest-Detection.patch rename to patches/server/Configurable-Disabling-Cat-Chest-Detection.patch diff --git a/patches/unapplied/server/Configurable-baby-zombie-movement-speed.patch b/patches/server/Configurable-baby-zombie-movement-speed.patch similarity index 51% rename from patches/unapplied/server/Configurable-baby-zombie-movement-speed.patch rename to patches/server/Configurable-baby-zombie-movement-speed.patch index 38aaf6f951..7e9197f522 100644 --- a/patches/unapplied/server/Configurable-baby-zombie-movement-speed.patch +++ b/patches/server/Configurable-baby-zombie-movement-speed.patch @@ -8,19 +8,20 @@ diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java +++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java -@@ -0,0 +0,0 @@ public class Zombie extends Monster { +@@ -0,0 +0,0 @@ import org.bukkit.event.entity.EntityTransformEvent; + public class Zombie extends Monster { - private static final UUID SPEED_MODIFIER_BABY_UUID = UUID.fromString("B9766B59-9566-4402-BC1F-2EE2A276D836"); - private static final AttributeModifier SPEED_MODIFIER_BABY = new AttributeModifier(Zombie.SPEED_MODIFIER_BABY_UUID, "Baby speed boost", 0.5D, AttributeModifier.Operation.ADD_MULTIPLIED_BASE); -+ private final AttributeModifier babyModifier = new net.minecraft.world.entity.ai.attributes.AttributeModifier(SPEED_MODIFIER_BABY.id(), SPEED_MODIFIER_BABY.name(), this.level().paperConfig().entities.behavior.babyZombieMovementModifier, SPEED_MODIFIER_BABY.operation()); // Paper - Make baby speed configurable - private static final EntityDataAccessor DATA_BABY_ID = SynchedEntityData.defineId(Zombie.class, EntityDataSerializers.BOOLEAN); - private static final EntityDataAccessor DATA_SPECIAL_TYPE_ID = SynchedEntityData.defineId(Zombie.class, EntityDataSerializers.INT); - public static final EntityDataAccessor DATA_DROWNED_CONVERSION_ID = SynchedEntityData.defineId(Zombie.class, EntityDataSerializers.BOOLEAN); + private static final ResourceLocation SPEED_MODIFIER_BABY_ID = ResourceLocation.withDefaultNamespace("baby"); +- private static final AttributeModifier SPEED_MODIFIER_BABY = new AttributeModifier(Zombie.SPEED_MODIFIER_BABY_ID, 0.5D, AttributeModifier.Operation.ADD_MULTIPLIED_BASE); ++ private final AttributeModifier babyModifier = new AttributeModifier(Zombie.SPEED_MODIFIER_BABY_ID, this.level().paperConfig().entities.behavior.babyZombieMovementModifier, AttributeModifier.Operation.ADD_MULTIPLIED_BASE); // Paper - Make baby speed configurable + private static final ResourceLocation REINFORCEMENT_CALLER_CHARGE_ID = ResourceLocation.withDefaultNamespace("reinforcement_caller_charge"); + private static final AttributeModifier ZOMBIE_REINFORCEMENT_CALLEE_CHARGE = new AttributeModifier(ResourceLocation.withDefaultNamespace("reinforcement_callee_charge"), -0.05000000074505806D, AttributeModifier.Operation.ADD_VALUE); + private static final ResourceLocation LEADER_ZOMBIE_BONUS_ID = ResourceLocation.withDefaultNamespace("leader_zombie_bonus"); @@ -0,0 +0,0 @@ public class Zombie extends Monster { if (this.level() != null && !this.level().isClientSide) { AttributeInstance attributemodifiable = this.getAttribute(Attributes.MOVEMENT_SPEED); -- attributemodifiable.removeModifier(Zombie.SPEED_MODIFIER_BABY.id()); +- attributemodifiable.removeModifier(Zombie.SPEED_MODIFIER_BABY_ID); + attributemodifiable.removeModifier(this.babyModifier.id()); // Paper - Make baby speed configurable if (baby) { - attributemodifiable.addTransientModifier(Zombie.SPEED_MODIFIER_BABY); diff --git a/patches/unapplied/server/Configurable-cactus-bamboo-and-reed-growth-height.patch b/patches/server/Configurable-cactus-bamboo-and-reed-growth-height.patch similarity index 100% rename from patches/unapplied/server/Configurable-cactus-bamboo-and-reed-growth-height.patch rename to patches/server/Configurable-cactus-bamboo-and-reed-growth-height.patch diff --git a/patches/unapplied/server/Configurable-container-update-tick-rate.patch b/patches/server/Configurable-container-update-tick-rate.patch similarity index 88% rename from patches/unapplied/server/Configurable-container-update-tick-rate.patch rename to patches/server/Configurable-container-update-tick-rate.patch index 0bbbefb612..352487861d 100644 --- a/patches/unapplied/server/Configurable-container-update-tick-rate.patch +++ b/patches/server/Configurable-container-update-tick-rate.patch @@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/ma index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -0,0 +0,0 @@ public class ServerPlayer extends Player { +@@ -0,0 +0,0 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { public final Object object; private int containerCounter; public boolean wonGame; @@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // CraftBukkit start public CraftPlayer.TransferCookieConnection transferCookieConnection; -@@ -0,0 +0,0 @@ public class ServerPlayer extends Player { +@@ -0,0 +0,0 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { --this.invulnerableTime; } diff --git a/patches/server/Configurable-end-credits.patch b/patches/server/Configurable-end-credits.patch new file mode 100644 index 0000000000..df984bbba2 --- /dev/null +++ b/patches/server/Configurable-end-credits.patch @@ -0,0 +1,18 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: DoctorDark +Date: Wed, 16 Mar 2016 02:21:39 -0500 +Subject: [PATCH] Configurable end credits + + +diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java ++++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +@@ -0,0 +0,0 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { + this.unRide(); + this.serverLevel().removePlayerImmediately(this, Entity.RemovalReason.CHANGED_DIMENSION); + if (!this.wonGame) { ++ if (this.level().paperConfig().misc.disableEndCredits) this.seenCredits = true; // Paper - Option to disable end credits + this.wonGame = true; + this.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.WIN_GAME, 0.0F)); + this.seenCredits = true; diff --git a/patches/unapplied/server/Configurable-fishing-time-ranges.patch b/patches/server/Configurable-fishing-time-ranges.patch similarity index 85% rename from patches/unapplied/server/Configurable-fishing-time-ranges.patch rename to patches/server/Configurable-fishing-time-ranges.patch index 6dac131fb7..0a2b1e6c0a 100644 --- a/patches/unapplied/server/Configurable-fishing-time-ranges.patch +++ b/patches/server/Configurable-fishing-time-ranges.patch @@ -10,8 +10,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java @@ -0,0 +0,0 @@ public class FishingHook extends Projectile { this.noCulling = true; - this.luck = Math.max(0, luckOfTheSeaLevel); - this.lureSpeed = Math.max(0, lureLevel); + this.luck = Math.max(0, luckBonus); + this.lureSpeed = Math.max(0, waitTimeReductionTicks); + // Paper start - Configurable fishing time ranges + minWaitTime = world.paperConfig().fishingTimeRange.minimum; + maxWaitTime = world.paperConfig().fishingTimeRange.maximum; @@ -23,8 +23,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } else { // CraftBukkit start - logic to modify fishing wait time this.timeUntilLured = Mth.nextInt(this.random, this.minWaitTime, this.maxWaitTime); -- this.timeUntilLured -= (this.applyLure) ? this.lureSpeed * 20 * 5 : 0; -+ this.timeUntilLured -= (this.applyLure) ? (this.lureSpeed * 20 * 5 >= this.maxWaitTime ? this.timeUntilLured - 1 : this.lureSpeed * 20 * 5) : 0; // Paper - Fix Lure infinite loop +- this.timeUntilLured -= (this.applyLure) ? this.lureSpeed : 0; ++ this.timeUntilLured -= (this.applyLure) ? (this.lureSpeed >= this.maxWaitTime ? this.timeUntilLured - 1 : this.lureSpeed ) : 0; // Paper - Fix Lure infinite loop // CraftBukkit end } } diff --git a/patches/unapplied/server/Configurable-mob-spawner-tick-rate.patch b/patches/server/Configurable-mob-spawner-tick-rate.patch similarity index 100% rename from patches/unapplied/server/Configurable-mob-spawner-tick-rate.patch rename to patches/server/Configurable-mob-spawner-tick-rate.patch diff --git a/patches/unapplied/server/Configurable-top-of-nether-void-damage.patch b/patches/server/Configurable-top-of-nether-void-damage.patch similarity index 76% rename from patches/unapplied/server/Configurable-top-of-nether-void-damage.patch rename to patches/server/Configurable-top-of-nether-void-damage.patch index 045574b847..0f77d7fb1d 100644 --- a/patches/unapplied/server/Configurable-top-of-nether-void-damage.patch +++ b/patches/server/Configurable-top-of-nether-void-damage.patch @@ -27,14 +27,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java +++ b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java @@ -0,0 +0,0 @@ public class PortalForcer { - Optional optional = villageplace.getInSquare((holder) -> { - return holder.is(PoiTypes.NETHER_PORTAL); - }, blockposition, i, PoiManager.Occupancy.ANY).filter((villageplacerecord) -> { -- return worldborder.isWithinBounds(villageplacerecord.getPos()); -+ return worldborder.isWithinBounds(villageplacerecord.getPos()) && !(this.level.getTypeKey() == net.minecraft.world.level.dimension.LevelStem.NETHER && this.level.paperConfig().environment.netherCeilingVoidDamageHeight.test(v -> villageplacerecord.getPos().getY() >= v)); // Paper - Configurable nether ceiling damage - }).sorted(Comparator.comparingDouble((PoiRecord villageplacerecord) -> { // CraftBukkit - decompile error - return villageplacerecord.getPos().distSqr(blockposition); - }).thenComparingInt((villageplacerecord) -> { + }, blockposition, i, PoiManager.Occupancy.ANY).map(PoiRecord::getPos); + + Objects.requireNonNull(worldborder); +- return stream.filter(worldborder::isWithinBounds).filter((blockposition1) -> { ++ return stream.filter(worldborder::isWithinBounds).filter(pos -> !(this.level.getTypeKey() == net.minecraft.world.level.dimension.LevelStem.NETHER && this.level.paperConfig().environment.netherCeilingVoidDamageHeight.test(v -> pos.getY() >= v))).filter((blockposition1) -> { // Paper - Configurable nether ceiling damage + return this.level.getBlockState(blockposition1).hasProperty(BlockStateProperties.HORIZONTAL_AXIS); + }).min(Comparator.comparingDouble((BlockPos blockposition1) -> { // CraftBukkit - decompile error + return blockposition1.distSqr(blockposition); @@ -0,0 +0,0 @@ public class PortalForcer { BlockPos blockposition2 = null; WorldBorder worldborder = this.level.getWorldBorder(); @@ -44,6 +44,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + i = Math.min(i, this.level.paperConfig().environment.netherCeilingVoidDamageHeight.intValue() - 1); + } + // Paper end - Configurable nether ceiling damage + boolean flag = true; BlockPos.MutableBlockPos blockposition_mutableblockposition = blockposition.mutable(); Iterator iterator = BlockPos.spiralAround(blockposition, createRadius, Direction.EAST, Direction.SOUTH).iterator(); // CraftBukkit - diff --git a/patches/unapplied/server/Deobfuscate-stacktraces-in-log-messages-crash-report.patch b/patches/server/Deobfuscate-stacktraces-in-log-messages-crash-report.patch similarity index 100% rename from patches/unapplied/server/Deobfuscate-stacktraces-in-log-messages-crash-report.patch rename to patches/server/Deobfuscate-stacktraces-in-log-messages-crash-report.patch diff --git a/patches/unapplied/server/Disable-explosion-knockback.patch b/patches/server/Disable-explosion-knockback.patch similarity index 80% rename from patches/unapplied/server/Disable-explosion-knockback.patch rename to patches/server/Disable-explosion-knockback.patch index 44b6e9a6fe..5b2cdcb3de 100644 --- a/patches/unapplied/server/Disable-explosion-knockback.patch +++ b/patches/server/Disable-explosion-knockback.patch @@ -12,8 +12,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (entity instanceof LivingEntity) { LivingEntity entityliving = (LivingEntity) entity; -- d13 = ProtectionEnchantment.getExplosionKnockbackAfterDampener(entityliving, d12); -+ d13 = entity instanceof Player && level.paperConfig().environment.disableExplosionKnockback ? 0 : ProtectionEnchantment.getExplosionKnockbackAfterDampener(entityliving, d12); // Paper - Option to disable explosion knockback +- d13 = d12 * (1.0D - entityliving.getAttributeValue(Attributes.EXPLOSION_KNOCKBACK_RESISTANCE)); ++ d13 = entity instanceof Player && this.level.paperConfig().environment.disableExplosionKnockback ? 0 : d12 * (1.0D - entityliving.getAttributeValue(Attributes.EXPLOSION_KNOCKBACK_RESISTANCE)); } else { d13 = d12; } diff --git a/patches/unapplied/server/Disable-ice-and-snow.patch b/patches/server/Disable-ice-and-snow.patch similarity index 100% rename from patches/unapplied/server/Disable-ice-and-snow.patch rename to patches/server/Disable-ice-and-snow.patch diff --git a/patches/unapplied/server/Disable-spigot-tick-limiters.patch b/patches/server/Disable-spigot-tick-limiters.patch similarity index 100% rename from patches/unapplied/server/Disable-spigot-tick-limiters.patch rename to patches/server/Disable-spigot-tick-limiters.patch diff --git a/patches/unapplied/server/Disable-thunder.patch b/patches/server/Disable-thunder.patch similarity index 100% rename from patches/unapplied/server/Disable-thunder.patch rename to patches/server/Disable-thunder.patch diff --git a/patches/unapplied/server/Drop-falling-block-and-tnt-entities-at-the-specified.patch b/patches/server/Drop-falling-block-and-tnt-entities-at-the-specified.patch similarity index 91% rename from patches/unapplied/server/Drop-falling-block-and-tnt-entities-at-the-specified.patch rename to patches/server/Drop-falling-block-and-tnt-entities-at-the-specified.patch index 0374b5c0a4..d28b3d1482 100644 --- a/patches/unapplied/server/Drop-falling-block-and-tnt-entities-at-the-specified.patch +++ b/patches/server/Drop-falling-block-and-tnt-entities-at-the-specified.patch @@ -23,15 +23,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + return; + } + // Paper end - Configurable falling blocks height nerf - if (!this.level().isClientSide) { + this.handlePortal(); + if (!this.level().isClientSide && (this.isAlive() || this.forceTickAfterTeleportToDuplicate)) { BlockPos blockposition = this.blockPosition(); - boolean flag = this.blockState.getBlock() instanceof ConcretePowderBlock; 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java +++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java @@ -0,0 +0,0 @@ public class PrimedTnt extends Entity implements TraceableEntity { - if (this.level().spigotConfig.maxTntTicksPerTick > 0 && ++this.level().spigotConfig.currentPrimedTnt > this.level().spigotConfig.maxTntTicksPerTick) { return; } // Spigot + this.handlePortal(); this.applyGravity(); this.move(MoverType.SELF, this.getDeltaMovement()); + // Paper start - Configurable TNT height nerf diff --git a/patches/unapplied/server/Entity-Origin-API.patch b/patches/server/Entity-Origin-API.patch similarity index 100% rename from patches/unapplied/server/Entity-Origin-API.patch rename to patches/server/Entity-Origin-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/Expose-server-build-information.patch b/patches/server/Expose-server-build-information.patch similarity index 99% rename from patches/unapplied/server/Expose-server-build-information.patch rename to patches/server/Expose-server-build-information.patch index 8076dd2679..d8e55aad30 100644 --- a/patches/unapplied/server/Expose-server-build-information.patch +++ b/patches/server/Expose-server-build-information.patch @@ -610,7 +610,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public static boolean useConsole = true; @@ -0,0 +0,0 @@ public class Main { - deadline.add(Calendar.DAY_OF_YEAR, -21); + deadline.add(Calendar.DAY_OF_YEAR, -3); if (buildDate.before(deadline.getTime())) { System.err.println("*** Error, this build is outdated ***"); - System.err.println("*** Please download a new build as per instructions from https://www.spigotmc.org/go/outdated-spigot ***"); diff --git a/patches/unapplied/server/Fix-lag-from-explosions-processing-dead-entities.patch b/patches/server/Fix-lag-from-explosions-processing-dead-entities.patch similarity index 100% rename from patches/unapplied/server/Fix-lag-from-explosions-processing-dead-entities.patch rename to patches/server/Fix-lag-from-explosions-processing-dead-entities.patch diff --git a/patches/unapplied/server/Further-improve-server-tick-loop.patch b/patches/server/Further-improve-server-tick-loop.patch similarity index 100% rename from patches/unapplied/server/Further-improve-server-tick-loop.patch rename to patches/server/Further-improve-server-tick-loop.patch diff --git a/patches/unapplied/server/Handle-plugin-prefixes-using-Log4J-configuration.patch b/patches/server/Handle-plugin-prefixes-using-Log4J-configuration.patch similarity index 100% rename from patches/unapplied/server/Handle-plugin-prefixes-using-Log4J-configuration.patch rename to patches/server/Handle-plugin-prefixes-using-Log4J-configuration.patch diff --git a/patches/unapplied/server/Hook-into-CB-plugin-rewrites.patch b/patches/server/Hook-into-CB-plugin-rewrites.patch similarity index 98% rename from patches/unapplied/server/Hook-into-CB-plugin-rewrites.patch rename to patches/server/Hook-into-CB-plugin-rewrites.patch index d1b425ee4d..efb8e9cae0 100644 --- a/patches/unapplied/server/Hook-into-CB-plugin-rewrites.patch +++ b/patches/server/Hook-into-CB-plugin-rewrites.patch @@ -28,8 +28,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import joptsimple.OptionSet; import joptsimple.OptionSpec; @@ -0,0 +0,0 @@ public class Commodore { - private static final Map FIELD_RENAME_METHOD_REROUTE = Commodore.createReroutes(FieldRename.class); private static final Map MATERIAL_METHOD_REROUTE = Commodore.createReroutes(MaterialRerouting.class); + private static final Map METHOD_REROUTE = Commodore.createReroutes(MethodRerouting.class); + // Paper start - Plugin rewrites + private static final Map SEARCH_AND_REMOVE = initReplacementsMap(); diff --git a/patches/unapplied/server/Implement-PlayerLocaleChangeEvent.patch b/patches/server/Implement-PlayerLocaleChangeEvent.patch similarity index 91% rename from patches/unapplied/server/Implement-PlayerLocaleChangeEvent.patch rename to patches/server/Implement-PlayerLocaleChangeEvent.patch index a967559137..2d670e13bf 100644 --- a/patches/unapplied/server/Implement-PlayerLocaleChangeEvent.patch +++ b/patches/server/Implement-PlayerLocaleChangeEvent.patch @@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/ma index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -0,0 +0,0 @@ public class ServerPlayer extends Player { +@@ -0,0 +0,0 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { private int levitationStartTime; private boolean disconnected; private int requestedViewDistance; @@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public java.util.Locale adventure$locale = java.util.Locale.US; // Paper @Nullable private Vec3 startingToFallPosition; -@@ -0,0 +0,0 @@ public class ServerPlayer extends Player { +@@ -0,0 +0,0 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { this.lastActionTime = Util.getMillis(); this.recipeBook = new ServerRecipeBook(); this.requestedViewDistance = 2; @@ -26,7 +26,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.lastSectionPos = SectionPos.of(0, 0, 0); this.chunkTrackingView = ChunkTrackingView.EMPTY; this.respawnDimension = Level.OVERWORLD; -@@ -0,0 +0,0 @@ public class ServerPlayer extends Player { +@@ -0,0 +0,0 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { PlayerChangedMainHandEvent event = new PlayerChangedMainHandEvent(this.getBukkitEntity(), this.getMainArm() == HumanoidArm.LEFT ? MainHand.LEFT : MainHand.RIGHT); this.server.server.getPluginManager().callEvent(event); } diff --git a/patches/unapplied/server/Improve-Log4J-Configuration-Plugin-Loggers.patch b/patches/server/Improve-Log4J-Configuration-Plugin-Loggers.patch similarity index 100% rename from patches/unapplied/server/Improve-Log4J-Configuration-Plugin-Loggers.patch rename to patches/server/Improve-Log4J-Configuration-Plugin-Loggers.patch diff --git a/patches/unapplied/server/Improve-Player-chat-API-handling.patch b/patches/server/Improve-Player-chat-API-handling.patch similarity index 100% rename from patches/unapplied/server/Improve-Player-chat-API-handling.patch rename to patches/server/Improve-Player-chat-API-handling.patch diff --git a/patches/unapplied/server/MC-Dev-fixes.patch b/patches/server/MC-Dev-fixes.patch similarity index 100% rename from patches/unapplied/server/MC-Dev-fixes.patch rename to patches/server/MC-Dev-fixes.patch diff --git a/patches/unapplied/server/MC-Utils.patch b/patches/server/MC-Utils.patch similarity index 98% rename from patches/unapplied/server/MC-Utils.patch rename to patches/server/MC-Utils.patch index cae05842d3..e763bc3082 100644 --- a/patches/unapplied/server/MC-Utils.patch +++ b/patches/server/MC-Utils.patch @@ -6128,9 +6128,9 @@ diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/mai index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/level/ChunkHolder.java +++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java -@@ -0,0 +0,0 @@ public class ChunkHolder { - private static final List CHUNK_STATUSES = ChunkStatus.getStatusList(); - private final AtomicReferenceArray>> futures; +@@ -0,0 +0,0 @@ public class ChunkHolder extends GenerationChunkHolder { + public static final ChunkResult UNLOADED_LEVEL_CHUNK = ChunkResult.error("Unloaded level chunk"); + private static final CompletableFuture> UNLOADED_LEVEL_CHUNK_FUTURE = CompletableFuture.completedFuture(ChunkHolder.UNLOADED_LEVEL_CHUNK); private final LevelHeightAccessor levelHeightAccessor; - private volatile CompletableFuture> fullChunkFuture; - private volatile CompletableFuture> tickingChunkFuture; @@ -6138,12 +6138,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + private volatile CompletableFuture> fullChunkFuture; private int fullChunkCreateCount; private volatile boolean isFullChunkReady; // Paper - cache chunk ticking stage + private volatile CompletableFuture> tickingChunkFuture; private volatile boolean isTickingReady; // Paper - cache chunk ticking stage + private volatile CompletableFuture> entityTickingChunkFuture; private volatile boolean isEntityTickingReady; // Paper - cache chunk ticking stage - private CompletableFuture chunkToSave; - @Nullable - private final DebugBuffer chunkToSaveHistory; -@@ -0,0 +0,0 @@ public class ChunkHolder { - private CompletableFuture pendingFullStateConfirmation; + public int oldTicketLevel; + private int ticketLevel; + private int queueLevel; +@@ -0,0 +0,0 @@ public class ChunkHolder extends GenerationChunkHolder { private CompletableFuture sendSync; + private CompletableFuture saveSync; + private final ChunkMap chunkMap; // Paper + @@ -6158,9 +6158,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end + public ChunkHolder(ChunkPos pos, int level, LevelHeightAccessor world, LevelLightEngine lightingProvider, ChunkHolder.LevelChangeListener levelUpdateListener, ChunkHolder.PlayerProvider playersWatchingChunkProvider) { - this.futures = new AtomicReferenceArray(ChunkHolder.CHUNK_STATUSES.size()); + super(pos); this.fullChunkFuture = ChunkHolder.UNLOADED_LEVEL_CHUNK_FUTURE; -@@ -0,0 +0,0 @@ public class ChunkHolder { +@@ -0,0 +0,0 @@ public class ChunkHolder extends GenerationChunkHolder { this.queueLevel = this.oldTicketLevel; this.setTicketLevel(level); this.changedBlocksPerSection = new ShortSet[world.getSectionsCount()]; @@ -6183,10 +6183,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end // CraftBukkit start public LevelChunk getFullChunkNow() { - // Note: We use the oldTicketLevel for isLoaded checks. -@@ -0,0 +0,0 @@ public class ChunkHolder { - return ChunkLevel.generationStatus(this.ticketLevel).isOrAfter(leastStatus) ? this.getFutureIfPresentUnchecked(leastStatus) : ChunkHolder.UNLOADED_CHUNK_FUTURE; + return (LevelChunk) this.getChunkIfPresent(ChunkStatus.FULL); +@@ -0,0 +0,0 @@ public class ChunkHolder extends GenerationChunkHolder { } + // CraftBukkit end - public CompletableFuture> getTickingChunkFuture() { + public final CompletableFuture> getTickingChunkFuture() { // Paper - final for inline @@ -6209,8 +6209,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return (LevelChunk) ((ChunkResult) this.getTickingChunkFuture().getNow(ChunkHolder.UNLOADED_LEVEL_CHUNK)).orElse(null); // CraftBukkit - decompile error } -@@ -0,0 +0,0 @@ public class ChunkHolder { - return null; +@@ -0,0 +0,0 @@ public class ChunkHolder extends GenerationChunkHolder { + } + // Paper start @@ -6228,39 +6228,25 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + // Paper end + - @Nullable - public ChunkAccess getLastAvailable() { - for (int i = ChunkHolder.CHUNK_STATUSES.size() - 1; i >= 0; --i) { -@@ -0,0 +0,0 @@ public class ChunkHolder { - return null; - } - -- public CompletableFuture getChunkToSave() { -+ public final CompletableFuture getChunkToSave() { // Paper - final for inline - return this.chunkToSave; - } - -@@ -0,0 +0,0 @@ public class ChunkHolder { - return ChunkLevel.fullStatus(this.ticketLevel); - } - -- public ChunkPos getPos() { -+ public final ChunkPos getPos() { // Paper - final for inline - return this.pos; + public CompletableFuture getSaveSyncFuture() { + return this.saveSync; + } +@@ -0,0 +0,0 @@ public class ChunkHolder extends GenerationChunkHolder { } + @Override - public int getTicketLevel() { + public final int getTicketLevel() { // Paper - final for inline return this.ticketLevel; } -@@ -0,0 +0,0 @@ public class ChunkHolder { +@@ -0,0 +0,0 @@ public class ChunkHolder extends GenerationChunkHolder { - this.wasAccessibleSinceLastSave |= flag3; - if (!flag2 && flag3) { + this.wasAccessibleSinceLastSave |= flag1; + if (!flag && flag1) { + int expectCreateCount = ++this.fullChunkCreateCount; // Paper - this.fullChunkFuture = chunkStorage.prepareAccessibleChunk(this); - this.scheduleFullChunkPromotion(chunkStorage, this.fullChunkFuture, executor, FullChunkStatus.FULL); + this.fullChunkFuture = chunkLoadingManager.prepareAccessibleChunk(this); + this.scheduleFullChunkPromotion(chunkLoadingManager, this.fullChunkFuture, executor, FullChunkStatus.FULL); + // Paper start - cache ticking ready status + this.fullChunkFuture.thenAccept(chunkResult -> { + chunkResult.ifSuccess(chunk -> { @@ -6270,10 +6256,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + }); + }); - this.updateChunkToSave(this.fullChunkFuture, "full"); ++ // Paper end - cache ticking ready status + this.addSaveDependency(this.fullChunkFuture); } - if (flag2 && !flag3) { + if (flag && !flag1) { + // Paper start + if (this.isFullChunkReady) { + io.papermc.paper.chunk.system.ChunkSystem.onChunkNotBorder(this.fullChunkFuture.join().orElseThrow(IllegalStateException::new), this); // Paper @@ -6281,15 +6268,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end this.fullChunkFuture.complete(ChunkHolder.UNLOADED_LEVEL_CHUNK); this.fullChunkFuture = ChunkHolder.UNLOADED_LEVEL_CHUNK_FUTURE; -+ ++this.fullChunkCreateCount; // Paper - cache ticking ready status -+ this.isFullChunkReady = false; // Paper - cache ticking ready status } - - boolean flag4 = fullchunkstatus.isOrAfter(FullChunkStatus.BLOCK_TICKING); -@@ -0,0 +0,0 @@ public class ChunkHolder { - if (!flag4 && flag5) { - this.tickingChunkFuture = chunkStorage.prepareTickingChunk(this); - this.scheduleFullChunkPromotion(chunkStorage, this.tickingChunkFuture, executor, FullChunkStatus.BLOCK_TICKING); +@@ -0,0 +0,0 @@ public class ChunkHolder extends GenerationChunkHolder { + if (!flag2 && flag3) { + this.tickingChunkFuture = chunkLoadingManager.prepareTickingChunk(this); + this.scheduleFullChunkPromotion(chunkLoadingManager, this.tickingChunkFuture, executor, FullChunkStatus.BLOCK_TICKING); + // Paper start - cache ticking ready status + this.tickingChunkFuture.thenAccept(chunkResult -> { + chunkResult.ifSuccess(chunk -> { @@ -6299,10 +6282,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + }); + }); + // Paper end - this.updateChunkToSave(this.tickingChunkFuture, "ticking"); + this.addSaveDependency(this.tickingChunkFuture); } - if (flag4 && !flag5) { + if (flag2 && !flag3) { - this.tickingChunkFuture.complete(ChunkHolder.UNLOADED_LEVEL_CHUNK); + // Paper start + if (this.isTickingReady) { @@ -6313,10 +6296,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.tickingChunkFuture = ChunkHolder.UNLOADED_LEVEL_CHUNK_FUTURE; } -@@ -0,0 +0,0 @@ public class ChunkHolder { +@@ -0,0 +0,0 @@ public class ChunkHolder extends GenerationChunkHolder { - this.entityTickingChunkFuture = chunkStorage.prepareEntityTickingChunk(this); - this.scheduleFullChunkPromotion(chunkStorage, this.entityTickingChunkFuture, executor, FullChunkStatus.ENTITY_TICKING); + this.entityTickingChunkFuture = chunkLoadingManager.prepareEntityTickingChunk(this); + this.scheduleFullChunkPromotion(chunkLoadingManager, this.entityTickingChunkFuture, executor, FullChunkStatus.ENTITY_TICKING); + // Paper start - cache ticking ready status + this.entityTickingChunkFuture.thenAccept(chunkResult -> { + chunkResult.ifSuccess(chunk -> { @@ -6325,10 +6308,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + }); + }); + // Paper end - this.updateChunkToSave(this.entityTickingChunkFuture, "entity ticking"); + this.addSaveDependency(this.entityTickingChunkFuture); } - if (flag6 && !flag7) { + if (flag4 && !flag5) { - this.entityTickingChunkFuture.complete(ChunkHolder.UNLOADED_LEVEL_CHUNK); + // Paper start + if (this.isEntityTickingReady) { @@ -6339,9 +6322,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.entityTickingChunkFuture = ChunkHolder.UNLOADED_LEVEL_CHUNK_FUTURE; } -@@ -0,0 +0,0 @@ public class ChunkHolder { - private static record ChunkSaveDebug(Thread thread, CompletableFuture future, String source) { +@@ -0,0 +0,0 @@ public class ChunkHolder extends GenerationChunkHolder { + List getPlayers(ChunkPos chunkPos, boolean onlyOnWatchDistanceEdge); } + + // Paper start @@ -6426,9 +6409,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 super(new RegionStorageInfo(session.getLevelId(), world.dimension(), "chunk"), session.getDimensionPath(world.dimension()).resolve("region"), dataFixer, dsync); this.visibleChunkMap = this.updatingChunkMap.clone(); @@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider - this.poiManager = new PoiManager(new RegionStorageInfo(session.getLevelId(), world.dimension(), "poi"), path.resolve("poi"), dataFixer, dsync, iregistrycustom, world); + this.poiManager = new PoiManager(new RegionStorageInfo(session.getLevelId(), world.dimension(), "poi"), path.resolve("poi"), dataFixer, dsync, iregistrycustom, world.getServer(), world); this.setServerViewDistance(viewDistance); - this.worldGenContext = new WorldGenContext(world, chunkGenerator, structureTemplateManager, this.lightEngine); + this.worldGenContext = new WorldGenContext(world, chunkGenerator, structureTemplateManager, this.lightEngine, this.mainThreadMailbox); + // Paper start + this.dataRegionManager = new io.papermc.paper.chunk.SingleThreadChunkRegionManager(this.level, 2, (1.0 / 3.0), 1, 6, "Data", DataRegionData::new, DataRegionSectionData::new); + this.regionManagers.add(this.dataRegionManager); @@ -6441,21 +6424,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + public final io.papermc.paper.util.player.NearbyPlayers getNearbyPlayers() { + return this.nearbyPlayers; } -+ // Paper end - - protected ChunkGenerator generator() { - return this.generator; -@@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider - }); - } + public int getMobCountNear(final ServerPlayer player, final net.minecraft.world.entity.MobCategory mobCategory) { + return -1; + } ++ // Paper end + - private static double euclideanDistanceSquared(ChunkPos pos, Entity entity) { - double d0 = (double) SectionPos.sectionToBlockCoord(pos.x, 8); - double d1 = (double) SectionPos.sectionToBlockCoord(pos.z, 8); + protected ChunkGenerator generator() { + return this.worldGenContext.generator(); + } @@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider }; @@ -6511,9 +6488,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 private void processUnloads(BooleanSupplier shouldKeepTicking) { @@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider - ChunkHolder playerchunk = (ChunkHolder) this.updatingChunkMap.remove(j); + } - if (playerchunk != null) { + this.updatingChunkMap.remove(j); + playerchunk.onChunkRemove(); // Paper this.pendingUnloads.put(j, playerchunk); this.modified = true; @@ -6528,18 +6505,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 while (l < 20 && shouldKeepTicking.getAsBoolean() && objectiterator.hasNext()) { if (this.saveChunkIfNeeded((ChunkHolder) objectiterator.next())) { @@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider - if (completablefuture1 != completablefuture) { - this.scheduleUnload(pos, holder); } else { + ChunkAccess ichunkaccess = holder.getLatestChunk(); + - if (this.pendingUnloads.remove(pos, holder) && ichunkaccess != null) { + // Paper start + boolean removed; + if ((removed = this.pendingUnloads.remove(pos, holder)) && ichunkaccess != null) { + io.papermc.paper.chunk.system.ChunkSystem.onChunkHolderDelete(this.level, holder); + // Paper end + LevelChunk chunk; + if (ichunkaccess instanceof LevelChunk) { - ((LevelChunk) ichunkaccess).setLoaded(false); - } @@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider this.lightEngine.tryScheduleUpdate(); this.progressListener.onStatusChange(ichunkaccess.getPos(), (ChunkStatus) null); @@ -6599,8 +6576,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + long i = playerchunk.pos.toLong(); // Paper ChunkPos chunkcoordintpair = new ChunkPos(i); - ChunkHolder playerchunk = (ChunkHolder) entry.getValue(); -+ // Paper - Optional optional = Optional.ofNullable(playerchunk.getLastAvailable()); ++ // Paper - move up + Optional optional = Optional.ofNullable(playerchunk.getLatestChunk()); Optional optional1 = optional.flatMap((ichunkaccess) -> { return ichunkaccess instanceof LevelChunk ? Optional.of((LevelChunk) ichunkaccess) : Optional.empty(); @@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -6667,8 +6644,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } public void removeTicketsOnClosing() { -- ImmutableSet> immutableset = ImmutableSet.of(TicketType.UNKNOWN, TicketType.POST_TELEPORT, TicketType.LIGHT); -+ ImmutableSet> immutableset = ImmutableSet.of(TicketType.UNKNOWN, TicketType.POST_TELEPORT, TicketType.LIGHT, TicketType.FUTURE_AWAIT); // Paper - add additional tickets to preserve +- ImmutableSet> immutableset = ImmutableSet.of(TicketType.UNKNOWN, TicketType.POST_TELEPORT); ++ ImmutableSet> immutableset = ImmutableSet.of(TicketType.UNKNOWN, TicketType.POST_TELEPORT, TicketType.FUTURE_AWAIT); // Paper - add additional tickets to preserve ObjectIterator>>> objectiterator = this.tickets.long2ObjectEntrySet().fastIterator(); while (objectiterator.hasNext()) { @@ -6953,7 +6930,7 @@ diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/ma index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -0,0 +0,0 @@ public class ServerPlayer extends Player { +@@ -0,0 +0,0 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { public boolean sentListPacket = false; public String kickLeaveMessage = null; // SPIGOT-3034: Forward leave message to PlayerQuitEvent // CraftBukkit end @@ -6962,7 +6939,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile, ClientInformation clientOptions) { super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile); -@@ -0,0 +0,0 @@ public class ServerPlayer extends Player { +@@ -0,0 +0,0 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { this.updateOptions(clientOptions); this.object = null; @@ -6988,7 +6965,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java +++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java @@ -0,0 +0,0 @@ public class WorldGenRegion implements WorldGenLevel { - return chunkX >= this.firstPos.x && chunkX <= this.lastPos.x && chunkZ >= this.firstPos.z && chunkZ <= this.lastPos.z; + return k < this.generatingStep.directDependencies().size(); } + // Paper start - if loaded util @@ -7076,7 +7053,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/n index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti +@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab return this.target; } diff --git a/patches/unapplied/server/Only-refresh-abilities-if-needed.patch b/patches/server/Only-refresh-abilities-if-needed.patch similarity index 100% rename from patches/unapplied/server/Only-refresh-abilities-if-needed.patch rename to patches/server/Only-refresh-abilities-if-needed.patch diff --git a/patches/unapplied/server/Optimize-explosions.patch b/patches/server/Optimize-explosions.patch similarity index 100% rename from patches/unapplied/server/Optimize-explosions.patch rename to patches/server/Optimize-explosions.patch diff --git a/patches/unapplied/server/Paper-Metrics.patch b/patches/server/Paper-Metrics.patch similarity index 100% rename from patches/unapplied/server/Paper-Metrics.patch rename to patches/server/Paper-Metrics.patch diff --git a/patches/unapplied/server/Paper-Plugins.patch b/patches/server/Paper-Plugins.patch similarity index 100% rename from patches/unapplied/server/Paper-Plugins.patch rename to patches/server/Paper-Plugins.patch diff --git a/patches/unapplied/server/Paper-command.patch b/patches/server/Paper-command.patch similarity index 100% rename from patches/unapplied/server/Paper-command.patch rename to patches/server/Paper-command.patch diff --git a/patches/unapplied/server/Paper-config-files.patch b/patches/server/Paper-config-files.patch similarity index 99% rename from patches/unapplied/server/Paper-config-files.patch rename to patches/server/Paper-config-files.patch index a6c4b5c81c..2e4f4e526a 100644 --- a/patches/unapplied/server/Paper-config-files.patch +++ b/patches/server/Paper-config-files.patch @@ -24,8 +24,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 implementation("org.ow2.asm:asm-commons:9.7") + implementation("org.spongepowered:configurate-yaml:4.2.0-SNAPSHOT") // Paper - config files implementation("commons-lang:commons-lang:2.6") - runtimeOnly("org.xerial:sqlite-jdbc:3.45.3.0") - runtimeOnly("com.mysql:mysql-connector-j:8.3.0") + runtimeOnly("org.xerial:sqlite-jdbc:3.46.0.0") + runtimeOnly("com.mysql:mysql-connector-j:8.4.0") diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java new file mode 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 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 100% rename from patches/unapplied/server/Player-Tab-List-and-Title-APIs.patch rename to patches/server/Player-Tab-List-and-Title-APIs.patch diff --git a/patches/unapplied/server/Player-affects-spawning-API.patch b/patches/server/Player-affects-spawning-API.patch similarity index 98% rename from patches/unapplied/server/Player-affects-spawning-API.patch rename to patches/server/Player-affects-spawning-API.patch index 54d5a7dfe5..7f70948768 100644 --- a/patches/unapplied/server/Player-affects-spawning-API.patch +++ b/patches/server/Player-affects-spawning-API.patch @@ -24,7 +24,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/n index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti +@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab if (this.level().getDifficulty() == Difficulty.PEACEFUL && this.shouldDespawnInPeaceful()) { this.discard(EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause } else if (!this.isPersistenceRequired() && !this.requiresCustomPersistence()) { @@ -77,9 +77,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java @@ -0,0 +0,0 @@ public abstract class Player extends LivingEntity { - @Nullable public Entity currentExplosionCause; - public boolean ignoreFallDamageFromCurrentImpulse; + private boolean ignoreFallDamageFromCurrentImpulse; + private int currentImpulseContextResetGraceTime; + public boolean affectsSpawning = true; // Paper - Affects Spawning API // CraftBukkit start diff --git a/patches/unapplied/server/Plugin-remapping.patch b/patches/server/Plugin-remapping.patch similarity index 100% rename from patches/unapplied/server/Plugin-remapping.patch rename to patches/server/Plugin-remapping.patch diff --git a/patches/unapplied/server/Prevent-block-entity-and-entity-crashes.patch b/patches/server/Prevent-block-entity-and-entity-crashes.patch similarity index 100% rename from patches/unapplied/server/Prevent-block-entity-and-entity-crashes.patch rename to patches/server/Prevent-block-entity-and-entity-crashes.patch diff --git a/patches/unapplied/server/Remap-fixes.patch b/patches/server/Remap-fixes.patch similarity index 96% rename from patches/unapplied/server/Remap-fixes.patch rename to patches/server/Remap-fixes.patch index aac272411d..b636a13b75 100644 --- a/patches/unapplied/server/Remap-fixes.patch +++ b/patches/server/Remap-fixes.patch @@ -89,9 +89,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @EnumSource(DyeColor.class) public void checkColor(DyeColor dye) { Color color = dye.getColor(); -- float[] nmsColorArray = DyeColor.byId(dye.getWoolData()).getTextureDiffuseColors(); -+ float[] nmsColorArray = net.minecraft.world.item.DyeColor.byId(dye.getWoolData()).getTextureDiffuseColors(); // Paper - remap fix - Color nmsColor = Color.fromRGB((int) (nmsColorArray[0] * 255), (int) (nmsColorArray[1] * 255), (int) (nmsColorArray[2] * 255)); +- int nmsColorArray = DyeColor.byId(dye.getWoolData()).getTextureDiffuseColor(); ++ int nmsColorArray = net.minecraft.world.item.DyeColor.byId(dye.getWoolData()).getTextureDiffuseColors(); // Paper - remap fix + Color nmsColor = Color.fromARGB(nmsColorArray); assertThat(color, is(nmsColor)); } @@ -0,0 +0,0 @@ public class DyeColorsTest extends AbstractTestingBase { diff --git a/patches/unapplied/server/Remap-reflection-calls-in-plugins-using-internals.patch b/patches/server/Remap-reflection-calls-in-plugins-using-internals.patch similarity index 99% rename from patches/unapplied/server/Remap-reflection-calls-in-plugins-using-internals.patch rename to patches/server/Remap-reflection-calls-in-plugins-using-internals.patch index aca029594b..8cdae74b74 100644 --- a/patches/unapplied/server/Remap-reflection-calls-in-plugins-using-internals.patch +++ b/patches/server/Remap-reflection-calls-in-plugins-using-internals.patch @@ -649,7 +649,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java @@ -0,0 +0,0 @@ public class Commodore { - private static final Map MATERIAL_METHOD_REROUTE = Commodore.createReroutes(MaterialRerouting.class); + private static final Map METHOD_REROUTE = Commodore.createReroutes(MethodRerouting.class); // Paper start - Plugin rewrites - private static final Map SEARCH_AND_REMOVE = initReplacementsMap(); diff --git a/patches/unapplied/server/Rewrite-LogEvents-to-contain-the-source-jars-in-stac.patch b/patches/server/Rewrite-LogEvents-to-contain-the-source-jars-in-stac.patch similarity index 100% rename from patches/unapplied/server/Rewrite-LogEvents-to-contain-the-source-jars-in-stac.patch rename to patches/server/Rewrite-LogEvents-to-contain-the-source-jars-in-stac.patch diff --git a/patches/unapplied/server/Setup-Gradle-project.patch b/patches/server/Setup-Gradle-project.patch similarity index 98% rename from patches/unapplied/server/Setup-Gradle-project.patch rename to patches/server/Setup-Gradle-project.patch index baaf3e6133..eb843b5c56 100644 --- a/patches/unapplied/server/Setup-Gradle-project.patch +++ b/patches/server/Setup-Gradle-project.patch @@ -47,8 +47,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + implementation("org.ow2.asm:asm-commons:9.7") + implementation("commons-lang:commons-lang:2.6") -+ runtimeOnly("org.xerial:sqlite-jdbc:3.45.3.0") -+ runtimeOnly("com.mysql:mysql-connector-j:8.3.0") ++ runtimeOnly("org.xerial:sqlite-jdbc:3.46.0.0") ++ runtimeOnly("com.mysql:mysql-connector-j:8.4.0") + + runtimeOnly("org.apache.maven:maven-resolver-provider:3.9.6") + runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18") @@ -61,7 +61,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +} + +paperweight { -+ craftBukkitPackageVersion.set("v1_20_R4") // also needs to be updated in MappingEnvironment ++ craftBukkitPackageVersion.set("v1_21_R1") // also needs to be updated in MappingEnvironment +} + +tasks.jar { @@ -170,7 +170,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - org.spigotmc - spigot - jar -- 1.20.6-R0.1-SNAPSHOT +- 1.21-R0.1-SNAPSHOT - Spigot - https://www.spigotmc.org/ - @@ -186,7 +186,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - UTF-8 - unknown - git -- 1_20_R4 +- 1_21_R1 - 21 - - @@ -251,7 +251,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - - com.mojang - datafixerupper -- 7.0.14 +- 8.0.16 - compile - - @@ -405,13 +405,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - - org.xerial - sqlite-jdbc -- 3.45.3.0 +- 3.46.0.0 - runtime - - - com.mysql - mysql-connector-j -- 8.3.0 +- 8.4.0 - runtime - - diff --git a/patches/unapplied/server/Support-components-in-ItemMeta.patch b/patches/server/Support-components-in-ItemMeta.patch similarity index 100% rename from patches/unapplied/server/Support-components-in-ItemMeta.patch rename to patches/server/Support-components-in-ItemMeta.patch diff --git a/patches/unapplied/server/Test-changes.patch b/patches/server/Test-changes.patch similarity index 100% rename from patches/unapplied/server/Test-changes.patch rename to patches/server/Test-changes.patch diff --git a/patches/unapplied/server/Timings-v2.patch b/patches/server/Timings-v2.patch similarity index 99% rename from patches/unapplied/server/Timings-v2.patch rename to patches/server/Timings-v2.patch index f61a23f95d..5ce5e577e6 100644 --- a/patches/unapplied/server/Timings-v2.patch +++ b/patches/server/Timings-v2.patch @@ -724,7 +724,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 -import org.bukkit.craftbukkit.SpigotTimings; // Spigot +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 { @@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop -Date: Thu, 3 Mar 2016 02:46:17 -0600 -Subject: [PATCH] Add configurable portal search radius - - -diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/entity/Entity.java -+++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess - 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 Vec3(blockposition.getX(), blockposition.getY(), blockposition.getZ()), PlayerTeleportEvent.TeleportCause.NETHER_PORTAL, flag2 ? 16 : 128, 16); -+ // Paper start - Configurable portal search radius -+ int portalSearchRadius = destination.paperConfig().environment.portalSearchRadius; -+ if (level.paperConfig().environment.portalSearchVanillaDimensionScaling && flag2) { // == THE_NETHER -+ portalSearchRadius = (int) (portalSearchRadius / destination.dimensionType().coordinateScale()); -+ } -+ // Paper end - Configurable portal search 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/src/main/java/net/minecraft/world/level/portal/PortalForcer.java b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java -+++ b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java -@@ -0,0 +0,0 @@ public class PortalForcer { - - public Optional findPortalAround(BlockPos pos, boolean destIsNether, WorldBorder worldBorder) { - // CraftBukkit start -- return this.findPortalAround(pos, worldBorder, destIsNether ? 16 : 128); // Search Radius -+ return this.findPortalAround(pos, worldBorder, destIsNether ? level.paperConfig().environment.portalCreateRadius : level.paperConfig().environment.portalSearchRadius); // Search Radius // Paper - Configurable portal search radius - } - - public Optional findPortalAround(BlockPos blockposition, WorldBorder worldborder, int i) { diff --git a/patches/unapplied/server/Configurable-end-credits.patch b/patches/unapplied/server/Configurable-end-credits.patch deleted file mode 100644 index 2c6555c73d..0000000000 --- a/patches/unapplied/server/Configurable-end-credits.patch +++ /dev/null @@ -1,18 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: DoctorDark -Date: Wed, 16 Mar 2016 02:21:39 -0500 -Subject: [PATCH] Configurable end credits - - -diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/server/level/ServerPlayer.java -+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -0,0 +0,0 @@ public class ServerPlayer extends Player { - this.unRide(); - this.serverLevel().removePlayerImmediately(this, Entity.RemovalReason.CHANGED_DIMENSION); - if (!this.wonGame) { -+ if (this.level().paperConfig().misc.disableEndCredits) this.seenCredits = true; // Paper - Option to disable end credits - this.wonGame = true; - this.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.WIN_GAME, this.seenCredits ? 0.0F : 1.0F)); - this.seenCredits = true; diff --git a/patches/unapplied/server/Configurable-inter-world-teleportation-safety.patch b/patches/unapplied/server/Configurable-inter-world-teleportation-safety.patch deleted file mode 100644 index 388370b1ab..0000000000 --- a/patches/unapplied/server/Configurable-inter-world-teleportation-safety.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Sudzzy -Date: Thu, 3 Mar 2016 02:50:31 -0600 -Subject: [PATCH] Configurable inter-world teleportation safety - -People are able to abuse the way Bukkit handles teleportation across worlds since it provides a built in teleportation -safety check. - -To abuse the safety check, players are required to get into a location deemed unsafe by Bukkit e.g. be within a chest -or door block. While they are in this block, they accept a teleport request from a player within a different world. Once -the player teleports, Minecraft will recursively search upwards for a safe location, this could eventually land within a -player's skybase. - -Example setup to perform the glitch: http://puu.sh/ng3PC/cf072dcbdb.png -The wanted destination was on top of the emerald block however the player ended on top of the diamond block. -This only is the case if the player is teleporting between worlds. - -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 -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { - entity.connection.teleport(to); - } else { - // The respawn reason should never be used if the passed location is non null. -- this.server.getHandle().respawn(entity, toWorld, true, to, true, null); -+ this.server.getHandle().respawn(entity, toWorld, true, to, !toWorld.paperConfig().environment.disableTeleportationSuffocationCheck, null); // Paper - } - return true; - }