diff --git a/patches/unapplied/server/Add-API-for-quit-reason.patch b/patches/server/Add-API-for-quit-reason.patch similarity index 100% rename from patches/unapplied/server/Add-API-for-quit-reason.patch rename to patches/server/Add-API-for-quit-reason.patch diff --git a/patches/unapplied/server/Add-API-for-resetting-a-single-score.patch b/patches/server/Add-API-for-resetting-a-single-score.patch similarity index 100% rename from patches/unapplied/server/Add-API-for-resetting-a-single-score.patch rename to patches/server/Add-API-for-resetting-a-single-score.patch diff --git a/patches/unapplied/server/Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch b/patches/server/Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch similarity index 100% rename from patches/unapplied/server/Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch rename to patches/server/Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch diff --git a/patches/unapplied/server/Add-BellRevealRaiderEvent.patch b/patches/server/Add-BellRevealRaiderEvent.patch similarity index 100% rename from patches/unapplied/server/Add-BellRevealRaiderEvent.patch rename to patches/server/Add-BellRevealRaiderEvent.patch diff --git a/patches/unapplied/server/Add-BellRingEvent.patch b/patches/server/Add-BellRingEvent.patch similarity index 100% rename from patches/unapplied/server/Add-BellRingEvent.patch rename to patches/server/Add-BellRingEvent.patch diff --git a/patches/unapplied/server/Add-Block-isValidTool.patch b/patches/server/Add-Block-isValidTool.patch similarity index 100% rename from patches/unapplied/server/Add-Block-isValidTool.patch rename to patches/server/Add-Block-isValidTool.patch diff --git a/patches/unapplied/server/Add-BlockBreakBlockEvent.patch b/patches/server/Add-BlockBreakBlockEvent.patch similarity index 99% rename from patches/unapplied/server/Add-BlockBreakBlockEvent.patch rename to patches/server/Add-BlockBreakBlockEvent.patch index 4b5f50938b..ed4f673f11 100644 --- a/patches/unapplied/server/Add-BlockBreakBlockEvent.patch +++ b/patches/server/Add-BlockBreakBlockEvent.patch @@ -30,7 +30,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + // Paper end - public static void dropResources(BlockState state, Level world, BlockPos pos, @Nullable BlockEntity blockEntity, Entity entity, ItemStack stack) { + public static void dropResources(BlockState state, Level world, BlockPos pos, @Nullable BlockEntity blockEntity, Entity entity, ItemStack tool) { if (world instanceof ServerLevel) { diff --git a/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java b/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 diff --git a/patches/unapplied/server/Add-Channel-initialization-listeners.patch b/patches/server/Add-Channel-initialization-listeners.patch similarity index 97% rename from patches/unapplied/server/Add-Channel-initialization-listeners.patch rename to patches/server/Add-Channel-initialization-listeners.patch index de3ba70fc1..f50a3bd4ef 100644 --- a/patches/unapplied/server/Add-Channel-initialization-listeners.patch +++ b/patches/server/Add-Channel-initialization-listeners.patch @@ -146,8 +146,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java +++ b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java @@ -0,0 +0,0 @@ public class ServerConnectionListener { - pending.add((Connection) object); // Paper - channel.pipeline().addLast("packet_handler", (ChannelHandler) object); + pending.add(object); // Paper + channelpipeline.addLast("packet_handler", (ChannelHandler) object); ((Connection) object).setListener(new ServerHandshakePacketListenerImpl(ServerConnectionListener.this.server, (Connection) object)); + io.papermc.paper.network.ChannelInitializeListenerHolder.callListeners(channel); // Paper } diff --git a/patches/unapplied/server/Add-Destroy-Speed-API.patch b/patches/server/Add-Destroy-Speed-API.patch similarity index 100% rename from patches/unapplied/server/Add-Destroy-Speed-API.patch rename to patches/server/Add-Destroy-Speed-API.patch diff --git a/patches/unapplied/server/Add-ElderGuardianAppearanceEvent.patch b/patches/server/Add-ElderGuardianAppearanceEvent.patch similarity index 97% rename from patches/unapplied/server/Add-ElderGuardianAppearanceEvent.patch rename to patches/server/Add-ElderGuardianAppearanceEvent.patch index 49da3cb208..42cecfda15 100644 --- a/patches/unapplied/server/Add-ElderGuardianAppearanceEvent.patch +++ b/patches/server/Add-ElderGuardianAppearanceEvent.patch @@ -21,9 +21,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // CraftBukkit end MobEffect mobeffectlist = mobeffect.getEffect(); List list = worldserver.getPlayers((entityplayer) -> { -- return entityplayer.gameMode.isSurvival() && (entity == null || !entity.isAlliedTo((Entity) entityplayer)) && vec3d.closerThan(entityplayer.position(), d0) && (!entityplayer.hasEffect(mobeffectlist) || entityplayer.getEffect(mobeffectlist).getAmplifier() < mobeffect.getAmplifier() || entityplayer.getEffect(mobeffectlist).getDuration() < i); +- return entityplayer.gameMode.isSurvival() && (entity == null || !entity.isAlliedTo((Entity) entityplayer)) && vec3d.closerThan(entityplayer.position(), d0) && (!entityplayer.hasEffect(mobeffectlist) || entityplayer.getEffect(mobeffectlist).getAmplifier() < mobeffect.getAmplifier() || entityplayer.getEffect(mobeffectlist).endsWithin(i - 1)); + // Paper start -+ boolean condition = entityplayer.gameMode.isSurvival() && (entity == null || !entity.isAlliedTo((Entity) entityplayer)) && vec3d.closerThan(entityplayer.position(), d0) && (!entityplayer.hasEffect(mobeffectlist) || entityplayer.getEffect(mobeffectlist).getAmplifier() < mobeffect.getAmplifier() || entityplayer.getEffect(mobeffectlist).getDuration() < i); ++ boolean condition = entityplayer.gameMode.isSurvival() && (entity == null || !entity.isAlliedTo((Entity) entityplayer)) && vec3d.closerThan(entityplayer.position(), d0) && (!entityplayer.hasEffect(mobeffectlist) || entityplayer.getEffect(mobeffectlist).getAmplifier() < mobeffect.getAmplifier() || entityplayer.getEffect(mobeffectlist).endsWithin(i - 1)); + if (condition) { + return playerPredicate == null || playerPredicate.test(entityplayer); // Only test the player AFTER it is true + } else { diff --git a/patches/unapplied/server/Add-EntityBlockStorage-clearEntities.patch b/patches/server/Add-EntityBlockStorage-clearEntities.patch similarity index 100% rename from patches/unapplied/server/Add-EntityBlockStorage-clearEntities.patch rename to patches/server/Add-EntityBlockStorage-clearEntities.patch diff --git a/patches/unapplied/server/Add-EntityInsideBlockEvent.patch b/patches/server/Add-EntityInsideBlockEvent.patch similarity index 97% rename from patches/unapplied/server/Add-EntityInsideBlockEvent.patch rename to patches/server/Add-EntityInsideBlockEvent.patch index 6288d54700..972cd7bec8 100644 --- a/patches/unapplied/server/Add-EntityInsideBlockEvent.patch +++ b/patches/server/Add-EntityInsideBlockEvent.patch @@ -74,7 +74,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) { + if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper CraftEventFactory.blockDamage = world.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ()); // CraftBukkit - entity.hurt(DamageSource.CACTUS, 1.0F); + entity.hurt(world.damageSources().cactus(), 1.0F); CraftEventFactory.blockDamage = null; // CraftBukkit diff --git a/src/main/java/net/minecraft/world/level/block/CampfireBlock.java b/src/main/java/net/minecraft/world/level/block/CampfireBlock.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 @@ -87,7 +87,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper if ((Boolean) state.getValue(CampfireBlock.LIT) && entity instanceof LivingEntity && !EnchantmentHelper.hasFrostWalker((LivingEntity) entity)) { org.bukkit.craftbukkit.event.CraftEventFactory.blockDamage = CraftBlock.at(world, pos); // CraftBukkit - entity.hurt(DamageSource.IN_FIRE, (float) this.fireDamage); + entity.hurt(world.damageSources().inFire(), (float) this.fireDamage); diff --git a/src/main/java/net/minecraft/world/level/block/CropBlock.java b/src/main/java/net/minecraft/world/level/block/CropBlock.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/block/CropBlock.java @@ -121,7 +121,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) { + if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper - if (world instanceof ServerLevel && !entity.isPassenger() && !entity.isVehicle() && entity.canChangeDimensions() && Shapes.joinIsNotEmpty(Shapes.create(entity.getBoundingBox().move((double) (-pos.getX()), (double) (-pos.getY()), (double) (-pos.getZ()))), state.getShape(world, pos), BooleanOp.AND)) { + if (world instanceof ServerLevel && entity.canChangeDimensions() && Shapes.joinIsNotEmpty(Shapes.create(entity.getBoundingBox().move((double) (-pos.getX()), (double) (-pos.getY()), (double) (-pos.getZ()))), state.getShape(world, pos), BooleanOp.AND)) { ResourceKey resourcekey = world.getTypeKey() == LevelStem.END ? Level.OVERWORLD : Level.END; // CraftBukkit - SPIGOT-6152: send back to main overworld in custom ends ServerLevel worldserver = ((ServerLevel) world).getServer().getLevel(resourcekey); diff --git a/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java b/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java @@ -193,7 +193,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) { + if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper - if (!entity.isPassenger() && !entity.isVehicle() && entity.canChangeDimensions()) { + if (entity.canChangeDimensions()) { // CraftBukkit start - Entity in portal EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), pos.getX(), pos.getY(), pos.getZ())); diff --git a/src/main/java/net/minecraft/world/level/block/PowderSnowBlock.java b/src/main/java/net/minecraft/world/level/block/PowderSnowBlock.java diff --git a/patches/unapplied/server/Add-EntityLoadCrossbowEvent.patch b/patches/server/Add-EntityLoadCrossbowEvent.patch similarity index 100% rename from patches/unapplied/server/Add-EntityLoadCrossbowEvent.patch rename to patches/server/Add-EntityLoadCrossbowEvent.patch diff --git a/patches/unapplied/server/Add-ItemFactory-getSpawnEgg-API.patch b/patches/server/Add-ItemFactory-getSpawnEgg-API.patch similarity index 100% rename from patches/unapplied/server/Add-ItemFactory-getSpawnEgg-API.patch rename to patches/server/Add-ItemFactory-getSpawnEgg-API.patch diff --git a/patches/unapplied/server/Add-LivingEntity-clearActiveItem.patch b/patches/server/Add-LivingEntity-clearActiveItem.patch similarity index 100% rename from patches/unapplied/server/Add-LivingEntity-clearActiveItem.patch rename to patches/server/Add-LivingEntity-clearActiveItem.patch diff --git a/patches/unapplied/server/Add-Mob-lookAt-API.patch b/patches/server/Add-Mob-lookAt-API.patch similarity index 100% rename from patches/unapplied/server/Add-Mob-lookAt-API.patch rename to patches/server/Add-Mob-lookAt-API.patch diff --git a/patches/unapplied/server/Add-OBSTRUCTED-reason-to-BedEnterResult.patch b/patches/server/Add-OBSTRUCTED-reason-to-BedEnterResult.patch similarity index 100% rename from patches/unapplied/server/Add-OBSTRUCTED-reason-to-BedEnterResult.patch rename to patches/server/Add-OBSTRUCTED-reason-to-BedEnterResult.patch diff --git a/patches/unapplied/server/Add-PlayerItemCooldownEvent.patch b/patches/server/Add-PlayerItemCooldownEvent.patch similarity index 100% rename from patches/unapplied/server/Add-PlayerItemCooldownEvent.patch rename to patches/server/Add-PlayerItemCooldownEvent.patch diff --git a/patches/unapplied/server/Add-PlayerKickEvent-causes.patch b/patches/server/Add-PlayerKickEvent-causes.patch similarity index 99% rename from patches/unapplied/server/Add-PlayerKickEvent-causes.patch rename to patches/server/Add-PlayerKickEvent-causes.patch index c732a05caf..5f617fe18c 100644 --- a/patches/unapplied/server/Add-PlayerKickEvent-causes.patch +++ b/patches/server/Add-PlayerKickEvent-causes.patch @@ -92,7 +92,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - if (this.clientIsFloating && !this.player.isSleeping() && !this.player.isPassenger()) { + if (this.clientIsFloating && !this.player.isSleeping() && !this.player.isPassenger() && !this.player.isDeadOrDying()) { if (++this.aboveGroundTickCount > 80) { ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked for floating too long!", this.player.getName().getString()); - this.disconnect(io.papermc.paper.configuration.GlobalConfiguration.get().messages.kick.flyingPlayer); // Paper - use configurable kick message @@ -314,8 +314,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - this.disconnect(Component.translatable("multiplayer.disconnect.out_of_order_chat")); + this.disconnect(Component.translatable("multiplayer.disconnect.out_of_order_chat"), org.bukkit.event.player.PlayerKickEvent.Cause.OUT_OF_ORDER_CHAT); // Paper - kick event ca return Optional.empty(); - } else if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales - this.send(new ClientboundSystemChatPacket(PaperAdventure.asAdventure(Component.translatable("chat.disabled.options").withStyle(ChatFormatting.RED)), false)); // Paper - Adventure + } else { + Optional optional = this.unpackAndApplyLastSeen(acknowledgment); @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic if (optional.isEmpty()) { diff --git a/patches/unapplied/server/Add-PlayerSetSpawnEvent.patch b/patches/server/Add-PlayerSetSpawnEvent.patch similarity index 100% rename from patches/unapplied/server/Add-PlayerSetSpawnEvent.patch rename to patches/server/Add-PlayerSetSpawnEvent.patch diff --git a/patches/unapplied/server/Add-PlayerShearBlockEvent.patch b/patches/server/Add-PlayerShearBlockEvent.patch similarity index 100% rename from patches/unapplied/server/Add-PlayerShearBlockEvent.patch rename to patches/server/Add-PlayerShearBlockEvent.patch diff --git a/patches/unapplied/server/Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch b/patches/server/Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch similarity index 98% rename from patches/unapplied/server/Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch rename to patches/server/Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch index 1f7520dd74..1b1a04877e 100644 --- a/patches/unapplied/server/Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch +++ b/patches/server/Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch @@ -99,7 +99,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + stack.shrink(slot.getMaxStackSize()); + } else { + // Paper end - slot.set(stack.split(slot.getMaxStackSize())); + slot.setByPlayer(stack.split(slot.getMaxStackSize())); + } // Paper } else { + // Paper start - dont set slot if only check @@ -107,7 +107,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + stack.shrink(stack.getCount()); + } else { + // Paper end - slot.set(stack.split(stack.getCount())); + slot.setByPlayer(stack.split(stack.getCount())); + } // Paper } @@ -143,7 +143,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + if (slot != 2) { // Paper - moved down for slot 2 if (itemstack1.isEmpty()) { - slot1.set(ItemStack.EMPTY); + slot1.setByPlayer(ItemStack.EMPTY); } else { @@ -0,0 +0,0 @@ public class MerchantMenu extends AbstractContainerMenu { } diff --git a/patches/unapplied/server/Add-PufferFishStateChangeEvent.patch b/patches/server/Add-PufferFishStateChangeEvent.patch similarity index 100% rename from patches/unapplied/server/Add-PufferFishStateChangeEvent.patch rename to patches/server/Add-PufferFishStateChangeEvent.patch diff --git a/patches/unapplied/server/Add-Raw-Byte-Entity-Serialization.patch b/patches/server/Add-Raw-Byte-Entity-Serialization.patch similarity index 100% rename from patches/unapplied/server/Add-Raw-Byte-Entity-Serialization.patch rename to patches/server/Add-Raw-Byte-Entity-Serialization.patch diff --git a/patches/unapplied/server/Add-StructuresLocateEvent.patch b/patches/server/Add-StructuresLocateEvent.patch similarity index 100% rename from patches/unapplied/server/Add-StructuresLocateEvent.patch rename to patches/server/Add-StructuresLocateEvent.patch diff --git a/patches/unapplied/server/Add-System.out-err-catcher.patch b/patches/server/Add-System.out-err-catcher.patch similarity index 100% rename from patches/unapplied/server/Add-System.out-err-catcher.patch rename to patches/server/Add-System.out-err-catcher.patch diff --git a/patches/unapplied/server/Add-Unix-domain-socket-support.patch b/patches/server/Add-Unix-domain-socket-support.patch similarity index 94% rename from patches/unapplied/server/Add-Unix-domain-socket-support.patch rename to patches/server/Add-Unix-domain-socket-support.patch index 9bb71c57cf..526fbc08c9 100644 --- a/patches/unapplied/server/Add-Unix-domain-socket-support.patch +++ b/patches/server/Add-Unix-domain-socket-support.patch @@ -10,22 +10,6 @@ This will be possible as of the Minecraft 1.17 Java version bump. Tested-by: Mariell Hoversholm Reviewed-by: Mariell Hoversholm -diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/network/Connection.java -+++ b/src/main/java/net/minecraft/network/Connection.java -@@ -0,0 +0,0 @@ public class Connection extends SimpleChannelInboundHandler> { - // Spigot Start - public SocketAddress getRawAddress() - { -+ // Paper start - this can be nullable in the case of a Unix domain socket, so if it is, fake something -+ if (this.channel.remoteAddress() == null) { -+ return new java.net.InetSocketAddress(java.net.InetAddress.getLoopbackAddress(), 0); -+ } -+ // Paper end - return this.channel.remoteAddress(); - } - // Spigot End diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java @@ -106,6 +90,22 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } } +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 ++++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic + // Spigot Start + public SocketAddress getRawAddress() + { ++ // Paper start - this can be nullable in the case of a Unix domain socket, so if it is, fake something ++ if (connection.channel.remoteAddress() == null) { ++ return new java.net.InetSocketAddress(java.net.InetAddress.getLoopbackAddress(), 0); ++ } ++ // Paper end + return this.connection.channel.remoteAddress(); + } + // Spigot End 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 diff --git a/patches/unapplied/server/Add-Wandering-Trader-spawn-rate-config-options.patch b/patches/server/Add-Wandering-Trader-spawn-rate-config-options.patch similarity index 95% rename from patches/unapplied/server/Add-Wandering-Trader-spawn-rate-config-options.patch rename to patches/server/Add-Wandering-Trader-spawn-rate-config-options.patch index 5bc6a14c4c..b615b0c995 100644 --- a/patches/unapplied/server/Add-Wandering-Trader-spawn-rate-config-options.patch +++ b/patches/server/Add-Wandering-Trader-spawn-rate-config-options.patch @@ -70,10 +70,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (!world.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING)) { return 0; } else { - int i = this.spawnChance; +@@ -0,0 +0,0 @@ public class WanderingTraderSpawner implements CustomSpawner { -- this.spawnChance = Mth.clamp(this.spawnChance + 25, (int) 25, (int) 75); -- this.serverLevelData.setWanderingTraderSpawnChance(this.spawnChance); + this.spawnChance = Mth.clamp(this.spawnChance + 25, 25, 75); + this.serverLevelData.setWanderingTraderSpawnChance(this.spawnChance); + this.spawnChance = Mth.clamp(i + world.paperConfig().entities.spawning.wanderingTrader.spawnChanceFailureIncrement, world.paperConfig().entities.spawning.wanderingTrader.spawnChanceMin, world.paperConfig().entities.spawning.wanderingTrader.spawnChanceMax); + //this.serverLevelData.setWanderingTraderSpawnChance(this.spawnChance); // Paper - We don't need to save this value to disk if it gets set back to a hardcoded value anyways if (this.random.nextInt(100) > i) { diff --git a/patches/unapplied/server/Add-a-bunch-of-missing-forceDrop-toggles.patch b/patches/server/Add-a-bunch-of-missing-forceDrop-toggles.patch similarity index 95% rename from patches/unapplied/server/Add-a-bunch-of-missing-forceDrop-toggles.patch rename to patches/server/Add-a-bunch-of-missing-forceDrop-toggles.patch index 6b25856248..ad6f4819a6 100644 --- a/patches/unapplied/server/Add-a-bunch-of-missing-forceDrop-toggles.patch +++ b/patches/server/Add-a-bunch-of-missing-forceDrop-toggles.patch @@ -9,11 +9,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/entity/ai/behavior/WorkAtComposter.java +++ b/src/main/java/net/minecraft/world/entity/ai/behavior/WorkAtComposter.java @@ -0,0 +0,0 @@ public class WorkAtComposter extends WorkAtPoi { - ItemStack itemstack = inventorysubcontainer.addItem(new ItemStack(Items.BREAD, j)); - - if (!itemstack.isEmpty()) { + simpleContainer.removeItemType(Items.WHEAT, m); + ItemStack itemStack = simpleContainer.addItem(new ItemStack(Items.BREAD, l)); + if (!itemStack.isEmpty()) { + entity.forceDrops = true; // Paper - entity.spawnAtLocation(itemstack, 0.5F); + entity.spawnAtLocation(itemStack, 0.5F); + entity.forceDrops = false; // Paper } diff --git a/patches/unapplied/server/Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch b/patches/server/Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch similarity index 100% rename from patches/unapplied/server/Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch rename to patches/server/Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch diff --git a/patches/unapplied/server/Add-additional-open-container-api-to-HumanEntity.patch b/patches/server/Add-additional-open-container-api-to-HumanEntity.patch similarity index 100% rename from patches/unapplied/server/Add-additional-open-container-api-to-HumanEntity.patch rename to patches/server/Add-additional-open-container-api-to-HumanEntity.patch diff --git a/patches/unapplied/server/Add-back-EntityPortalExitEvent.patch b/patches/server/Add-back-EntityPortalExitEvent.patch similarity index 100% rename from patches/unapplied/server/Add-back-EntityPortalExitEvent.patch rename to patches/server/Add-back-EntityPortalExitEvent.patch diff --git a/patches/unapplied/server/Add-basic-Datapack-API.patch b/patches/server/Add-basic-Datapack-API.patch similarity index 100% rename from patches/unapplied/server/Add-basic-Datapack-API.patch rename to patches/server/Add-basic-Datapack-API.patch diff --git a/patches/unapplied/server/Add-bypass-host-check.patch b/patches/server/Add-bypass-host-check.patch similarity index 100% rename from patches/unapplied/server/Add-bypass-host-check.patch rename to patches/server/Add-bypass-host-check.patch diff --git a/patches/unapplied/server/Add-cause-to-Weather-ThunderChangeEvents.patch b/patches/server/Add-cause-to-Weather-ThunderChangeEvents.patch similarity index 100% rename from patches/unapplied/server/Add-cause-to-Weather-ThunderChangeEvents.patch rename to patches/server/Add-cause-to-Weather-ThunderChangeEvents.patch diff --git a/patches/unapplied/server/Add-config-for-mobs-immune-to-default-effects.patch b/patches/server/Add-config-for-mobs-immune-to-default-effects.patch similarity index 99% rename from patches/unapplied/server/Add-config-for-mobs-immune-to-default-effects.patch rename to patches/server/Add-config-for-mobs-immune-to-default-effects.patch index 91a6aae3d4..1026c9de6c 100644 --- a/patches/unapplied/server/Add-config-for-mobs-immune-to-default-effects.patch +++ b/patches/server/Add-config-for-mobs-immune-to-default-effects.patch @@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/ma index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { +@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { if (this.getMobType() == MobType.UNDEAD) { MobEffect mobeffectlist = effect.getEffect(); diff --git a/patches/unapplied/server/Add-critical-damage-API.patch b/patches/server/Add-critical-damage-API.patch similarity index 91% rename from patches/unapplied/server/Add-critical-damage-API.patch rename to patches/server/Add-critical-damage-API.patch index bdd44387f1..0bea5cb688 100644 --- a/patches/unapplied/server/Add-critical-damage-API.patch +++ b/patches/server/Add-critical-damage-API.patch @@ -9,9 +9,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/damagesource/DamageSource.java +++ b/src/main/java/net/minecraft/world/damagesource/DamageSource.java @@ -0,0 +0,0 @@ public class DamageSource { - return this; + public Holder typeHolder() { + return this.type; } - // CraftBukkit end ++ + // Paper start - add critical damage API + private boolean critical; + public boolean isCritical() { @@ -25,9 +26,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + return this; + } + // Paper end - - public static DamageSource fallingBlock(Entity attacker) { - return (new EntityDamageSource("fallingBlock", attacker)).damageHelmet(); + } diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java @@ -45,8 +44,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } Vec3 vec3d = target.getDeltaMovement(); -- boolean flag5 = target.hurt(DamageSource.playerAttack(this), f); -+ boolean flag5 = target.hurt(DamageSource.playerAttack(this).critical(flag2), f); // Paper - add critical damage API +- boolean flag5 = target.hurt(this.damageSources().playerAttack(this), f); ++ boolean flag5 = target.hurt(this.damageSources().playerAttack(this).critical(flag2), f); // Paper - add critical damage API if (flag5) { if (i > 0) { @@ -54,9 +53,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (entityliving != this && entityliving != target && !this.isAlliedTo((Entity) entityliving) && (!(entityliving instanceof ArmorStand) || !((ArmorStand) entityliving).isMarker()) && this.distanceToSqr((Entity) entityliving) < 9.0D) { // CraftBukkit start - Only apply knockback if the damage hits -- if (entityliving.hurt(DamageSource.playerAttack(this).sweep(), f4)) { -+ if (entityliving.hurt(DamageSource.playerAttack(this).sweep().critical(flag2), f4)) { // Paper - add critical damage API - entityliving.knockback(0.4000000059604645D, (double) Mth.sin(this.getYRot() * 0.017453292F), (double) (-Mth.cos(this.getYRot() * 0.017453292F)), this); // Paper +- if (entityliving.hurt(this.damageSources().playerAttack(this).sweep(), f4)) { ++ if (entityliving.hurt(this.damageSources().playerAttack(this).sweep().critical(flag2), f4)) { // Paper - add critical damage API + entityliving.knockback(0.4000000059604645D, (double) Mth.sin(this.getYRot() * 0.017453292F), (double) (-Mth.cos(this.getYRot() * 0.017453292F)), this); // Pa } // CraftBukkit end diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java @@ -90,12 +89,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - return CraftEventFactory.callEntityDamageEvent(damager, entity, cause, modifiers, modifierFunctions, cancelled); + return CraftEventFactory.callEntityDamageEvent(damager, entity, cause, modifiers, modifierFunctions, cancelled, source.isCritical()); // Paper - add critical damage API - } else if (source == DamageSource.OUT_OF_WORLD) { + } else if (sourceType == DamageTypes.OUT_OF_WORLD) { EntityDamageEvent event = new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.VOID, modifiers, modifierFunctions); event.setCancelled(cancelled); @@ -0,0 +0,0 @@ public class CraftEventFactory { } else { - throw new IllegalStateException(String.format("Unhandled damage of %s by %s from %s", entity, damager.getHandle(), source.msgId)); + throw new IllegalStateException(String.format("Unhandled damage of %s by %s from %s", entity, damager.getHandle(), source.getMsgId())); } - EntityDamageEvent event = new EntityDamageByEntityEvent(damager, entity.getBukkitEntity(), cause, modifiers, modifierFunctions); + EntityDamageEvent event = new EntityDamageByEntityEvent(damager, entity.getBukkitEntity(), cause, modifiers, modifierFunctions, source.isCritical()); // Paper - add critical damage API @@ -110,7 +109,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + return CraftEventFactory.callEntityDamageEvent(null, entity, cause, modifiers, modifierFunctions, cancelled, source.isCritical()); // Paper - add critical damage API } - throw new IllegalStateException(String.format("Unhandled damage of %s from %s", entity, source.msgId)); + throw new IllegalStateException(String.format("Unhandled damage of %s from %s", entity, source.getMsgId())); } + @Deprecated // Paper - Add critical damage API diff --git a/patches/unapplied/server/Add-dropLeash-variable-to-EntityUnleashEvent.patch b/patches/server/Add-dropLeash-variable-to-EntityUnleashEvent.patch similarity index 89% rename from patches/unapplied/server/Add-dropLeash-variable-to-EntityUnleashEvent.patch rename to patches/server/Add-dropLeash-variable-to-EntityUnleashEvent.patch index 7bbebb88cb..20e4212a97 100644 --- a/patches/unapplied/server/Add-dropLeash-variable-to-EntityUnleashEvent.patch +++ b/patches/server/Add-dropLeash-variable-to-EntityUnleashEvent.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 { +@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements Targeting { return InteractionResult.PASS; } else if (this.getLeashHolder() == player) { // CraftBukkit start - fire PlayerUnleashEntityEvent @@ -23,10 +23,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // CraftBukkit end - this.dropLeash(true, !player.getAbilities().instabuild); + this.dropLeash(true, event.isDropLeash()); // Paper - drop leash variable + this.gameEvent(GameEvent.ENTITY_INTERACT, player); return InteractionResult.sidedSuccess(this.level.isClientSide); } else { - InteractionResult enuminteractionresult = this.checkAndHandleImportantInteractions(player, hand); -@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity { +@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements Targeting { if (this.leashHolder != null) { if (!this.isAlive() || !this.leashHolder.isAlive()) { @@ -40,7 +40,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } } -@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity { +@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements Targeting { boolean flag1 = super.startRiding(entity, force); if (flag1 && this.isLeashed()) { @@ -54,7 +54,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } return flag1; -@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity { +@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements Targeting { @Override protected void removeAfterChangingDimensions() { super.removeAfterChangingDimensions(); @@ -105,22 +105,22 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/entity/decoration/LeashFenceKnotEntity.java +++ b/src/main/java/net/minecraft/world/entity/decoration/LeashFenceKnotEntity.java @@ -0,0 +0,0 @@ public class LeashFenceKnotEntity extends HangingEntity { - entityinsentient = (Mob) iterator.next(); - if (entityinsentient.isLeashed() && entityinsentient.getLeashHolder() == this) { + + if (entityinsentient1.isLeashed() && entityinsentient1.getLeashHolder() == this) { // CraftBukkit start -- if (CraftEventFactory.callPlayerUnleashEntityEvent(entityinsentient, player, hand).isCancelled()) { +- if (CraftEventFactory.callPlayerUnleashEntityEvent(entityinsentient1, player, hand).isCancelled()) { + // Paper start - drop leash variable -+ org.bukkit.event.player.PlayerUnleashEntityEvent event = CraftEventFactory.callPlayerUnleashEntityEvent(entityinsentient, player, hand, !player.getAbilities().instabuild); ++ org.bukkit.event.player.PlayerUnleashEntityEvent event = CraftEventFactory.callPlayerUnleashEntityEvent(entityinsentient1, player, hand, !player.getAbilities().instabuild); + if (event.isCancelled()) { + // Paper end die = false; continue; } -- entityinsentient.dropLeash(true, !player.getAbilities().instabuild); // false -> survival mode boolean -+ entityinsentient.dropLeash(true, event.isDropLeash()); // false -> survival mode boolean // Paper - drop leash variable +- entityinsentient1.dropLeash(true, !player.getAbilities().instabuild); // false -> survival mode boolean ++ entityinsentient1.dropLeash(true, event.isDropLeash()); // false -> survival mode boolean // Paper - drop leash variable // CraftBukkit end + flag1 = true; } - } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java diff --git a/patches/unapplied/server/Add-environment-variable-to-disable-server-gui.patch b/patches/server/Add-environment-variable-to-disable-server-gui.patch similarity index 100% rename from patches/unapplied/server/Add-environment-variable-to-disable-server-gui.patch rename to patches/server/Add-environment-variable-to-disable-server-gui.patch diff --git a/patches/unapplied/server/Add-fast-alternative-constructor-for-Rotations.patch b/patches/server/Add-fast-alternative-constructor-for-Rotations.patch similarity index 100% rename from patches/unapplied/server/Add-fast-alternative-constructor-for-Rotations.patch rename to patches/server/Add-fast-alternative-constructor-for-Rotations.patch diff --git a/patches/unapplied/server/Add-getMainThreadExecutor-to-BukkitScheduler.patch b/patches/server/Add-getMainThreadExecutor-to-BukkitScheduler.patch similarity index 100% rename from patches/unapplied/server/Add-getMainThreadExecutor-to-BukkitScheduler.patch rename to patches/server/Add-getMainThreadExecutor-to-BukkitScheduler.patch diff --git a/patches/unapplied/server/Add-getOfflinePlayerIfCached-String.patch b/patches/server/Add-getOfflinePlayerIfCached-String.patch similarity index 100% rename from patches/unapplied/server/Add-getOfflinePlayerIfCached-String.patch rename to patches/server/Add-getOfflinePlayerIfCached-String.patch diff --git a/patches/unapplied/server/Add-ignore-discounts-API.patch b/patches/server/Add-ignore-discounts-API.patch similarity index 100% rename from patches/unapplied/server/Add-ignore-discounts-API.patch rename to patches/server/Add-ignore-discounts-API.patch diff --git a/patches/unapplied/server/Add-isCollidable-methods-to-various-places.patch b/patches/server/Add-isCollidable-methods-to-various-places.patch similarity index 100% rename from patches/unapplied/server/Add-isCollidable-methods-to-various-places.patch rename to patches/server/Add-isCollidable-methods-to-various-places.patch diff --git a/patches/unapplied/server/Add-methods-to-find-targets-for-lightning-strikes.patch b/patches/server/Add-methods-to-find-targets-for-lightning-strikes.patch similarity index 100% rename from patches/unapplied/server/Add-methods-to-find-targets-for-lightning-strikes.patch rename to patches/server/Add-methods-to-find-targets-for-lightning-strikes.patch diff --git a/patches/unapplied/server/Add-methods-to-get-translation-keys.patch b/patches/server/Add-methods-to-get-translation-keys.patch similarity index 100% rename from patches/unapplied/server/Add-methods-to-get-translation-keys.patch rename to patches/server/Add-methods-to-get-translation-keys.patch diff --git a/patches/unapplied/server/Add-missing-team-sidebar-display-slots.patch b/patches/server/Add-missing-team-sidebar-display-slots.patch similarity index 100% rename from patches/unapplied/server/Add-missing-team-sidebar-display-slots.patch rename to patches/server/Add-missing-team-sidebar-display-slots.patch diff --git a/patches/unapplied/server/Add-moon-phase-API.patch b/patches/server/Add-moon-phase-API.patch similarity index 100% rename from patches/unapplied/server/Add-moon-phase-API.patch rename to patches/server/Add-moon-phase-API.patch diff --git a/patches/unapplied/server/Add-more-Evoker-API.patch b/patches/server/Add-more-Evoker-API.patch similarity index 100% rename from patches/unapplied/server/Add-more-Evoker-API.patch rename to patches/server/Add-more-Evoker-API.patch diff --git a/patches/unapplied/server/Add-more-LimitedRegion-API.patch b/patches/server/Add-more-LimitedRegion-API.patch similarity index 100% rename from patches/unapplied/server/Add-more-LimitedRegion-API.patch rename to patches/server/Add-more-LimitedRegion-API.patch diff --git a/patches/unapplied/server/Add-more-WanderingTrader-API.patch b/patches/server/Add-more-WanderingTrader-API.patch similarity index 100% rename from patches/unapplied/server/Add-more-WanderingTrader-API.patch rename to patches/server/Add-more-WanderingTrader-API.patch diff --git a/patches/unapplied/server/Add-more-advancement-API.patch b/patches/server/Add-more-advancement-API.patch similarity index 100% rename from patches/unapplied/server/Add-more-advancement-API.patch rename to patches/server/Add-more-advancement-API.patch diff --git a/patches/unapplied/server/Add-option-to-fix-items-merging-through-walls.patch b/patches/server/Add-option-to-fix-items-merging-through-walls.patch similarity index 94% rename from patches/unapplied/server/Add-option-to-fix-items-merging-through-walls.patch rename to patches/server/Add-option-to-fix-items-merging-through-walls.patch index 6b3ef66736..d6ea3694f1 100644 --- a/patches/unapplied/server/Add-option-to-fix-items-merging-through-walls.patch +++ b/patches/server/Add-option-to-fix-items-merging-through-walls.patch @@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java -@@ -0,0 +0,0 @@ public class ItemEntity extends Entity { +@@ -0,0 +0,0 @@ public class ItemEntity extends Entity implements TraceableEntity { ItemEntity entityitem = (ItemEntity) iterator.next(); if (entityitem.isMergable()) { diff --git a/patches/unapplied/server/Add-paper-mobcaps-and-paper-playermobcaps.patch b/patches/server/Add-paper-mobcaps-and-paper-playermobcaps.patch similarity index 100% rename from patches/unapplied/server/Add-paper-mobcaps-and-paper-playermobcaps.patch rename to patches/server/Add-paper-mobcaps-and-paper-playermobcaps.patch diff --git a/patches/unapplied/server/Add-playPickupItemAnimation-to-LivingEntity.patch b/patches/server/Add-playPickupItemAnimation-to-LivingEntity.patch similarity index 100% rename from patches/unapplied/server/Add-playPickupItemAnimation-to-LivingEntity.patch rename to patches/server/Add-playPickupItemAnimation-to-LivingEntity.patch diff --git a/patches/unapplied/server/Add-raw-address-to-AsyncPlayerPreLoginEvent.patch b/patches/server/Add-raw-address-to-AsyncPlayerPreLoginEvent.patch similarity index 100% rename from patches/unapplied/server/Add-raw-address-to-AsyncPlayerPreLoginEvent.patch rename to patches/server/Add-raw-address-to-AsyncPlayerPreLoginEvent.patch diff --git a/patches/unapplied/server/Add-recipe-to-cook-events.patch b/patches/server/Add-recipe-to-cook-events.patch similarity index 98% rename from patches/unapplied/server/Add-recipe-to-cook-events.patch rename to patches/server/Add-recipe-to-cook-events.patch index 9f65de3dcb..fbd9fbbd3e 100644 --- a/patches/unapplied/server/Add-recipe-to-cook-events.patch +++ b/patches/server/Add-recipe-to-cook-events.patch @@ -29,7 +29,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + Optional recipe = campfire.quickCheck.getRecipeFor( inventorysubcontainer, world); + ItemStack itemstack1 = (ItemStack) recipe.map((recipecampfire) -> { + // Paper end - return recipecampfire.assemble(inventorysubcontainer); + return recipecampfire.assemble(inventorysubcontainer, world.registryAccess()); }).orElse(itemstack); @@ -0,0 +0,0 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable { diff --git a/patches/unapplied/server/Add-sendOpLevel-API.patch b/patches/server/Add-sendOpLevel-API.patch similarity index 100% rename from patches/unapplied/server/Add-sendOpLevel-API.patch rename to patches/server/Add-sendOpLevel-API.patch diff --git a/patches/unapplied/server/Add-setMaxPlayers-API.patch b/patches/server/Add-setMaxPlayers-API.patch similarity index 100% rename from patches/unapplied/server/Add-setMaxPlayers-API.patch rename to patches/server/Add-setMaxPlayers-API.patch diff --git a/patches/unapplied/server/Add-support-for-hex-color-codes-in-console.patch b/patches/server/Add-support-for-hex-color-codes-in-console.patch similarity index 100% rename from patches/unapplied/server/Add-support-for-hex-color-codes-in-console.patch rename to patches/server/Add-support-for-hex-color-codes-in-console.patch diff --git a/patches/unapplied/server/Add-toggle-for-always-placing-the-dragon-egg.patch b/patches/server/Add-toggle-for-always-placing-the-dragon-egg.patch similarity index 100% rename from patches/unapplied/server/Add-toggle-for-always-placing-the-dragon-egg.patch rename to patches/server/Add-toggle-for-always-placing-the-dragon-egg.patch diff --git a/patches/unapplied/server/Add-worldborder-events.patch b/patches/server/Add-worldborder-events.patch similarity index 100% rename from patches/unapplied/server/Add-worldborder-events.patch rename to patches/server/Add-worldborder-events.patch diff --git a/patches/unapplied/server/Add-zombie-targets-turtle-egg-config.patch b/patches/server/Add-zombie-targets-turtle-egg-config.patch similarity index 100% rename from patches/unapplied/server/Add-zombie-targets-turtle-egg-config.patch rename to patches/server/Add-zombie-targets-turtle-egg-config.patch diff --git a/patches/unapplied/server/Added-EntityDamageItemEvent.patch b/patches/server/Added-EntityDamageItemEvent.patch similarity index 100% rename from patches/unapplied/server/Added-EntityDamageItemEvent.patch rename to patches/server/Added-EntityDamageItemEvent.patch diff --git a/patches/unapplied/server/Added-PlayerBedFailEnterEvent.patch b/patches/server/Added-PlayerBedFailEnterEvent.patch similarity index 100% rename from patches/unapplied/server/Added-PlayerBedFailEnterEvent.patch rename to patches/server/Added-PlayerBedFailEnterEvent.patch diff --git a/patches/unapplied/server/Added-PlayerDeepSleepEvent.patch b/patches/server/Added-PlayerDeepSleepEvent.patch similarity index 100% rename from patches/unapplied/server/Added-PlayerDeepSleepEvent.patch rename to patches/server/Added-PlayerDeepSleepEvent.patch diff --git a/patches/unapplied/server/Added-PlayerLecternPageChangeEvent.patch b/patches/server/Added-PlayerLecternPageChangeEvent.patch similarity index 100% rename from patches/unapplied/server/Added-PlayerLecternPageChangeEvent.patch rename to patches/server/Added-PlayerLecternPageChangeEvent.patch diff --git a/patches/unapplied/server/Added-PlayerLoomPatternSelectEvent.patch b/patches/server/Added-PlayerLoomPatternSelectEvent.patch similarity index 100% rename from patches/unapplied/server/Added-PlayerLoomPatternSelectEvent.patch rename to patches/server/Added-PlayerLoomPatternSelectEvent.patch diff --git a/patches/unapplied/server/Added-PlayerStonecutterRecipeSelectEvent.patch b/patches/server/Added-PlayerStonecutterRecipeSelectEvent.patch similarity index 100% rename from patches/unapplied/server/Added-PlayerStonecutterRecipeSelectEvent.patch rename to patches/server/Added-PlayerStonecutterRecipeSelectEvent.patch diff --git a/patches/unapplied/server/Added-ServerResourcesReloadedEvent.patch b/patches/server/Added-ServerResourcesReloadedEvent.patch similarity index 100% rename from patches/unapplied/server/Added-ServerResourcesReloadedEvent.patch rename to patches/server/Added-ServerResourcesReloadedEvent.patch diff --git a/patches/unapplied/server/Added-WorldGameRuleChangeEvent.patch b/patches/server/Added-WorldGameRuleChangeEvent.patch similarity index 100% rename from patches/unapplied/server/Added-WorldGameRuleChangeEvent.patch rename to patches/server/Added-WorldGameRuleChangeEvent.patch diff --git a/patches/unapplied/server/Added-firing-of-PlayerChangeBeaconEffectEvent.patch b/patches/server/Added-firing-of-PlayerChangeBeaconEffectEvent.patch similarity index 100% rename from patches/unapplied/server/Added-firing-of-PlayerChangeBeaconEffectEvent.patch rename to patches/server/Added-firing-of-PlayerChangeBeaconEffectEvent.patch diff --git a/patches/unapplied/server/Added-missing-default-perms-for-commands.patch b/patches/server/Added-missing-default-perms-for-commands.patch similarity index 100% rename from patches/unapplied/server/Added-missing-default-perms-for-commands.patch rename to patches/server/Added-missing-default-perms-for-commands.patch diff --git a/patches/unapplied/server/Added-world-settings-for-mobs-picking-up-loot.patch b/patches/server/Added-world-settings-for-mobs-picking-up-loot.patch similarity index 100% rename from patches/unapplied/server/Added-world-settings-for-mobs-picking-up-loot.patch rename to patches/server/Added-world-settings-for-mobs-picking-up-loot.patch diff --git a/patches/unapplied/server/Additional-Block-Material-API-s.patch b/patches/server/Additional-Block-Material-API-s.patch similarity index 100% rename from patches/unapplied/server/Additional-Block-Material-API-s.patch rename to patches/server/Additional-Block-Material-API-s.patch diff --git a/patches/unapplied/server/Adds-PlayerArmSwingEvent.patch b/patches/server/Adds-PlayerArmSwingEvent.patch similarity index 100% rename from patches/unapplied/server/Adds-PlayerArmSwingEvent.patch rename to patches/server/Adds-PlayerArmSwingEvent.patch diff --git a/patches/unapplied/server/Allow-adding-items-to-BlockDropItemEvent.patch b/patches/server/Allow-adding-items-to-BlockDropItemEvent.patch similarity index 100% rename from patches/unapplied/server/Allow-adding-items-to-BlockDropItemEvent.patch rename to patches/server/Allow-adding-items-to-BlockDropItemEvent.patch diff --git a/patches/unapplied/server/Allow-controlled-flushing-for-network-manager.patch b/patches/server/Allow-controlled-flushing-for-network-manager.patch similarity index 100% rename from patches/unapplied/server/Allow-controlled-flushing-for-network-manager.patch rename to patches/server/Allow-controlled-flushing-for-network-manager.patch diff --git a/patches/unapplied/server/Allow-disabling-mob-spawner-spawn-egg-transformation.patch b/patches/server/Allow-disabling-mob-spawner-spawn-egg-transformation.patch similarity index 100% rename from patches/unapplied/server/Allow-disabling-mob-spawner-spawn-egg-transformation.patch rename to patches/server/Allow-disabling-mob-spawner-spawn-egg-transformation.patch diff --git a/patches/unapplied/server/Allow-skipping-writing-of-comments-to-server.propert.patch b/patches/server/Allow-skipping-writing-of-comments-to-server.propert.patch similarity index 100% rename from patches/unapplied/server/Allow-skipping-writing-of-comments-to-server.propert.patch rename to patches/server/Allow-skipping-writing-of-comments-to-server.propert.patch diff --git a/patches/unapplied/server/Allow-using-signs-inside-spawn-protection.patch b/patches/server/Allow-using-signs-inside-spawn-protection.patch similarity index 100% rename from patches/unapplied/server/Allow-using-signs-inside-spawn-protection.patch rename to patches/server/Allow-using-signs-inside-spawn-protection.patch diff --git a/patches/unapplied/server/Attributes-API-for-item-defaults.patch b/patches/server/Attributes-API-for-item-defaults.patch similarity index 100% rename from patches/unapplied/server/Attributes-API-for-item-defaults.patch rename to patches/server/Attributes-API-for-item-defaults.patch diff --git a/patches/unapplied/server/Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch b/patches/server/Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch similarity index 100% rename from patches/unapplied/server/Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch rename to patches/server/Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch diff --git a/patches/unapplied/server/Beacon-API-custom-effect-ranges.patch b/patches/server/Beacon-API-custom-effect-ranges.patch similarity index 100% rename from patches/unapplied/server/Beacon-API-custom-effect-ranges.patch rename to patches/server/Beacon-API-custom-effect-ranges.patch diff --git a/patches/unapplied/server/Brand-support.patch b/patches/server/Brand-support.patch similarity index 100% rename from patches/unapplied/server/Brand-support.patch rename to patches/server/Brand-support.patch diff --git a/patches/unapplied/server/Buffer-joins-to-world.patch b/patches/server/Buffer-joins-to-world.patch similarity index 100% rename from patches/unapplied/server/Buffer-joins-to-world.patch rename to patches/server/Buffer-joins-to-world.patch diff --git a/patches/unapplied/server/Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch b/patches/server/Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch similarity index 96% rename from patches/unapplied/server/Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch rename to patches/server/Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch index 1092489202..c66c263c4b 100644 --- a/patches/unapplied/server/Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch +++ b/patches/server/Cache-DataFixerUpper-Rewrite-Rules-on-demand.patch @@ -51,4 +51,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + if (versionKey < minDataFixPrecacheVersion) continue; // Paper final Schema schema = schemas.get(versionKey); for (final String typeName : schema.types()) { - final CompletableFuture future = CompletableFuture.runAsync(() -> { + if (!requiredTypeNames.contains(typeName)) { diff --git a/patches/unapplied/server/Cache-block-data-strings.patch b/patches/server/Cache-block-data-strings.patch similarity index 100% rename from patches/unapplied/server/Cache-block-data-strings.patch rename to patches/server/Cache-block-data-strings.patch diff --git a/patches/unapplied/server/Cache-burn-durations.patch b/patches/server/Cache-burn-durations.patch similarity index 100% rename from patches/unapplied/server/Cache-burn-durations.patch rename to patches/server/Cache-burn-durations.patch diff --git a/patches/unapplied/server/Change-EnderEye-target-without-changing-other-things.patch b/patches/server/Change-EnderEye-target-without-changing-other-things.patch similarity index 90% rename from patches/unapplied/server/Change-EnderEye-target-without-changing-other-things.patch rename to patches/server/Change-EnderEye-target-without-changing-other-things.patch index c944f54457..ba8cc5944a 100644 --- a/patches/unapplied/server/Change-EnderEye-target-without-changing-other-things.patch +++ b/patches/server/Change-EnderEye-target-without-changing-other-things.patch @@ -47,8 +47,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + public void setTargetLocation(Location location, boolean update) { + // Paper end Preconditions.checkArgument(getWorld().equals(location.getWorld()), "Cannot target EnderSignal across worlds"); -- this.getHandle().signalTo(new BlockPos(location.getX(), location.getY(), location.getZ())); -+ this.getHandle().signalTo(new BlockPos(location.getX(), location.getY(), location.getZ()), update); // Paper +- this.getHandle().signalTo(BlockPos.containing(location.getX(), location.getY(), location.getZ())); ++ this.getHandle().signalTo(BlockPos.containing(location.getX(), location.getY(), location.getZ()), update); // Paper } @Override diff --git a/patches/unapplied/server/Clear-bucket-NBT-after-dispense.patch b/patches/server/Clear-bucket-NBT-after-dispense.patch similarity index 100% rename from patches/unapplied/server/Clear-bucket-NBT-after-dispense.patch rename to patches/server/Clear-bucket-NBT-after-dispense.patch diff --git a/patches/unapplied/server/Climbing-should-not-bypass-cramming-gamerule.patch b/patches/server/Climbing-should-not-bypass-cramming-gamerule.patch similarity index 99% rename from patches/unapplied/server/Climbing-should-not-bypass-cramming-gamerule.patch rename to patches/server/Climbing-should-not-bypass-cramming-gamerule.patch index e193f4db2b..3ab7366829 100644 --- a/patches/unapplied/server/Climbing-should-not-bypass-cramming-gamerule.patch +++ b/patches/server/Climbing-should-not-bypass-cramming-gamerule.patch @@ -48,7 +48,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/ma index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { +@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { return; } // Paper end - don't run getEntities if we're not going to use its result @@ -57,7 +57,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (!list.isEmpty()) { // Paper - moved up -@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { +@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { return !this.isRemoved() && this.collides; // CraftBukkit } diff --git a/patches/unapplied/server/Collision-option-for-requiring-a-player-participant.patch b/patches/server/Collision-option-for-requiring-a-player-participant.patch similarity index 100% rename from patches/unapplied/server/Collision-option-for-requiring-a-player-participant.patch rename to patches/server/Collision-option-for-requiring-a-player-participant.patch diff --git a/patches/unapplied/server/Config-option-for-Piglins-guarding-chests.patch b/patches/server/Config-option-for-Piglins-guarding-chests.patch similarity index 100% rename from patches/unapplied/server/Config-option-for-Piglins-guarding-chests.patch rename to patches/server/Config-option-for-Piglins-guarding-chests.patch diff --git a/patches/unapplied/server/Configurable-door-breaking-difficulty.patch b/patches/server/Configurable-door-breaking-difficulty.patch similarity index 100% rename from patches/unapplied/server/Configurable-door-breaking-difficulty.patch rename to patches/server/Configurable-door-breaking-difficulty.patch diff --git a/patches/unapplied/server/Configurable-item-frame-map-cursor-update-interval.patch b/patches/server/Configurable-item-frame-map-cursor-update-interval.patch similarity index 100% rename from patches/unapplied/server/Configurable-item-frame-map-cursor-update-interval.patch rename to patches/server/Configurable-item-frame-map-cursor-update-interval.patch diff --git a/patches/unapplied/server/Configurable-max-leash-distance.patch b/patches/server/Configurable-max-leash-distance.patch similarity index 100% rename from patches/unapplied/server/Configurable-max-leash-distance.patch rename to patches/server/Configurable-max-leash-distance.patch diff --git a/patches/unapplied/server/Create-HoverEvent-from-ItemStack-Entity.patch b/patches/server/Create-HoverEvent-from-ItemStack-Entity.patch similarity index 100% rename from patches/unapplied/server/Create-HoverEvent-from-ItemStack-Entity.patch rename to patches/server/Create-HoverEvent-from-ItemStack-Entity.patch diff --git a/patches/unapplied/server/Do-not-crash-from-invalid-ingredient-lists-in-Villag.patch b/patches/server/Do-not-crash-from-invalid-ingredient-lists-in-Villag.patch similarity index 100% rename from patches/unapplied/server/Do-not-crash-from-invalid-ingredient-lists-in-Villag.patch rename to patches/server/Do-not-crash-from-invalid-ingredient-lists-in-Villag.patch diff --git a/patches/unapplied/server/Do-not-let-the-server-load-chunks-from-newer-version.patch b/patches/server/Do-not-let-the-server-load-chunks-from-newer-version.patch similarity index 100% rename from patches/unapplied/server/Do-not-let-the-server-load-chunks-from-newer-version.patch rename to patches/server/Do-not-let-the-server-load-chunks-from-newer-version.patch diff --git a/patches/unapplied/server/Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch b/patches/server/Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch similarity index 100% rename from patches/unapplied/server/Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch rename to patches/server/Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch diff --git a/patches/unapplied/server/Don-t-apply-cramming-damage-to-players.patch b/patches/server/Don-t-apply-cramming-damage-to-players.patch similarity index 67% rename from patches/unapplied/server/Don-t-apply-cramming-damage-to-players.patch rename to patches/server/Don-t-apply-cramming-damage-to-players.patch index 7d7cfb0c19..cc1933ea90 100644 --- a/patches/unapplied/server/Don-t-apply-cramming-damage-to-players.patch +++ b/patches/server/Don-t-apply-cramming-damage-to-players.patch @@ -14,12 +14,20 @@ 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.util.Mth; + import net.minecraft.util.RandomSource; + import net.minecraft.util.Unit; + import net.minecraft.world.damagesource.DamageSource; ++import net.minecraft.world.damagesource.DamageSources; + import net.minecraft.world.effect.MobEffectInstance; + import net.minecraft.world.effect.MobEffects; + import net.minecraft.world.entity.Entity; @@ -0,0 +0,0 @@ public class ServerPlayer extends Player { @Override public boolean isInvulnerableTo(DamageSource damageSource) { -- return super.isInvulnerableTo(damageSource) || this.isChangingDimension() || this.getAbilities().invulnerable && damageSource == DamageSource.WITHER; -+ return super.isInvulnerableTo(damageSource) || this.isChangingDimension() || this.getAbilities().invulnerable && damageSource == DamageSource.WITHER || !level.paperConfig().collisions.allowPlayerCrammingDamage && damageSource == DamageSource.CRAMMING; // Paper - disable player cramming +- return super.isInvulnerableTo(damageSource) || this.isChangingDimension(); ++ return super.isInvulnerableTo(damageSource) || this.isChangingDimension() || !level.paperConfig().collisions.allowPlayerCrammingDamage && damageSource == damageSources().cramming(); // Paper - disable player cramming } @Override diff --git a/patches/unapplied/server/Don-t-ignore-result-of-PlayerEditBookEvent.patch b/patches/server/Don-t-ignore-result-of-PlayerEditBookEvent.patch similarity index 100% rename from patches/unapplied/server/Don-t-ignore-result-of-PlayerEditBookEvent.patch rename to patches/server/Don-t-ignore-result-of-PlayerEditBookEvent.patch diff --git a/patches/unapplied/server/Don-t-require-FACING-data.patch b/patches/server/Don-t-require-FACING-data.patch similarity index 100% rename from patches/unapplied/server/Don-t-require-FACING-data.patch rename to patches/server/Don-t-require-FACING-data.patch diff --git a/patches/unapplied/server/Drop-carried-item-when-player-has-disconnected.patch b/patches/server/Drop-carried-item-when-player-has-disconnected.patch similarity index 100% rename from patches/unapplied/server/Drop-carried-item-when-player-has-disconnected.patch rename to patches/server/Drop-carried-item-when-player-has-disconnected.patch diff --git a/patches/unapplied/server/Eigencraft-redstone-implementation.patch b/patches/server/Eigencraft-redstone-implementation.patch similarity index 100% rename from patches/unapplied/server/Eigencraft-redstone-implementation.patch rename to patches/server/Eigencraft-redstone-implementation.patch diff --git a/patches/unapplied/server/Empty-commands-shall-not-be-dispatched.patch b/patches/server/Empty-commands-shall-not-be-dispatched.patch similarity index 100% rename from patches/unapplied/server/Empty-commands-shall-not-be-dispatched.patch rename to patches/server/Empty-commands-shall-not-be-dispatched.patch diff --git a/patches/unapplied/server/Enhance-console-tab-completions-for-brigadier-comman.patch b/patches/server/Enhance-console-tab-completions-for-brigadier-comman.patch similarity index 100% rename from patches/unapplied/server/Enhance-console-tab-completions-for-brigadier-comman.patch rename to patches/server/Enhance-console-tab-completions-for-brigadier-comman.patch diff --git a/patches/unapplied/server/Ensure-disconnect-for-book-edit-is-called-on-main.patch b/patches/server/Ensure-disconnect-for-book-edit-is-called-on-main.patch similarity index 100% rename from patches/unapplied/server/Ensure-disconnect-for-book-edit-is-called-on-main.patch rename to patches/server/Ensure-disconnect-for-book-edit-is-called-on-main.patch diff --git a/patches/unapplied/server/Entity-isTicking.patch b/patches/server/Entity-isTicking.patch similarity index 100% rename from patches/unapplied/server/Entity-isTicking.patch rename to patches/server/Entity-isTicking.patch diff --git a/patches/unapplied/server/Entity-load-save-limit-per-chunk.patch b/patches/server/Entity-load-save-limit-per-chunk.patch similarity index 99% rename from patches/unapplied/server/Entity-load-save-limit-per-chunk.patch rename to patches/server/Entity-load-save-limit-per-chunk.patch index 9be1a5b836..e8c3c107c5 100644 --- a/patches/unapplied/server/Entity-load-save-limit-per-chunk.patch +++ b/patches/server/Entity-load-save-limit-per-chunk.patch @@ -38,8 +38,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/level/chunk/storage/EntityStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/EntityStorage.java @@ -0,0 +0,0 @@ public class EntityStorage implements EntityPersistentStorage { - return null; } + ListTag listTag = new ListTag(); + final java.util.Map, Integer> savedEntityCounts = new java.util.HashMap<>(); // Paper entities.forEach((entity) -> { // diff here: use entities parameter diff --git a/patches/unapplied/server/EntityMoveEvent.patch b/patches/server/EntityMoveEvent.patch similarity index 92% rename from patches/unapplied/server/EntityMoveEvent.patch rename to patches/server/EntityMoveEvent.patch index b4c6347d1b..4bfa11d82c 100644 --- a/patches/unapplied/server/EntityMoveEvent.patch +++ b/patches/server/EntityMoveEvent.patch @@ -13,9 +13,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 ServerLevel worldserver = (ServerLevel) iterator.next(); worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper + worldserver.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - net.minecraft.world.level.block.entity.HopperBlockEntity.skipHopperEvents = worldserver.paperConfig().hopper.disableMoveEvent || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper this.profiler.push(() -> { + return worldserver + " " + worldserver.dimension().location(); diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -32,7 +32,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/ma index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { +@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { this.pushEntities(); this.level.getProfiler().pop(); @@ -51,5 +51,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + // Paper end if (!this.level.isClientSide && this.isSensitiveToWater() && this.isInWaterRainOrBubble()) { - this.hurt(DamageSource.DROWN, 1.0F); + this.hurt(this.damageSources().drown(), 1.0F); } diff --git a/patches/unapplied/server/Expand-world-key-API.patch b/patches/server/Expand-world-key-API.patch similarity index 100% rename from patches/unapplied/server/Expand-world-key-API.patch rename to patches/server/Expand-world-key-API.patch diff --git a/patches/unapplied/server/Expose-LivingEntity-hurt-direction.patch b/patches/server/Expose-LivingEntity-hurt-direction.patch similarity index 100% rename from patches/unapplied/server/Expose-LivingEntity-hurt-direction.patch rename to patches/server/Expose-LivingEntity-hurt-direction.patch diff --git a/patches/unapplied/server/Expose-Tracked-Players.patch b/patches/server/Expose-Tracked-Players.patch similarity index 100% rename from patches/unapplied/server/Expose-Tracked-Players.patch rename to patches/server/Expose-Tracked-Players.patch diff --git a/patches/unapplied/server/Expose-protocol-version.patch b/patches/server/Expose-protocol-version.patch similarity index 100% rename from patches/unapplied/server/Expose-protocol-version.patch rename to patches/server/Expose-protocol-version.patch diff --git a/patches/unapplied/server/Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch b/patches/server/Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch similarity index 100% rename from patches/unapplied/server/Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch rename to patches/server/Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch diff --git a/patches/unapplied/server/Expose-world-spawn-angle.patch b/patches/server/Expose-world-spawn-angle.patch similarity index 100% rename from patches/unapplied/server/Expose-world-spawn-angle.patch rename to patches/server/Expose-world-spawn-angle.patch diff --git a/patches/unapplied/server/Extend-block-drop-capture-to-capture-all-items-added.patch b/patches/server/Extend-block-drop-capture-to-capture-all-items-added.patch similarity index 100% rename from patches/unapplied/server/Extend-block-drop-capture-to-capture-all-items-added.patch rename to patches/server/Extend-block-drop-capture-to-capture-all-items-added.patch diff --git a/patches/unapplied/server/Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch b/patches/server/Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch similarity index 96% rename from patches/unapplied/server/Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch rename to patches/server/Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch index 92be8d7628..935106ac41 100644 --- a/patches/unapplied/server/Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch +++ b/patches/server/Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch @@ -64,11 +64,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/PlayerAdvancements.java +++ b/src/main/java/net/minecraft/server/PlayerAdvancements.java @@ -0,0 +0,0 @@ public class PlayerAdvancements { + @Nullable private Advancement lastSelectedTab; private boolean isFirstPacket = true; - + public final Map> criterionData = Maps.newIdentityHashMap(); // Paper - fix advancement data player leakage -+ - public PlayerAdvancements(DataFixer dataFixer, PlayerList playerManager, ServerAdvancementManager advancementLoader, File advancementFile, ServerPlayer owner) { + + public PlayerAdvancements(DataFixer dataFixer, PlayerList playerManager, ServerAdvancementManager advancementLoader, Path filePath, ServerPlayer owner) { this.dataFixer = dataFixer; - this.playerList = playerManager; diff --git a/patches/unapplied/server/Fix-Concurrency-issue-in-ShufflingList.patch b/patches/server/Fix-Concurrency-issue-in-ShufflingList.patch similarity index 100% rename from patches/unapplied/server/Fix-Concurrency-issue-in-ShufflingList.patch rename to patches/server/Fix-Concurrency-issue-in-ShufflingList.patch diff --git a/patches/unapplied/server/Fix-CraftPotionBrewer-cache.patch b/patches/server/Fix-CraftPotionBrewer-cache.patch similarity index 100% rename from patches/unapplied/server/Fix-CraftPotionBrewer-cache.patch rename to patches/server/Fix-CraftPotionBrewer-cache.patch diff --git a/patches/unapplied/server/Fix-CraftSound-backwards-compatibility.patch b/patches/server/Fix-CraftSound-backwards-compatibility.patch similarity index 100% rename from patches/unapplied/server/Fix-CraftSound-backwards-compatibility.patch rename to patches/server/Fix-CraftSound-backwards-compatibility.patch diff --git a/patches/unapplied/server/Fix-CraftTeam-null-check.patch b/patches/server/Fix-CraftTeam-null-check.patch similarity index 100% rename from patches/unapplied/server/Fix-CraftTeam-null-check.patch rename to patches/server/Fix-CraftTeam-null-check.patch diff --git a/patches/unapplied/server/Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch b/patches/server/Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch similarity index 99% rename from patches/unapplied/server/Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch rename to patches/server/Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch index 4cbf3d98f1..cc5dee0d2a 100644 --- a/patches/unapplied/server/Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch +++ b/patches/server/Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch @@ -27,7 +27,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.awaitingTeleportTime = this.tickCount; - this.player.absMoveTo(d0, d1, d2, f, f1); + this.player.moveTo(d0, d1, d2, f, f1); // Paper - use proper moveTo for teleportation - this.player.connection.send(new ClientboundPlayerPositionPacket(d0 - d3, d1 - d4, d2 - d5, f - f2, f1 - f3, set, this.awaitingTeleport, flag)); + this.player.connection.send(new ClientboundPlayerPositionPacket(d0 - d3, d1 - d4, d2 - d5, f - f2, f1 - f3, set, this.awaitingTeleport)); } diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/patches/unapplied/server/Fix-GameProfileCache-concurrency.patch b/patches/server/Fix-GameProfileCache-concurrency.patch similarity index 100% rename from patches/unapplied/server/Fix-GameProfileCache-concurrency.patch rename to patches/server/Fix-GameProfileCache-concurrency.patch diff --git a/patches/unapplied/server/Fix-Not-a-string-Map-Conversion-spam.patch b/patches/server/Fix-Not-a-string-Map-Conversion-spam.patch similarity index 100% rename from patches/unapplied/server/Fix-Not-a-string-Map-Conversion-spam.patch rename to patches/server/Fix-Not-a-string-Map-Conversion-spam.patch diff --git a/patches/unapplied/server/Fix-Player-spawnParticle-x-y-z-precision-loss.patch b/patches/server/Fix-Player-spawnParticle-x-y-z-precision-loss.patch similarity index 100% rename from patches/unapplied/server/Fix-Player-spawnParticle-x-y-z-precision-loss.patch rename to patches/server/Fix-Player-spawnParticle-x-y-z-precision-loss.patch diff --git a/patches/unapplied/server/Fix-PlayerBucketEmptyEvent-result-itemstack.patch b/patches/server/Fix-PlayerBucketEmptyEvent-result-itemstack.patch similarity index 100% rename from patches/unapplied/server/Fix-PlayerBucketEmptyEvent-result-itemstack.patch rename to patches/server/Fix-PlayerBucketEmptyEvent-result-itemstack.patch diff --git a/patches/unapplied/server/Fix-PlayerDropItemEvent-using-wrong-item.patch b/patches/server/Fix-PlayerDropItemEvent-using-wrong-item.patch similarity index 100% rename from patches/unapplied/server/Fix-PlayerDropItemEvent-using-wrong-item.patch rename to patches/server/Fix-PlayerDropItemEvent-using-wrong-item.patch diff --git a/patches/unapplied/server/Fix-PlayerItemConsumeEvent-cancelling-properly.patch b/patches/server/Fix-PlayerItemConsumeEvent-cancelling-properly.patch similarity index 98% rename from patches/unapplied/server/Fix-PlayerItemConsumeEvent-cancelling-properly.patch rename to patches/server/Fix-PlayerItemConsumeEvent-cancelling-properly.patch index 097707a6fa..9b06f63c34 100644 --- a/patches/unapplied/server/Fix-PlayerItemConsumeEvent-cancelling-properly.patch +++ b/patches/server/Fix-PlayerItemConsumeEvent-cancelling-properly.patch @@ -12,7 +12,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/ma index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { +@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { level.getCraftServer().getPluginManager().callEvent(event); if (event.isCancelled()) { diff --git a/patches/unapplied/server/Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch b/patches/server/Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch similarity index 100% rename from patches/unapplied/server/Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch rename to patches/server/Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch diff --git a/patches/unapplied/server/Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch b/patches/server/Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch similarity index 100% rename from patches/unapplied/server/Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch rename to patches/server/Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch diff --git a/patches/unapplied/server/Fix-and-optimise-world-force-upgrading.patch b/patches/server/Fix-and-optimise-world-force-upgrading.patch similarity index 100% rename from patches/unapplied/server/Fix-and-optimise-world-force-upgrading.patch rename to patches/server/Fix-and-optimise-world-force-upgrading.patch diff --git a/patches/unapplied/server/Fix-client-lag-on-advancement-loading.patch b/patches/server/Fix-client-lag-on-advancement-loading.patch similarity index 100% rename from patches/unapplied/server/Fix-client-lag-on-advancement-loading.patch rename to patches/server/Fix-client-lag-on-advancement-loading.patch diff --git a/patches/unapplied/server/Fix-commands-from-signs-not-firing-command-events.patch b/patches/server/Fix-commands-from-signs-not-firing-command-events.patch similarity index 100% rename from patches/unapplied/server/Fix-commands-from-signs-not-firing-command-events.patch rename to patches/server/Fix-commands-from-signs-not-firing-command-events.patch diff --git a/patches/unapplied/server/Fix-curing-zombie-villager-discount-exploit.patch b/patches/server/Fix-curing-zombie-villager-discount-exploit.patch similarity index 100% rename from patches/unapplied/server/Fix-curing-zombie-villager-discount-exploit.patch rename to patches/server/Fix-curing-zombie-villager-discount-exploit.patch diff --git a/patches/unapplied/server/Fix-dangerous-end-portal-logic.patch b/patches/server/Fix-dangerous-end-portal-logic.patch similarity index 100% rename from patches/unapplied/server/Fix-dangerous-end-portal-logic.patch rename to patches/server/Fix-dangerous-end-portal-logic.patch diff --git a/patches/unapplied/server/Fix-deop-kicking-non-whitelisted-player-when-white-l.patch b/patches/server/Fix-deop-kicking-non-whitelisted-player-when-white-l.patch similarity index 100% rename from patches/unapplied/server/Fix-deop-kicking-non-whitelisted-player-when-white-l.patch rename to patches/server/Fix-deop-kicking-non-whitelisted-player-when-white-l.patch diff --git a/patches/unapplied/server/Fix-for-large-move-vectors-crashing-server.patch b/patches/server/Fix-for-large-move-vectors-crashing-server.patch similarity index 100% rename from patches/unapplied/server/Fix-for-large-move-vectors-crashing-server.patch rename to patches/server/Fix-for-large-move-vectors-crashing-server.patch diff --git a/patches/unapplied/server/Fix-harming-potion-dupe.patch b/patches/server/Fix-harming-potion-dupe.patch similarity index 100% rename from patches/unapplied/server/Fix-harming-potion-dupe.patch rename to patches/server/Fix-harming-potion-dupe.patch diff --git a/patches/unapplied/server/Fix-hex-colors-not-working-in-some-kick-messages.patch b/patches/server/Fix-hex-colors-not-working-in-some-kick-messages.patch similarity index 100% rename from patches/unapplied/server/Fix-hex-colors-not-working-in-some-kick-messages.patch rename to patches/server/Fix-hex-colors-not-working-in-some-kick-messages.patch diff --git a/patches/unapplied/server/Fix-incorrect-message-for-outdated-client.patch b/patches/server/Fix-incorrect-message-for-outdated-client.patch similarity index 100% rename from patches/unapplied/server/Fix-incorrect-message-for-outdated-client.patch rename to patches/server/Fix-incorrect-message-for-outdated-client.patch diff --git a/patches/unapplied/server/Fix-incosistency-issue-with-empty-map-items-in-CB.patch b/patches/server/Fix-incosistency-issue-with-empty-map-items-in-CB.patch similarity index 100% rename from patches/unapplied/server/Fix-incosistency-issue-with-empty-map-items-in-CB.patch rename to patches/server/Fix-incosistency-issue-with-empty-map-items-in-CB.patch diff --git a/patches/unapplied/server/Fix-interact-event-not-being-called-in-adventure.patch b/patches/server/Fix-interact-event-not-being-called-in-adventure.patch similarity index 100% rename from patches/unapplied/server/Fix-interact-event-not-being-called-in-adventure.patch rename to patches/server/Fix-interact-event-not-being-called-in-adventure.patch diff --git a/patches/unapplied/server/Fix-invulnerable-end-crystals.patch b/patches/server/Fix-invulnerable-end-crystals.patch similarity index 100% rename from patches/unapplied/server/Fix-invulnerable-end-crystals.patch rename to patches/server/Fix-invulnerable-end-crystals.patch diff --git a/patches/unapplied/server/Fix-issues-with-mob-conversion.patch b/patches/server/Fix-issues-with-mob-conversion.patch similarity index 100% rename from patches/unapplied/server/Fix-issues-with-mob-conversion.patch rename to patches/server/Fix-issues-with-mob-conversion.patch diff --git a/patches/unapplied/server/Fix-item-locations-dropped-from-campfires.patch b/patches/server/Fix-item-locations-dropped-from-campfires.patch similarity index 100% rename from patches/unapplied/server/Fix-item-locations-dropped-from-campfires.patch rename to patches/server/Fix-item-locations-dropped-from-campfires.patch diff --git a/patches/unapplied/server/Fix-nerfed-slime-when-splitting.patch b/patches/server/Fix-nerfed-slime-when-splitting.patch similarity index 100% rename from patches/unapplied/server/Fix-nerfed-slime-when-splitting.patch rename to patches/server/Fix-nerfed-slime-when-splitting.patch diff --git a/patches/unapplied/server/Fix-potions-splash-events.patch b/patches/server/Fix-potions-splash-events.patch similarity index 96% rename from patches/unapplied/server/Fix-potions-splash-events.patch rename to patches/server/Fix-potions-splash-events.patch index 921726d63d..ce47191325 100644 --- a/patches/unapplied/server/Fix-potions-splash-events.patch +++ b/patches/server/Fix-potions-splash-events.patch @@ -60,7 +60,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (d0 < 16.0D) { if (entityliving.isSensitiveToWater()) { -- entityliving.hurt(DamageSource.indirectMagic(this, this.getOwner()), 1.0F); +- entityliving.hurt(this.damageSources().indirectMagic(this, this.getOwner()), 1.0F); + affected.put(entityliving.getBukkitLivingEntity(), 1.0); } @@ -83,7 +83,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + ); + if (event.callEvent()) { + for (LivingEntity affectedEntity : event.getToDamage()) { -+ ((CraftLivingEntity) affectedEntity).getHandle().hurt(DamageSource.indirectMagic(this, this.getOwner()), 1.0F); ++ ((CraftLivingEntity) affectedEntity).getHandle().hurt(this.damageSources().indirectMagic(this, this.getOwner()), 1.0F); + } + for (LivingEntity toExtinguish : event.getToExtinguish()) { + ((CraftLivingEntity) toExtinguish).getHandle().extinguishFire(); @@ -105,13 +105,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 List list1 = this.level.getEntitiesOfClass(net.minecraft.world.entity.LivingEntity.class, axisalignedbb); Map affected = new HashMap(); // CraftBukkit @@ -0,0 +0,0 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie - double d0 = this.distanceToSqr((Entity) entityliving); - if (d0 < 16.0D) { -+ // Paper - diff on change, used when calling the splash event for water splash potions - double d1 = 1.0D - Math.sqrt(d0) / 4.0D; + double d1; ++ // Paper - diff on change, used when calling the splash event for water splash potions if (entityliving == entity) { + d1 = 1.0D; + } else { @@ -0,0 +0,0 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie } } diff --git a/patches/unapplied/server/Fix-regex-mistake-in-CB-NBT-int-deserialization.patch b/patches/server/Fix-regex-mistake-in-CB-NBT-int-deserialization.patch similarity index 100% rename from patches/unapplied/server/Fix-regex-mistake-in-CB-NBT-int-deserialization.patch rename to patches/server/Fix-regex-mistake-in-CB-NBT-int-deserialization.patch diff --git a/patches/unapplied/server/Fix-return-value-of-Block-applyBoneMeal-always-being.patch b/patches/server/Fix-return-value-of-Block-applyBoneMeal-always-being.patch similarity index 100% rename from patches/unapplied/server/Fix-return-value-of-Block-applyBoneMeal-always-being.patch rename to patches/server/Fix-return-value-of-Block-applyBoneMeal-always-being.patch diff --git a/patches/unapplied/server/Fix-some-rails-connecting-improperly.patch b/patches/server/Fix-some-rails-connecting-improperly.patch similarity index 100% rename from patches/unapplied/server/Fix-some-rails-connecting-improperly.patch rename to patches/server/Fix-some-rails-connecting-improperly.patch diff --git a/patches/unapplied/server/Fix-test-not-bootstrapping.patch b/patches/server/Fix-test-not-bootstrapping.patch similarity index 100% rename from patches/unapplied/server/Fix-test-not-bootstrapping.patch rename to patches/server/Fix-test-not-bootstrapping.patch diff --git a/patches/unapplied/server/Fix-villager-boat-exploit.patch b/patches/server/Fix-villager-boat-exploit.patch similarity index 100% rename from patches/unapplied/server/Fix-villager-boat-exploit.patch rename to patches/server/Fix-villager-boat-exploit.patch diff --git a/patches/unapplied/server/Fixed-TileEntityBell-memory-leak.patch b/patches/server/Fixed-TileEntityBell-memory-leak.patch similarity index 100% rename from patches/unapplied/server/Fixed-TileEntityBell-memory-leak.patch rename to patches/server/Fixed-TileEntityBell-memory-leak.patch diff --git a/patches/unapplied/server/Fixes-kick-event-leave-message-not-being-sent.patch b/patches/server/Fixes-kick-event-leave-message-not-being-sent.patch similarity index 100% rename from patches/unapplied/server/Fixes-kick-event-leave-message-not-being-sent.patch rename to patches/server/Fixes-kick-event-leave-message-not-being-sent.patch diff --git a/patches/unapplied/server/Get-entity-default-attributes.patch b/patches/server/Get-entity-default-attributes.patch similarity index 100% rename from patches/unapplied/server/Get-entity-default-attributes.patch rename to patches/server/Get-entity-default-attributes.patch diff --git a/patches/unapplied/server/Goat-ram-API.patch b/patches/server/Goat-ram-API.patch similarity index 100% rename from patches/unapplied/server/Goat-ram-API.patch rename to patches/server/Goat-ram-API.patch diff --git a/patches/unapplied/server/Implement-API-to-expose-exact-interaction-point.patch b/patches/server/Implement-API-to-expose-exact-interaction-point.patch similarity index 100% rename from patches/unapplied/server/Implement-API-to-expose-exact-interaction-point.patch rename to patches/server/Implement-API-to-expose-exact-interaction-point.patch diff --git a/patches/unapplied/server/Implement-API-to-get-Material-from-Boats-and-Minecar.patch b/patches/server/Implement-API-to-get-Material-from-Boats-and-Minecar.patch similarity index 100% rename from patches/unapplied/server/Implement-API-to-get-Material-from-Boats-and-Minecar.patch rename to patches/server/Implement-API-to-get-Material-from-Boats-and-Minecar.patch diff --git a/patches/unapplied/server/Implement-BlockPreDispenseEvent.patch b/patches/server/Implement-BlockPreDispenseEvent.patch similarity index 100% rename from patches/unapplied/server/Implement-BlockPreDispenseEvent.patch rename to patches/server/Implement-BlockPreDispenseEvent.patch diff --git a/patches/unapplied/server/Implement-PlayerFlowerPotManipulateEvent.patch b/patches/server/Implement-PlayerFlowerPotManipulateEvent.patch similarity index 100% rename from patches/unapplied/server/Implement-PlayerFlowerPotManipulateEvent.patch rename to patches/server/Implement-PlayerFlowerPotManipulateEvent.patch diff --git a/patches/unapplied/server/Implement-TargetHitEvent.patch b/patches/server/Implement-TargetHitEvent.patch similarity index 100% rename from patches/unapplied/server/Implement-TargetHitEvent.patch rename to patches/server/Implement-TargetHitEvent.patch diff --git a/patches/unapplied/server/Implement-methods-to-convert-between-Component-and-B.patch b/patches/server/Implement-methods-to-convert-between-Component-and-B.patch similarity index 100% rename from patches/unapplied/server/Implement-methods-to-convert-between-Component-and-B.patch rename to patches/server/Implement-methods-to-convert-between-Component-and-B.patch diff --git a/patches/unapplied/server/Implemented-BlockFailedDispenseEvent.patch b/patches/server/Implemented-BlockFailedDispenseEvent.patch similarity index 100% rename from patches/unapplied/server/Implemented-BlockFailedDispenseEvent.patch rename to patches/server/Implemented-BlockFailedDispenseEvent.patch diff --git a/patches/unapplied/server/Improve-ServerGUI.patch b/patches/server/Improve-ServerGUI.patch similarity index 100% rename from patches/unapplied/server/Improve-ServerGUI.patch rename to patches/server/Improve-ServerGUI.patch diff --git a/patches/unapplied/server/Improve-boat-collision-performance.patch b/patches/server/Improve-boat-collision-performance.patch similarity index 94% rename from patches/unapplied/server/Improve-boat-collision-performance.patch rename to patches/server/Improve-boat-collision-performance.patch index 500835a969..d5c7b5a60a 100644 --- a/patches/unapplied/server/Improve-boat-collision-performance.patch +++ b/patches/server/Improve-boat-collision-performance.patch @@ -20,8 +20,8 @@ diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/ma index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { - if (!source.isProjectile()) { +@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { + if (!source.is(DamageTypeTags.IS_PROJECTILE)) { Entity entity = source.getDirectEntity(); - if (entity instanceof LivingEntity) { @@ -29,10 +29,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 LivingEntity entityliving = (LivingEntity) entity; this.blockUsingShield(entityliving); -@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { +@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { } - if (entity1 != null && !source.isExplosion()) { + if (entity1 != null && !source.is(DamageTypeTags.IS_EXPLOSION)) { - double d0 = entity1.getX() - this.getX(); + final boolean far = entity1.distanceToSqr(this) > (200.0 * 200.0); // Paper + double d0 = far ? (Math.random() - Math.random()) : entity1.getX() - this.getX(); // Paper @@ -44,7 +44,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 d0 = (Math.random() - Math.random()) * 0.01D; } -@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { +@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { this.hurtCurrentlyUsedShield((float) -event.getDamage(DamageModifier.BLOCKING)); Entity entity = damagesource.getDirectEntity(); diff --git a/patches/unapplied/server/Inline-shift-direction-fields.patch b/patches/server/Inline-shift-direction-fields.patch similarity index 100% rename from patches/unapplied/server/Inline-shift-direction-fields.patch rename to patches/server/Inline-shift-direction-fields.patch diff --git a/patches/unapplied/server/Introduce-beacon-activation-deactivation-events.patch b/patches/server/Introduce-beacon-activation-deactivation-events.patch similarity index 100% rename from patches/unapplied/server/Introduce-beacon-activation-deactivation-events.patch rename to patches/server/Introduce-beacon-activation-deactivation-events.patch diff --git a/patches/unapplied/server/Inventory-close.patch b/patches/server/Inventory-close.patch similarity index 100% rename from patches/unapplied/server/Inventory-close.patch rename to patches/server/Inventory-close.patch diff --git a/patches/unapplied/server/Item-Rarity-API.patch b/patches/server/Item-Rarity-API.patch similarity index 100% rename from patches/unapplied/server/Item-Rarity-API.patch rename to patches/server/Item-Rarity-API.patch diff --git a/patches/unapplied/server/Item-no-age-no-player-pickup.patch b/patches/server/Item-no-age-no-player-pickup.patch similarity index 100% rename from patches/unapplied/server/Item-no-age-no-player-pickup.patch rename to patches/server/Item-no-age-no-player-pickup.patch diff --git a/patches/unapplied/server/ItemStack-repair-check-API.patch b/patches/server/ItemStack-repair-check-API.patch similarity index 100% rename from patches/unapplied/server/ItemStack-repair-check-API.patch rename to patches/server/ItemStack-repair-check-API.patch diff --git a/patches/unapplied/server/Lazily-track-plugin-scoreboards-by-default.patch b/patches/server/Lazily-track-plugin-scoreboards-by-default.patch similarity index 100% rename from patches/unapplied/server/Lazily-track-plugin-scoreboards-by-default.patch rename to patches/server/Lazily-track-plugin-scoreboards-by-default.patch diff --git a/patches/unapplied/server/Left-handed-API.patch b/patches/server/Left-handed-API.patch similarity index 100% rename from patches/unapplied/server/Left-handed-API.patch rename to patches/server/Left-handed-API.patch diff --git a/patches/unapplied/server/Limit-item-frame-cursors-on-maps.patch b/patches/server/Limit-item-frame-cursors-on-maps.patch similarity index 100% rename from patches/unapplied/server/Limit-item-frame-cursors-on-maps.patch rename to patches/server/Limit-item-frame-cursors-on-maps.patch diff --git a/patches/unapplied/server/Limit-recipe-packets.patch b/patches/server/Limit-recipe-packets.patch similarity index 100% rename from patches/unapplied/server/Limit-recipe-packets.patch rename to patches/server/Limit-recipe-packets.patch diff --git a/patches/unapplied/server/Line-Of-Sight-Changes.patch b/patches/server/Line-Of-Sight-Changes.patch similarity index 99% rename from patches/unapplied/server/Line-Of-Sight-Changes.patch rename to patches/server/Line-Of-Sight-Changes.patch index 495c400470..9d4ceb4422 100644 --- a/patches/unapplied/server/Line-Of-Sight-Changes.patch +++ b/patches/server/Line-Of-Sight-Changes.patch @@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/ma index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { +@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { Vec3 vec3d = new Vec3(this.getX(), this.getEyeY(), this.getZ()); Vec3 vec3d1 = new Vec3(entity.getX(), entity.getEyeY(), entity.getZ()); diff --git a/patches/unapplied/server/Log-when-the-async-catcher-is-tripped.patch b/patches/server/Log-when-the-async-catcher-is-tripped.patch similarity index 100% rename from patches/unapplied/server/Log-when-the-async-catcher-is-tripped.patch rename to patches/server/Log-when-the-async-catcher-is-tripped.patch diff --git a/patches/unapplied/server/MC-4-Fix-item-position-desync.patch b/patches/server/MC-4-Fix-item-position-desync.patch similarity index 100% rename from patches/unapplied/server/MC-4-Fix-item-position-desync.patch rename to patches/server/MC-4-Fix-item-position-desync.patch diff --git a/patches/unapplied/server/Make-EntityUnleashEvent-cancellable.patch b/patches/server/Make-EntityUnleashEvent-cancellable.patch similarity index 96% rename from patches/unapplied/server/Make-EntityUnleashEvent-cancellable.patch rename to patches/server/Make-EntityUnleashEvent-cancellable.patch index 8e11c44bf1..b6586e5795 100644 --- a/patches/unapplied/server/Make-EntityUnleashEvent-cancellable.patch +++ b/patches/server/Make-EntityUnleashEvent-cancellable.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 { +@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements Targeting { if (flag1 && this.isLeashed()) { // Paper start - drop leash variable EntityUnleashEvent event = new EntityUnleashEvent(this.getBukkitEntity(), UnleashReason.UNKNOWN, true); diff --git a/patches/unapplied/server/Make-hoppers-respect-inventory-max-stack-size.patch b/patches/server/Make-hoppers-respect-inventory-max-stack-size.patch similarity index 94% rename from patches/unapplied/server/Make-hoppers-respect-inventory-max-stack-size.patch rename to patches/server/Make-hoppers-respect-inventory-max-stack-size.patch index 4056d279c9..5c870950b9 100644 --- a/patches/unapplied/server/Make-hoppers-respect-inventory-max-stack-size.patch +++ b/patches/server/Make-hoppers-respect-inventory-max-stack-size.patch @@ -18,9 +18,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 stack = stack.split(to.getMaxStackSize()); } // Spigot end - ignoreTileUpdates = true; // Paper to.setItem(slot, stack); - ignoreTileUpdates = false; // Paper - stack = ItemStack.EMPTY; + stack = leftover; // Paper flag = true; diff --git a/patches/unapplied/server/Make-item-validations-configurable.patch b/patches/server/Make-item-validations-configurable.patch similarity index 100% rename from patches/unapplied/server/Make-item-validations-configurable.patch rename to patches/server/Make-item-validations-configurable.patch diff --git a/patches/unapplied/server/Make-schedule-command-per-world.patch b/patches/server/Make-schedule-command-per-world.patch similarity index 100% rename from patches/unapplied/server/Make-schedule-command-per-world.patch rename to patches/server/Make-schedule-command-per-world.patch diff --git a/patches/unapplied/server/Merchant-getRecipes-should-return-an-immutable-list.patch b/patches/server/Merchant-getRecipes-should-return-an-immutable-list.patch similarity index 100% rename from patches/unapplied/server/Merchant-getRecipes-should-return-an-immutable-list.patch rename to patches/server/Merchant-getRecipes-should-return-an-immutable-list.patch diff --git a/patches/unapplied/server/Missing-Entity-Behavior-API.patch b/patches/server/Missing-Entity-Behavior-API.patch similarity index 100% rename from patches/unapplied/server/Missing-Entity-Behavior-API.patch rename to patches/server/Missing-Entity-Behavior-API.patch diff --git a/patches/unapplied/server/More-CommandBlock-API.patch b/patches/server/More-CommandBlock-API.patch similarity index 100% rename from patches/unapplied/server/More-CommandBlock-API.patch rename to patches/server/More-CommandBlock-API.patch diff --git a/patches/unapplied/server/More-Enchantment-API.patch b/patches/server/More-Enchantment-API.patch similarity index 100% rename from patches/unapplied/server/More-Enchantment-API.patch rename to patches/server/More-Enchantment-API.patch diff --git a/patches/unapplied/server/More-Lidded-Block-API.patch b/patches/server/More-Lidded-Block-API.patch similarity index 100% rename from patches/unapplied/server/More-Lidded-Block-API.patch rename to patches/server/More-Lidded-Block-API.patch diff --git a/patches/unapplied/server/More-World-API.patch b/patches/server/More-World-API.patch similarity index 100% rename from patches/unapplied/server/More-World-API.patch rename to patches/server/More-World-API.patch diff --git a/patches/unapplied/server/More-lightning-API.patch b/patches/server/More-lightning-API.patch similarity index 100% rename from patches/unapplied/server/More-lightning-API.patch rename to patches/server/More-lightning-API.patch diff --git a/patches/unapplied/server/Move-range-check-for-block-placing-up.patch b/patches/server/Move-range-check-for-block-placing-up.patch similarity index 100% rename from patches/unapplied/server/Move-range-check-for-block-placing-up.patch rename to patches/server/Move-range-check-for-block-placing-up.patch diff --git a/patches/unapplied/server/Optimise-getType-calls.patch b/patches/server/Optimise-getType-calls.patch similarity index 100% rename from patches/unapplied/server/Optimise-getType-calls.patch rename to patches/server/Optimise-getType-calls.patch diff --git a/patches/unapplied/server/Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch b/patches/server/Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch similarity index 100% rename from patches/unapplied/server/Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch rename to patches/server/Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch diff --git a/patches/unapplied/server/Optimize-Dynamic-get-Missing-Keys.patch b/patches/server/Optimize-Dynamic-get-Missing-Keys.patch similarity index 86% rename from patches/unapplied/server/Optimize-Dynamic-get-Missing-Keys.patch rename to patches/server/Optimize-Dynamic-get-Missing-Keys.patch index 36cdf340c3..0a4731bec6 100644 --- a/patches/unapplied/server/Optimize-Dynamic-get-Missing-Keys.patch +++ b/patches/server/Optimize-Dynamic-get-Missing-Keys.patch @@ -27,8 +27,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return new OptionalDynamic<>(ops, ops.getMap(value).flatMap(m -> { final T value = m.get(key); if (value == null) { -- return DataResult.error("key missing: " + key + " in " + this.value); -+ return DataResult.error(DEBUG_MISSING_KEYS ? "key missing: " + key + " in " + this.value : "key missing: " + key); // Paper +- return DataResult.error(() -> "key missing: " + key + " in " + this.value); ++ return DataResult.error(() -> DEBUG_MISSING_KEYS ? "key missing: " + key + " in " + this.value : "key missing: " + key); // Paper } return DataResult.success(new Dynamic<>(ops, value)); })); diff --git a/patches/unapplied/server/Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch b/patches/server/Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch similarity index 100% rename from patches/unapplied/server/Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch rename to patches/server/Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch diff --git a/patches/unapplied/server/Optimize-entity-tracker-passenger-checks.patch b/patches/server/Optimize-entity-tracker-passenger-checks.patch similarity index 100% rename from patches/unapplied/server/Optimize-entity-tracker-passenger-checks.patch rename to patches/server/Optimize-entity-tracker-passenger-checks.patch diff --git a/patches/unapplied/server/Optimize-indirect-passenger-iteration.patch b/patches/server/Optimize-indirect-passenger-iteration.patch similarity index 100% rename from patches/unapplied/server/Optimize-indirect-passenger-iteration.patch rename to patches/server/Optimize-indirect-passenger-iteration.patch diff --git a/patches/unapplied/server/Option-to-prevent-NBT-copy-in-smithing-recipes.patch b/patches/server/Option-to-prevent-NBT-copy-in-smithing-recipes.patch similarity index 69% rename from patches/unapplied/server/Option-to-prevent-NBT-copy-in-smithing-recipes.patch rename to patches/server/Option-to-prevent-NBT-copy-in-smithing-recipes.patch index ecb51c3e0d..dda82b18c4 100644 --- a/patches/unapplied/server/Option-to-prevent-NBT-copy-in-smithing-recipes.patch +++ b/patches/server/Option-to-prevent-NBT-copy-in-smithing-recipes.patch @@ -4,31 +4,31 @@ Date: Sun, 26 Sep 2021 12:57:28 -0700 Subject: [PATCH] Option to prevent NBT copy in smithing recipes -diff --git a/src/main/java/net/minecraft/world/item/crafting/UpgradeRecipe.java b/src/main/java/net/minecraft/world/item/crafting/UpgradeRecipe.java +diff --git a/src/main/java/net/minecraft/world/item/crafting/LegacyUpgradeRecipe.java b/src/main/java/net/minecraft/world/item/crafting/LegacyUpgradeRecipe.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/item/crafting/UpgradeRecipe.java -+++ b/src/main/java/net/minecraft/world/item/crafting/UpgradeRecipe.java -@@ -0,0 +0,0 @@ public class UpgradeRecipe implements net.minecraft.world.item.crafting.Recipe getTypeKey(); - protected Level(WritableLevelData worlddatamutable, ResourceKey resourcekey, Holder holder, Supplier supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function paperWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor + protected Level(WritableLevelData worlddatamutable, ResourceKey resourcekey, RegistryAccess iregistrycustom, Holder holder, Supplier supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function paperWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor diff --git a/src/main/java/net/minecraft/world/level/gameevent/GameEventDispatcher.java b/src/main/java/net/minecraft/world/level/gameevent/GameEventDispatcher.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/gameevent/GameEventDispatcher.java diff --git a/patches/unapplied/server/Vanilla-command-permission-fixes.patch b/patches/server/Vanilla-command-permission-fixes.patch similarity index 100% rename from patches/unapplied/server/Vanilla-command-permission-fixes.patch rename to patches/server/Vanilla-command-permission-fixes.patch diff --git a/patches/unapplied/server/Villager-resetOffers.patch b/patches/server/Villager-resetOffers.patch similarity index 100% rename from patches/unapplied/server/Villager-resetOffers.patch rename to patches/server/Villager-resetOffers.patch diff --git a/patches/unapplied/server/Zombie-API-breaking-doors.patch b/patches/server/Zombie-API-breaking-doors.patch similarity index 100% rename from patches/unapplied/server/Zombie-API-breaking-doors.patch rename to patches/server/Zombie-API-breaking-doors.patch diff --git a/patches/unapplied/server/add-DragonEggFormEvent.patch b/patches/server/add-DragonEggFormEvent.patch similarity index 100% rename from patches/unapplied/server/add-DragonEggFormEvent.patch rename to patches/server/add-DragonEggFormEvent.patch diff --git a/patches/unapplied/server/add-RespawnFlags-to-PlayerRespawnEvent.patch b/patches/server/add-RespawnFlags-to-PlayerRespawnEvent.patch similarity index 100% rename from patches/unapplied/server/add-RespawnFlags-to-PlayerRespawnEvent.patch rename to patches/server/add-RespawnFlags-to-PlayerRespawnEvent.patch diff --git a/patches/unapplied/server/add-consumeFuel-to-FurnaceBurnEvent.patch b/patches/server/add-consumeFuel-to-FurnaceBurnEvent.patch similarity index 100% rename from patches/unapplied/server/add-consumeFuel-to-FurnaceBurnEvent.patch rename to patches/server/add-consumeFuel-to-FurnaceBurnEvent.patch diff --git a/patches/unapplied/server/add-get-set-drop-chance-to-EntityEquipment.patch b/patches/server/add-get-set-drop-chance-to-EntityEquipment.patch similarity index 100% rename from patches/unapplied/server/add-get-set-drop-chance-to-EntityEquipment.patch rename to patches/server/add-get-set-drop-chance-to-EntityEquipment.patch diff --git a/patches/unapplied/server/add-isDeeplySleeping-to-HumanEntity.patch b/patches/server/add-isDeeplySleeping-to-HumanEntity.patch similarity index 100% rename from patches/unapplied/server/add-isDeeplySleeping-to-HumanEntity.patch rename to patches/server/add-isDeeplySleeping-to-HumanEntity.patch diff --git a/patches/unapplied/server/add-per-world-spawn-limits.patch b/patches/server/add-per-world-spawn-limits.patch similarity index 100% rename from patches/unapplied/server/add-per-world-spawn-limits.patch rename to patches/server/add-per-world-spawn-limits.patch diff --git a/patches/unapplied/server/added-PlayerNameEntityEvent.patch b/patches/server/added-PlayerNameEntityEvent.patch similarity index 100% rename from patches/unapplied/server/added-PlayerNameEntityEvent.patch rename to patches/server/added-PlayerNameEntityEvent.patch diff --git a/patches/unapplied/server/added-option-to-disable-pathfinding-updates-on-block.patch b/patches/server/added-option-to-disable-pathfinding-updates-on-block.patch similarity index 100% rename from patches/unapplied/server/added-option-to-disable-pathfinding-updates-on-block.patch rename to patches/server/added-option-to-disable-pathfinding-updates-on-block.patch diff --git a/patches/unapplied/server/additions-to-PlayerGameModeChangeEvent.patch b/patches/server/additions-to-PlayerGameModeChangeEvent.patch similarity index 100% rename from patches/unapplied/server/additions-to-PlayerGameModeChangeEvent.patch rename to patches/server/additions-to-PlayerGameModeChangeEvent.patch diff --git a/patches/unapplied/server/copy-TESign-isEditable-from-snapshots.patch b/patches/server/copy-TESign-isEditable-from-snapshots.patch similarity index 100% rename from patches/unapplied/server/copy-TESign-isEditable-from-snapshots.patch rename to patches/server/copy-TESign-isEditable-from-snapshots.patch diff --git a/patches/unapplied/server/fix-PigZombieAngerEvent-cancellation.patch b/patches/server/fix-PigZombieAngerEvent-cancellation.patch similarity index 100% rename from patches/unapplied/server/fix-PigZombieAngerEvent-cancellation.patch rename to patches/server/fix-PigZombieAngerEvent-cancellation.patch diff --git a/patches/unapplied/server/fix-PlayerItemHeldEvent-firing-twice.patch b/patches/server/fix-PlayerItemHeldEvent-firing-twice.patch similarity index 100% rename from patches/unapplied/server/fix-PlayerItemHeldEvent-firing-twice.patch rename to patches/server/fix-PlayerItemHeldEvent-firing-twice.patch diff --git a/patches/unapplied/server/fix-converting-txt-to-json-file.patch b/patches/server/fix-converting-txt-to-json-file.patch similarity index 100% rename from patches/unapplied/server/fix-converting-txt-to-json-file.patch rename to patches/server/fix-converting-txt-to-json-file.patch diff --git a/patches/unapplied/server/fix-dead-slime-setSize-invincibility.patch b/patches/server/fix-dead-slime-setSize-invincibility.patch similarity index 100% rename from patches/unapplied/server/fix-dead-slime-setSize-invincibility.patch rename to patches/server/fix-dead-slime-setSize-invincibility.patch diff --git a/patches/unapplied/server/forced-whitelist-use-configurable-kick-message.patch b/patches/server/forced-whitelist-use-configurable-kick-message.patch similarity index 100% rename from patches/unapplied/server/forced-whitelist-use-configurable-kick-message.patch rename to patches/server/forced-whitelist-use-configurable-kick-message.patch diff --git a/patches/unapplied/server/living-entity-allow-attribute-registration.patch b/patches/server/living-entity-allow-attribute-registration.patch similarity index 100% rename from patches/unapplied/server/living-entity-allow-attribute-registration.patch rename to patches/server/living-entity-allow-attribute-registration.patch diff --git a/patches/unapplied/server/stop-firing-pressure-plate-EntityInteractEvent-for-i.patch b/patches/server/stop-firing-pressure-plate-EntityInteractEvent-for-i.patch similarity index 100% rename from patches/unapplied/server/stop-firing-pressure-plate-EntityInteractEvent-for-i.patch rename to patches/server/stop-firing-pressure-plate-EntityInteractEvent-for-i.patch diff --git a/patches/unapplied/server/Fix-block-drops-position-losing-precision-millions-o.patch b/patches/unapplied/server/Fix-block-drops-position-losing-precision-millions-o.patch deleted file mode 100644 index 5a4f4ef000..0000000000 --- a/patches/unapplied/server/Fix-block-drops-position-losing-precision-millions-o.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> -Date: Thu, 12 Aug 2021 21:15:38 -0700 -Subject: [PATCH] Fix block drops position losing precision millions of blocks - out - - -diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/level/block/Block.java -+++ b/src/main/java/net/minecraft/world/level/block/Block.java -@@ -0,0 +0,0 @@ public class Block extends BlockBehaviour implements ItemLike { - - public static void popResource(Level world, BlockPos pos, ItemStack stack) { - float f = EntityType.ITEM.getHeight() / 2.0F; -- double d0 = (double) ((float) pos.getX() + 0.5F) + Mth.nextDouble(world.random, -0.25D, 0.25D); -- double d1 = (double) ((float) pos.getY() + 0.5F) + Mth.nextDouble(world.random, -0.25D, 0.25D) - (double) f; -- double d2 = (double) ((float) pos.getZ() + 0.5F) + Mth.nextDouble(world.random, -0.25D, 0.25D); -+ // Paper start - don't convert potentially massive numbers to floats -+ double d0 = pos.getX() + 0.5D + Mth.nextDouble(world.random, -0.25D, 0.25D); -+ double d1 = pos.getY() + 0.5D + Mth.nextDouble(world.random, -0.25D, 0.25D) - (double) f; -+ double d2 = pos.getZ() + 0.5D + Mth.nextDouble(world.random, -0.25D, 0.25D); -+ // Paper end - - Block.popResource(world, () -> { - return new ItemEntity(world, d0, d1, d2, stack); -@@ -0,0 +0,0 @@ public class Block extends BlockBehaviour implements ItemLike { - int k = direction.getStepZ(); - float f = EntityType.ITEM.getWidth() / 2.0F; - float f1 = EntityType.ITEM.getHeight() / 2.0F; -- double d0 = (double) ((float) pos.getX() + 0.5F) + (i == 0 ? Mth.nextDouble(world.random, -0.25D, 0.25D) : (double) ((float) i * (0.5F + f))); -- double d1 = (double) ((float) pos.getY() + 0.5F) + (j == 0 ? Mth.nextDouble(world.random, -0.25D, 0.25D) : (double) ((float) j * (0.5F + f1))) - (double) f1; -- double d2 = (double) ((float) pos.getZ() + 0.5F) + (k == 0 ? Mth.nextDouble(world.random, -0.25D, 0.25D) : (double) ((float) k * (0.5F + f))); -+ // Paper start - don't convert potentially massive numbers to floats -+ double d0 = pos.getX() + 0.5D + (i == 0 ? Mth.nextDouble(world.random, -0.25D, 0.25D) : (double) ((float) i * (0.5F + f))); -+ double d1 = pos.getY() + 0.5D + (j == 0 ? Mth.nextDouble(world.random, -0.25D, 0.25D) : (double) ((float) j * (0.5F + f1))) - (double) f1; -+ double d2 = pos.getZ() + 0.5D + (k == 0 ? Mth.nextDouble(world.random, -0.25D, 0.25D) : (double) ((float) k * (0.5F + f))); -+ // Paper end - double d3 = i == 0 ? Mth.nextDouble(world.random, -0.1D, 0.1D) : (double) i * 0.1D; - double d4 = j == 0 ? Mth.nextDouble(world.random, 0.0D, 0.1D) : (double) j * 0.1D + 0.1D; - double d5 = k == 0 ? Mth.nextDouble(world.random, -0.1D, 0.1D) : (double) k * 0.1D;