diff --git a/patches/unapplied/api/Adventure.patch b/patches/api/Adventure.patch similarity index 100% rename from patches/unapplied/api/Adventure.patch rename to patches/api/Adventure.patch diff --git a/patches/unapplied/api/Player-affects-spawning-API.patch b/patches/api/Player-affects-spawning-API.patch similarity index 100% rename from patches/unapplied/api/Player-affects-spawning-API.patch rename to patches/api/Player-affects-spawning-API.patch diff --git a/patches/unapplied/server/Add-configurable-despawn-distances-for-living-entiti.patch b/patches/server/Add-configurable-despawn-distances-for-living-entiti.patch similarity index 99% rename from patches/unapplied/server/Add-configurable-despawn-distances-for-living-entiti.patch rename to patches/server/Add-configurable-despawn-distances-for-living-entiti.patch index 8a8c7d27d8..36ef8db931 100644 --- a/patches/unapplied/server/Add-configurable-despawn-distances-for-living-entiti.patch +++ b/patches/server/Add-configurable-despawn-distances-for-living-entiti.patch @@ -71,7 +71,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity { if (entityhuman != null) { - double d0 = entityhuman.distanceToSqr((Entity) this); // CraftBukkit - decompile error + double d0 = entityhuman.distanceToSqr((Entity) this); - int i = this.getType().getCategory().getDespawnDistance(); + int i = this.level.paperConfig.hardDespawnDistances.getInt(this.getType().getCategory()); // Paper - custom despawn distances int j = i * i; diff --git a/patches/unapplied/server/Add-version-history-to-version-command.patch b/patches/server/Add-version-history-to-version-command.patch similarity index 100% rename from patches/unapplied/server/Add-version-history-to-version-command.patch rename to patches/server/Add-version-history-to-version-command.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 64db649dbd..c80bea0814 100644 --- a/patches/unapplied/server/Adventure.patch +++ b/patches/server/Adventure.patch @@ -1036,9 +1036,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import it.unimi.dsi.fastutil.ints.IntArrayList; import it.unimi.dsi.fastutil.ints.IntList; +import io.papermc.paper.adventure.PaperAdventure; // Paper - import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; + import java.io.InputStream; @@ -0,0 +0,0 @@ public class FriendlyByteBuf extends ByteBuf { private static final int MAX_VARLONG_SIZE = 10; private static final int DEFAULT_NBT_QUOTA = 2097152; @@ -1247,8 +1247,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import net.minecraft.world.scores.criteria.ObjectiveCriteria; +import io.papermc.paper.adventure.PaperAdventure; // Paper import org.bukkit.Bukkit; - import org.bukkit.GameMode; import org.bukkit.Location; + import org.bukkit.WeatherType; @@ -0,0 +0,0 @@ public class ServerPlayer extends Player { // CraftBukkit start @@ -1290,7 +1290,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + if (deathMessage != null && deathMessage != net.kyori.adventure.text.Component.empty() && flag) { // Paper - Adventure // TODO: allow plugins to override? + Component ichatbasecomponent = PaperAdventure.asVanilla(deathMessage); // Paper - Adventure - this.connection.send((Packet) (new ClientboundPlayerCombatKillPacket(this.getCombatTracker(), ichatbasecomponent)), (future) -> { + this.connection.send(new ClientboundPlayerCombatKillPacket(this.getCombatTracker(), ichatbasecomponent), (future) -> { if (!future.isSuccess()) { @@ -0,0 +0,0 @@ public class ServerPlayer extends Player { } @@ -1299,7 +1299,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + public java.util.Locale adventure$locale = java.util.Locale.US; // Paper public void updateOptions(ServerboundClientInformationPacket packet) { // CraftBukkit start - if (getMainArm() != packet.getMainHand()) { + if (getMainArm() != packet.mainHand()) { @@ -0,0 +0,0 @@ public class ServerPlayer extends Player { this.server.server.getPluginManager().callEvent(event); } @@ -1310,7 +1310,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end this.clientViewDistance = packet.viewDistance; // CraftBukkit end - this.chatVisibility = packet.getChatVisibility(); + this.chatVisibility = packet.chatVisibility(); diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -1371,11 +1371,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 */ this.player.disconnect(); -- String quitMessage = this.server.getPlayerList().disconnect(this.player); +- String quitMessage = this.server.getPlayerList().remove(this.player); - if ((quitMessage != null) && (quitMessage.length() > 0)) { -- this.server.getPlayerList().sendMessage(CraftChatMessage.fromString(quitMessage)); +- this.server.getPlayerList().broadcastMessage(CraftChatMessage.fromString(quitMessage)); + // Paper start - Adventure -+ net.kyori.adventure.text.Component quitMessage = this.server.getPlayerList().disconnect(this.player); ++ net.kyori.adventure.text.Component quitMessage = this.server.getPlayerList().remove(this.player); + if ((quitMessage != null) && !quitMessage.equals(net.kyori.adventure.text.Component.empty())) { + this.server.getPlayerList().broadcastMessage(PaperAdventure.asVanilla(quitMessage), ChatType.SYSTEM, Util.NIL_UUID); + // Paper end @@ -1542,8 +1542,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } -- public String disconnect(ServerPlayer entityplayer) { // CraftBukkit - return string -+ public net.kyori.adventure.text.Component disconnect(ServerPlayer entityplayer) { // Paper - return Component +- public String remove(ServerPlayer entityplayer) { // CraftBukkit - return string ++ public net.kyori.adventure.text.Component remove(ServerPlayer entityplayer) { // Paper - return Component ServerLevel worldserver = entityplayer.getLevel(); entityplayer.awardStat(Stats.LEAVE_GAME); @@ -1585,7 +1585,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - event.disallow(PlayerLoginEvent.Result.KICK_BANNED, CraftChatMessage.fromComponent(chatmessage)); + event.disallow(PlayerLoginEvent.Result.KICK_BANNED, PaperAdventure.asAdventure(chatmessage)); // Paper - Adventure } else { - // return this.players.size() >= this.maxPlayers && !this.d(gameprofile) ? new ChatMessage("multiplayer.disconnect.server_full") : null; + // return this.players.size() >= this.maxPlayers && !this.canBypassPlayerLimit(gameprofile) ? new ChatMessage("multiplayer.disconnect.server_full") : null; if (this.players.size() >= this.maxPlayers && !this.canBypassPlayerLimit(gameprofile)) { - event.disallow(PlayerLoginEvent.Result.KICK_FULL, org.spigotmc.SpigotConfig.serverFullMessage); // Spigot + event.disallow(PlayerLoginEvent.Result.KICK_FULL, PaperAdventure.LEGACY_SECTION_UXRC.deserialize(org.spigotmc.SpigotConfig.serverFullMessage)); // Spigot // Paper - Adventure @@ -1706,8 +1706,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // CraftBukkit start +import io.papermc.paper.adventure.PaperAdventure; // Paper import java.util.UUID; - import org.bukkit.Bukkit; + import org.bukkit.craftbukkit.CraftServer; @@ -0,0 +0,0 @@ public class MapItemSavedData extends SavedData { for (org.bukkit.map.MapCursor cursor : render.cursors) { @@ -2542,7 +2542,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public int getPing() { return this.getHandle().latency; @@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { - getInventory().setItemInMainHand(hand); + return this.getHandle().allowsListing(); } + // Paper start @@ -2733,7 +2733,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + return this.adventure$pointers; + } + // Paper end -+ // Spigot start private final Player.Spigot spigot = new Player.Spigot() { diff --git a/patches/unapplied/server/Allow-for-toggling-of-spawn-chunks.patch b/patches/server/Allow-for-toggling-of-spawn-chunks.patch similarity index 100% rename from patches/unapplied/server/Allow-for-toggling-of-spawn-chunks.patch rename to patches/server/Allow-for-toggling-of-spawn-chunks.patch diff --git a/patches/unapplied/server/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch b/patches/server/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch similarity index 98% rename from patches/unapplied/server/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch rename to patches/server/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch index 3599ea2fda..d91dc3a6be 100644 --- a/patches/unapplied/server/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch +++ b/patches/server/Allow-nerfed-mobs-to-jump-and-take-water-damage.patch @@ -22,7 +22,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav 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 Nameable, EntityAccess, CommandSource, n +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i return this.isInWater() || this.isInRain(); } @@ -40,8 +40,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public GoalSelector goalSelector; + @Nullable public net.minecraft.world.entity.ai.goal.FloatGoal goalFloat; // Paper public GoalSelector targetSelector; + @Nullable private LivingEntity target; - private final Sensing sensing; @@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity { @Override protected final void serverAiStep() { diff --git a/patches/unapplied/server/Configurable-baby-zombie-movement-speed.patch b/patches/server/Configurable-baby-zombie-movement-speed.patch similarity index 100% rename from patches/unapplied/server/Configurable-baby-zombie-movement-speed.patch rename to patches/server/Configurable-baby-zombie-movement-speed.patch diff --git a/patches/unapplied/server/Configurable-cactus-bamboo-and-reed-growth-heights.patch b/patches/server/Configurable-cactus-bamboo-and-reed-growth-heights.patch similarity index 97% rename from patches/unapplied/server/Configurable-cactus-bamboo-and-reed-growth-heights.patch rename to patches/server/Configurable-cactus-bamboo-and-reed-growth-heights.patch index 846a0408e7..075227e7a2 100644 --- a/patches/unapplied/server/Configurable-cactus-bamboo-and-reed-growth-heights.patch +++ b/patches/server/Configurable-cactus-bamboo-and-reed-growth-heights.patch @@ -34,11 +34,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/world/level/block/BambooBlock.java @@ -0,0 +0,0 @@ public class BambooBlock extends Block implements BonemealableBlock { if (random.nextInt(Math.max(1, (int) (100.0F / world.spigotConfig.bambooModifier) * 3)) == 0 && world.isEmptyBlock(pos.above()) && world.getRawBrightness(pos.above(), 0) >= 9) { // Spigot - int i = this.getHeightBelowUpToMax((BlockGetter) world, pos) + 1; + int i = this.getHeightBelowUpToMax(world, pos) + 1; - if (i < 16) { + if (i < world.paperConfig.bambooMaxHeight) { // Paper - this.growBamboo(state, (Level) world, pos, random, i); + this.growBamboo(state, world, pos, random, i); } } @@ -0,0 +0,0 @@ public class BambooBlock extends Block implements BonemealableBlock { diff --git a/patches/unapplied/server/Configurable-fishing-time-ranges.patch b/patches/server/Configurable-fishing-time-ranges.patch similarity index 100% rename from patches/unapplied/server/Configurable-fishing-time-ranges.patch rename to patches/server/Configurable-fishing-time-ranges.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 100% 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 diff --git a/patches/unapplied/server/Implement-Paper-VersionChecker.patch b/patches/server/Implement-Paper-VersionChecker.patch similarity index 100% rename from patches/unapplied/server/Implement-Paper-VersionChecker.patch rename to patches/server/Implement-Paper-VersionChecker.patch diff --git a/patches/server/MC-Utils.patch b/patches/server/MC-Utils.patch index 01045e3849..37f48268c0 100644 --- a/patches/server/MC-Utils.patch +++ b/patches/server/MC-Utils.patch @@ -733,16 +733,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +import it.unimi.dsi.fastutil.longs.LongIterator; +import it.unimi.dsi.fastutil.shorts.Short2LongOpenHashMap; +import java.util.Arrays; ++import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.chunk.GlobalPalette; -+import net.minecraft.world.level.chunk.LevelChunkSection; + +/** + * @author Spottedleaf + */ +public final class IBlockDataList { + -+ static final GlobalPalette<BlockState> GLOBAL_PALETTE = (GlobalPalette) LevelChunkSection.GLOBAL_BLOCKSTATE_PALETTE; ++ static final GlobalPalette<BlockState> GLOBAL_PALETTE = new GlobalPalette<>(Block.BLOCK_STATE_REGISTRY); + + // map of location -> (index | (location << 16) | (palette id << 32)) + private final Short2LongOpenHashMap map = new Short2LongOpenHashMap(2, 0.8f); @@ -5382,6 +5382,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import net.minecraft.world.level.storage.LevelData; import net.minecraft.world.level.storage.LevelStorageSource; +import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; // Paper ++import java.util.function.Function; // Paper public class ServerChunkCache extends ChunkSource { + public static final org.apache.logging.log4j.Logger LOGGER = org.apache.logging.log4j.LogManager.getLogger(); // Paper 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 27d04871a1..afb3abe98c 100644 --- a/patches/unapplied/server/Player-affects-spawning-API.patch +++ b/patches/server/Player-affects-spawning-API.patch @@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/entity/EntitySelector.java +++ b/src/main/java/net/minecraft/world/entity/EntitySelector.java @@ -0,0 +0,0 @@ public final class EntitySelector { - }; + public static final Predicate<Entity> CAN_BE_COLLIDED_WITH = EntitySelector.NO_SPECTATORS.and(Entity::canBeCollidedWith); private EntitySelector() {} + // Paper start @@ -32,7 +32,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + Player entityhuman = this.level.findNearbyPlayer(this, -1.0D, EntitySelector.affectsSpawning); // Paper if (entityhuman != null) { - double d0 = entityhuman.distanceToSqr((Entity) this); // CraftBukkit - decompile error + double d0 = entityhuman.distanceToSqr((Entity) this); diff --git a/src/main/java/net/minecraft/world/entity/monster/Silverfish.java b/src/main/java/net/minecraft/world/entity/monster/Silverfish.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Silverfish.java diff --git a/patches/unapplied/server/Remove-invalid-mob-spawner-tile-entities.patch b/patches/server/Remove-invalid-mob-spawner-tile-entities.patch similarity index 53% rename from patches/unapplied/server/Remove-invalid-mob-spawner-tile-entities.patch rename to patches/server/Remove-invalid-mob-spawner-tile-entities.patch index a60db033f7..1b3331109a 100644 --- a/patches/unapplied/server/Remove-invalid-mob-spawner-tile-entities.patch +++ b/patches/server/Remove-invalid-mob-spawner-tile-entities.patch @@ -8,25 +8,13 @@ diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -@@ -0,0 +0,0 @@ import net.minecraft.world.level.TickList; - import net.minecraft.world.level.block.Block; - import net.minecraft.world.level.block.Blocks; - import net.minecraft.world.level.block.EntityBlock; -+import net.minecraft.world.level.block.SpawnerBlock; - import net.minecraft.world.level.block.entity.BlockEntity; - import net.minecraft.world.level.block.entity.BlockEntityTicker; - import net.minecraft.world.level.block.entity.BlockEntityType; - import net.minecraft.world.level.block.entity.TickingBlockEntity; -+import net.minecraft.world.level.block.entity.SpawnerBlockEntity; - import net.minecraft.world.level.block.state.BlockState; - import net.minecraft.world.level.gameevent.EuclideanGameEventDispatcher; - import net.minecraft.world.level.gameevent.GameEventDispatcher; -@@ -0,0 +0,0 @@ public class LevelChunk implements ChunkAccess { +@@ -0,0 +0,0 @@ public class LevelChunk extends ChunkAccess { } // CraftBukkit start + // Paper start - Remove invalid mob spawner tile entities -+ } else if (blockEntity instanceof SpawnerBlockEntity && !(getBlockState(blockposition).getBlock() instanceof SpawnerBlock)) { ++ } else if (blockEntity instanceof net.minecraft.world.level.block.entity.SpawnerBlockEntity ++ && !(getBlockState(blockposition).getBlock() instanceof net.minecraft.world.level.block.SpawnerBlock)) { + this.removeBlockEntity(blockEntity.getBlockPos()); + // Paper end } else { diff --git a/patches/unapplied/server/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch b/patches/server/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch similarity index 99% rename from patches/unapplied/server/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch rename to patches/server/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch index c201ad146d..bc6f962047 100644 --- a/patches/unapplied/server/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch +++ b/patches/server/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch @@ -49,7 +49,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -0,0 +0,0 @@ public class Main { - deadline.add(Calendar.DAY_OF_YEAR, -28); + deadline.add(Calendar.DAY_OF_YEAR, -7); 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/todo.txt b/todo.txt index 098ea2d921..324373e68e 100644 --- a/todo.txt +++ b/todo.txt @@ -1 +1,2 @@ Add Timings to LevelTicks and EntityTickList +Check IBlockDataList#GLOBAL_PALETTE