diff --git a/patches/api/Add-view-distance-API.patch b/patches/api/Add-view-distance-API.patch index 02b12e6cb2..ac83f6e87e 100644 --- a/patches/api/Add-view-distance-API.patch +++ b/patches/api/Add-view-distance-API.patch @@ -12,8 +12,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -0,0 +0,0 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient - int getSimulationDistance(); - // Spigot end + @NotNull + public Set getFeatureFlags(); + // Paper start - view distance api + /** @@ -71,9 +71,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + void setSendViewDistance(int viewDistance); + // Paper end - view distance api + - // Spigot start - public class Spigot { - + /** + * Represents various map environment types that a world may be + */ diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/entity/Player.java diff --git a/patches/api/Adventure.patch b/patches/api/Adventure.patch index 11a1296aa8..9d67c6eca5 100644 --- a/patches/api/Adventure.patch +++ b/patches/api/Adventure.patch @@ -3605,14 +3605,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java @@ -0,0 +0,0 @@ public class PlayerLoginEvent extends PlayerEvent { - private final InetAddress address; + private final InetAddress realAddress; private final String hostname; private Result result = Result.ALLOWED; - private String message = ""; + private net.kyori.adventure.text.Component message = net.kyori.adventure.text.Component.empty(); - private final InetAddress realAddress; // Spigot /** + * This constructor defaults message to an empty string, and result to @@ -0,0 +0,0 @@ public class PlayerLoginEvent extends PlayerEvent { * @param result The result status for this event * @param message The message to be displayed if result denies login @@ -3620,8 +3620,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * @deprecated in favour of {@link #PlayerLoginEvent(Player, String, InetAddress, Result, net.kyori.adventure.text.Component, InetAddress)} */ + @Deprecated // Paper - public PlayerLoginEvent(@NotNull final Player player, @NotNull String hostname, @NotNull final InetAddress address, @NotNull final Result result, @NotNull final String message, @NotNull final InetAddress realAddress) { // Spigot - this(player, hostname, address, realAddress); // Spigot + public PlayerLoginEvent(@NotNull final Player player, @NotNull String hostname, @NotNull final InetAddress address, @NotNull final Result result, @NotNull final String message, @NotNull final InetAddress realAddress) { + this(player, hostname, address, realAddress); this.result = result; + this.message = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(message); // Paper + } @@ -3638,12 +3638,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * @param message The message to be displayed if result denies login + * @param realAddress the actual, unspoofed connecting address + */ -+ public PlayerLoginEvent(@NotNull final Player player, @NotNull String hostname, @NotNull final InetAddress address, @NotNull final Result result, @NotNull final net.kyori.adventure.text.Component message, @NotNull final InetAddress realAddress) { // Spigot ++ public PlayerLoginEvent(@NotNull final Player player, @NotNull String hostname, @NotNull final InetAddress address, @NotNull final Result result, @NotNull final net.kyori.adventure.text.Component message, @NotNull final InetAddress realAddress) { + this(player, hostname, address, realAddress); // Spigot + this.result = result; -+ this.message = message; -+ } -+ + this.message = message; + } + + /** + * Gets the current kick message that will be used if getResult() != + * Result.ALLOWED @@ -3660,12 +3660,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * @param message New kick message + */ + public void kickMessage(net.kyori.adventure.text.@NotNull Component message) { - this.message = message; - } ++ this.message = message; ++ } + // Paper end - - // Spigot start ++ /** + * Gets the current result of the login, as an enum + * @@ -0,0 +0,0 @@ public class PlayerLoginEvent extends PlayerEvent { * Result.ALLOWED * diff --git a/patches/api/Fix-Spigot-annotation-mistakes.patch b/patches/api/Fix-Spigot-annotation-mistakes.patch index 5873f4e5a2..4a617a67bc 100644 --- a/patches/api/Fix-Spigot-annotation-mistakes.patch +++ b/patches/api/Fix-Spigot-annotation-mistakes.patch @@ -615,13 +615,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 /** @@ -0,0 +0,0 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient - // Paper end - view distance api + StructureSearchResult locateNearestStructure(@NotNull Location origin, @NotNull Structure structure, int radius, boolean findUnexplored); // Spigot start -+ /** -+ * @deprecated Unsupported api -+ */ -+ @Deprecated // Paper ++ @Deprecated(forRemoval = true) // Paper public class Spigot { /** diff --git a/patches/api/More-World-API.patch b/patches/api/More-World-API.patch index cce0f63f5c..228460e8a4 100644 --- a/patches/api/More-World-API.patch +++ b/patches/api/More-World-API.patch @@ -129,5 +129,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end + // Spigot start - /** - * Returns the view distance used for this world. + @Deprecated(forRemoval = true) // Paper + public class Spigot { diff --git a/patches/server/API-for-creating-command-sender-which-forwards-feedb.patch b/patches/server/API-for-creating-command-sender-which-forwards-feedb.patch index 26a1d28bf7..8e559cfdc1 100644 --- a/patches/server/API-for-creating-command-sender-which-forwards-feedb.patch +++ b/patches/server/API-for-creating-command-sender-which-forwards-feedb.patch @@ -143,23 +143,15 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/command/ServerCommandSender.ja index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/command/ServerCommandSender.java +++ b/src/main/java/org/bukkit/craftbukkit/command/ServerCommandSender.java -@@ -0,0 +0,0 @@ import org.bukkit.plugin.Plugin; +@@ -0,0 +0,0 @@ import org.bukkit.permissions.PermissionAttachmentInfo; + import org.bukkit.plugin.Plugin; public abstract class ServerCommandSender implements CommandSender { - private static PermissibleBase blockPermInst; - private final PermissibleBase perm; + public final PermissibleBase perm; // Paper private net.kyori.adventure.pointer.Pointers adventure$pointers; // Paper - implement pointers -+ // Paper start -+ public ServerCommandSender(final PermissibleBase permissibleBase) { -+ this.perm = permissibleBase; -+ } -+ // Paper end -+ - public ServerCommandSender() { - if (this instanceof CraftBlockCommandSender) { - if (ServerCommandSender.blockPermInst == null) { + protected ServerCommandSender() { diff --git a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java diff --git a/patches/server/Add-StructuresLocateEvent.patch b/patches/server/Add-StructuresLocateEvent.patch index fb5f6e8b31..276f811916 100644 --- a/patches/server/Add-StructuresLocateEvent.patch +++ b/patches/server/Add-StructuresLocateEvent.patch @@ -57,7 +57,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper start - StructuresLocateEvent + final org.bukkit.World bukkitWorld = world.getWorld(); + final org.bukkit.Location origin = io.papermc.paper.util.MCUtil.toLocation(world, center); -+ final List apiStructures = structures.stream().map(Holder::value).map(nms -> org.bukkit.craftbukkit.generator.structure.CraftStructure.minecraftToBukkit(nms, world.registryAccess())).toList(); ++ final List apiStructures = structures.stream().map(Holder::value).map(nms -> org.bukkit.craftbukkit.generator.structure.CraftStructure.minecraftToBukkit(nms)).toList(); + if (!apiStructures.isEmpty()) { + final io.papermc.paper.event.world.StructuresLocateEvent event = new io.papermc.paper.event.world.StructuresLocateEvent(bukkitWorld, origin, apiStructures, radius, skipReferencedStructures); + if (!event.callEvent()) { diff --git a/patches/server/Adventure.patch b/patches/server/Adventure.patch index 1988ae368d..5a0e291445 100644 --- a/patches/server/Adventure.patch +++ b/patches/server/Adventure.patch @@ -3854,7 +3854,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + @Override public boolean isOp() { - return true; + return CraftBlockCommandSender.SHARED_PERM.isOp(); diff --git a/src/main/java/org/bukkit/craftbukkit/command/CraftConsoleCommandSender.java b/src/main/java/org/bukkit/craftbukkit/command/CraftConsoleCommandSender.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/command/CraftConsoleCommandSender.java @@ -3926,13 +3926,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/command/ServerCommandSender.java +++ b/src/main/java/org/bukkit/craftbukkit/command/ServerCommandSender.java @@ -0,0 +0,0 @@ import org.bukkit.plugin.Plugin; + public abstract class ServerCommandSender implements CommandSender { - private static PermissibleBase blockPermInst; private final PermissibleBase perm; + private net.kyori.adventure.pointer.Pointers adventure$pointers; // Paper - implement pointers - public ServerCommandSender() { - if (this instanceof CraftBlockCommandSender) { + protected ServerCommandSender() { + this.perm = new PermissibleBase(this); @@ -0,0 +0,0 @@ public abstract class ServerCommandSender implements CommandSender { return this.spigot; } diff --git a/patches/server/Disable-spigot-tick-limiters.patch b/patches/server/Disable-spigot-tick-limiters.patch index 2a7549b796..85e738f21d 100644 --- a/patches/server/Disable-spigot-tick-limiters.patch +++ b/patches/server/Disable-spigot-tick-limiters.patch @@ -18,4 +18,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + for (tileTickPosition = 0; tileTickPosition < this.blockEntityTickers.size(); tileTickPosition++) { // Paper - Disable tick limiters this.tileTickPosition = (this.tileTickPosition < this.blockEntityTickers.size()) ? this.tileTickPosition : 0; TickingBlockEntity tickingblockentity = (TickingBlockEntity) this.blockEntityTickers.get(this.tileTickPosition); - // Spigot start + // Spigot end diff --git a/patches/server/ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch b/patches/server/ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch index 0255ae8227..9d81bf05b2 100644 --- a/patches/server/ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch +++ b/patches/server/ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch @@ -331,7 +331,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return item; })); register(new EntityTypeData<>(EntityType.EXPERIENCE_ORB, ExperienceOrb.class, CraftExperienceOrb::new, -- spawnData -> new net.minecraft.world.entity.ExperienceOrb(spawnData.minecraftWorld(), spawnData.x(), spawnData.z(), spawnData.z(), 0) +- spawnData -> new net.minecraft.world.entity.ExperienceOrb(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), 0) + spawnData -> new net.minecraft.world.entity.ExperienceOrb(spawnData.minecraftWorld(), spawnData.x(), spawnData.z(), spawnData.z(), 0, org.bukkit.entity.ExperienceOrb.SpawnReason.CUSTOM, null, null) // Paper )); register(new EntityTypeData<>(EntityType.AREA_EFFECT_CLOUD, AreaEffectCloud.class, CraftAreaEffectCloud::new, spawnData -> new net.minecraft.world.entity.AreaEffectCloud(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z()))); diff --git a/patches/server/Fix-MC-117075-TE-Unload-Lag-Spike.patch b/patches/server/Fix-MC-117075-TE-Unload-Lag-Spike.patch index a00ffacf80..863c961174 100644 --- a/patches/server/Fix-MC-117075-TE-Unload-Lag-Spike.patch +++ b/patches/server/Fix-MC-117075-TE-Unload-Lag-Spike.patch @@ -17,14 +17,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 for (tileTickPosition = 0; tileTickPosition < this.blockEntityTickers.size(); tileTickPosition++) { // Paper - Disable tick limiters this.tileTickPosition = (this.tileTickPosition < this.blockEntityTickers.size()) ? this.tileTickPosition : 0; TickingBlockEntity tickingblockentity = (TickingBlockEntity) this.blockEntityTickers.get(this.tileTickPosition); -@@ -0,0 +0,0 @@ public abstract class Level implements LevelAccessor, AutoCloseable { - if (tickingblockentity == null) { - this.getCraftServer().getLogger().severe("Spigot has detected a null entity and has removed it, preventing a crash"); - tilesThisCycle--; -- this.blockEntityTickers.remove(this.tileTickPosition--); - continue; - } - // Spigot end @@ -0,0 +0,0 @@ public abstract class Level implements LevelAccessor, AutoCloseable { if (tickingblockentity.isRemoved()) { // Spigot start diff --git a/patches/server/Fix-hex-colors-not-working-in-some-kick-messages.patch b/patches/server/Fix-hex-colors-not-working-in-some-kick-messages.patch index 8a08d3233a..d2865ebf88 100644 --- a/patches/server/Fix-hex-colors-not-working-in-some-kick-messages.patch +++ b/patches/server/Fix-hex-colors-not-working-in-some-kick-messages.patch @@ -15,7 +15,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - MutableComponent ichatmutablecomponent; + Component ichatmutablecomponent; // Paper - Fix hex colors not working in some kick messages - if (packet.protocolVersion() < 754) { + if (packet.protocolVersion() < SharedConstants.getCurrentVersion().getProtocolVersion()) { // Spigot - SPIGOT-7546: Handle version check correctly for outdated client message - ichatmutablecomponent = Component.literal( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedClientMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) ); // Spigot + ichatmutablecomponent = org.bukkit.craftbukkit.util.CraftChatMessage.fromString( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedClientMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) )[0]; // Spigot // Paper - Fix hex colors not working in some kick messages } else { diff --git a/patches/server/Fix-incorrect-message-for-outdated-client.patch b/patches/server/Fix-incorrect-message-for-outdated-client.patch deleted file mode 100644 index 4fd022e490..0000000000 --- a/patches/server/Fix-incorrect-message-for-outdated-client.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: sulu5890 -Date: Sun, 11 Jul 2021 19:34:03 -0500 -Subject: [PATCH] Fix incorrect message for outdated client - - -diff --git a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java -+++ b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java -@@ -0,0 +0,0 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL - if (packet.protocolVersion() != SharedConstants.getCurrentVersion().getProtocolVersion()) { - Component ichatmutablecomponent; // Paper - Fix hex colors not working in some kick messages - -- if (packet.protocolVersion() < 754) { -+ if (packet.protocolVersion() < SharedConstants.getCurrentVersion().getProtocolVersion()) { // Paper - Fix incorrect message for outdated clients - ichatmutablecomponent = org.bukkit.craftbukkit.util.CraftChatMessage.fromString( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedClientMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) )[0]; // Spigot // Paper - Fix hex colors not working in some kick messages - } else { - ichatmutablecomponent = org.bukkit.craftbukkit.util.CraftChatMessage.fromString( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedServerMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) )[0]; // Spigot // Paper - Fix hex colors not working in some kick messages diff --git a/patches/server/Handle-Item-Meta-Inconsistencies.patch b/patches/server/Handle-Item-Meta-Inconsistencies.patch index 61423090a5..61456225bd 100644 --- a/patches/server/Handle-Item-Meta-Inconsistencies.patch +++ b/patches/server/Handle-Item-Meta-Inconsistencies.patch @@ -216,7 +216,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { this.blockData = meta.blockData; - if (meta.enchantments != null) { // Spigot + if (meta.enchantments != null) { - this.enchantments = new LinkedHashMap(meta.enchantments); + this.enchantments = new EnchantmentMap(meta.enchantments); // Paper } diff --git a/patches/server/MC-Utils.patch b/patches/server/MC-Utils.patch index 5a695142c9..a53b3cbac1 100644 --- a/patches/server/MC-Utils.patch +++ b/patches/server/MC-Utils.patch @@ -6636,7 +6636,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public abstract class DistanceManager { final Executor mainThreadExecutor; private long ticketTickCounter; - private int simulationDistance = 10; + public int simulationDistance = 10; + private final ChunkMap chunkMap; // Paper - protected DistanceManager(Executor workerExecutor, Executor mainThreadExecutor) { diff --git a/patches/server/More-World-API.patch b/patches/server/More-World-API.patch index 6c0dbcc167..ac256f0eef 100644 --- a/patches/server/More-World-API.patch +++ b/patches/server/More-World-API.patch @@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -0,0 +0,0 @@ public class CraftWorld extends CraftRegionAccessor implements World { - return new CraftStructureSearchResult(CraftStructure.minecraftToBukkit(found.getSecond().value(), this.getHandle().registryAccess()), CraftLocation.toBukkit(found.getFirst(), this)); + return new CraftStructureSearchResult(CraftStructure.minecraftToBukkit(found.getSecond().value()), CraftLocation.toBukkit(found.getFirst(), this)); } + // Paper start diff --git a/patches/server/Respect-randomizeData-on-more-entities-when-spawning.patch b/patches/server/Respect-randomizeData-on-more-entities-when-spawning.patch index 7f6d103858..d7c05fcaa0 100644 --- a/patches/server/Respect-randomizeData-on-more-entities-when-spawning.patch +++ b/patches/server/Respect-randomizeData-on-more-entities-when-spawning.patch @@ -28,7 +28,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public final class CraftEntityTypes { net.minecraft.world.item.ItemStack itemStack = new net.minecraft.world.item.ItemStack(Items.STONE); - ItemEntity item = new ItemEntity(spawnData.minecraftWorld(), spawnData.x(), spawnData.z(), spawnData.z(), itemStack); + ItemEntity item = new ItemEntity(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), itemStack); item.setPickUpDelay(10); + CLEAR_MOVE_IF_NOT_RANDOMIZED.accept(spawnData, item); // Paper - respect randomizeData diff --git a/patches/server/Rewrite-chunk-system.patch b/patches/server/Rewrite-chunk-system.patch index 0e70321cd0..d97f57bcb1 100644 --- a/patches/server/Rewrite-chunk-system.patch +++ b/patches/server/Rewrite-chunk-system.patch @@ -17555,7 +17555,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public final Int2ObjectMap entityMap; @@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider private final Queue unloadQueue; - private int serverViewDistance; + public int serverViewDistance; - // CraftBukkit start - recursion-safe executor for Chunk loadCallback() and unloadCallback() - public final CallbackExecutor callbackExecutor = new CallbackExecutor(); @@ -17577,10 +17577,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - } - }; - // CraftBukkit end -+ // Paper - rewrite chunk system - +- // Paper start - distance maps private final com.destroystokyo.paper.util.misc.PooledLinkedHashSets pooledLinkedPlayerHashSets = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets<>(); + @@ -0,0 +0,0 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider int chunkZ = io.papermc.paper.util.MCUtil.getChunkCoordinate(player.getZ()); // Note: players need to be explicitly added to distance maps before they can be updated @@ -18672,7 +18672,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - final LongSet ticketsToRelease = new LongOpenHashSet(); - final Executor mainThreadExecutor; - private long ticketTickCounter; -- private int simulationDistance = 10; +- public int simulationDistance = 10; + // Paper - rewrite chunk system private final ChunkMap chunkMap; // Paper @@ -18719,8 +18719,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - + this.getChunkHolderManager().tick(); // Paper - rewrite chunk system } - +- private static int getTicketLevelAt(SortedArraySet> tickets) { + return !tickets.isEmpty() ? ((Ticket) tickets.first()).getTicketLevel() : ChunkLevel.MAX_LEVEL + 1; + } @@ -0,0 +0,0 @@ public abstract class DistanceManager { protected abstract ChunkHolder updateChunkScheduling(long pos, int level, @Nullable ChunkHolder holder, int k); @@ -18999,8 +19001,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - } catch (Throwable throwable1) { - throwable.addSuppressed(throwable1); - } -+ // Paper - rewrite chunk system - +- - throw throwable; - } - @@ -19010,7 +19011,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - } - - } -- ++ // Paper - rewrite chunk system + - @VisibleForTesting - TickingTracker tickingTracker() { - return this.tickingTicketsTracker; @@ -22755,19 +22757,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 SortedArraySet> tickets = chunkTickets.getValue(); @@ -0,0 +0,0 @@ public class CraftWorld extends CraftRegionAccessor implements World { - // Spigot start + @Override public int getViewDistance() { -- return this.world.spigotConfig.viewDistance; +- return this.world.getChunkSource().chunkMap.serverViewDistance; + return this.getHandle().playerChunkLoader.getAPIViewDistance(); // Paper - replace player chunk loader } @Override public int getSimulationDistance() { -- return this.world.spigotConfig.simulationDistance; +- return this.world.getChunkSource().chunkMap.getDistanceManager().simulationDistance; + return this.getHandle().playerChunkLoader.getAPITickDistance(); // Paper - replace player chunk loader - } - // Spigot end ++ } + // Paper start - view distance api + @Override + public void setViewDistance(int viewDistance) { @@ -22805,11 +22806,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + @Override + public void setSendViewDistance(int viewDistance) { + this.getHandle().chunkSource.chunkMap.setSendViewDistance(viewDistance); // Paper - replace player chunk loader -+ } + } + // Paper end - view distance api - // Spigot start - private final org.bukkit.World.Spigot spigot = new org.bukkit.World.Spigot() + public BlockMetadataStore getBlockMetadata() { + return this.blockMetadata; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/patches/server/hotfix-spawning-item-xp-in-wrong-spot.patch b/patches/server/hotfix-spawning-item-xp-in-wrong-spot.patch index b13bc5cabf..310e0c66d7 100644 --- a/patches/server/hotfix-spawning-item-xp-in-wrong-spot.patch +++ b/patches/server/hotfix-spawning-item-xp-in-wrong-spot.patch @@ -9,14 +9,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java @@ -0,0 +0,0 @@ public final class CraftEntityTypes { - // We use stone instead of empty, to give the plugin developer a visual clue, that the spawn method is working, - // and that the item stack should probably be changed. - net.minecraft.world.item.ItemStack itemStack = new net.minecraft.world.item.ItemStack(Items.STONE); -- ItemEntity item = new ItemEntity(spawnData.minecraftWorld(), spawnData.x(), spawnData.z(), spawnData.z(), itemStack); -+ ItemEntity item = new ItemEntity(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), itemStack); - item.setPickUpDelay(10); - CLEAR_MOVE_IF_NOT_RANDOMIZED.accept(spawnData, item); // Paper - respect randomizeData - return item; })); register(new EntityTypeData<>(EntityType.EXPERIENCE_ORB, ExperienceOrb.class, CraftExperienceOrb::new, diff --git a/work/Bukkit b/work/Bukkit index f29cb80158..cc9aa21a28 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit f29cb8015897da1bca0c93522c5884c4c9f93601 +Subproject commit cc9aa21a289b9a7d361c4a8f99b56d5300f40d4c diff --git a/work/CraftBukkit b/work/CraftBukkit index b3b43a6ad2..bcf56171a6 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit b3b43a6ad21c9f7fc2dd0a1e7e94abae0057770d +Subproject commit bcf56171a63d24b21bea341e8f5b3c5234f077c3 diff --git a/work/Spigot b/work/Spigot index 06d602e7c3..ed9ba9a42d 160000 --- a/work/Spigot +++ b/work/Spigot @@ -1 +1 @@ -Subproject commit 06d602e7c3165ebf32f7419cb5873ec82d54ff7c +Subproject commit ed9ba9a42d6c6aca02c474aed4207b7b4fd6f5d6