diff --git a/patches/unapplied/api/Add-API-to-get-exact-interaction-point-in-PlayerInte.patch b/patches/api/Add-API-to-get-exact-interaction-point-in-PlayerInte.patch similarity index 100% rename from patches/unapplied/api/Add-API-to-get-exact-interaction-point-in-PlayerInte.patch rename to patches/api/Add-API-to-get-exact-interaction-point-in-PlayerInte.patch diff --git a/patches/unapplied/api/Add-BlockPreDispenseEvent.patch b/patches/api/Add-BlockPreDispenseEvent.patch similarity index 100% rename from patches/unapplied/api/Add-BlockPreDispenseEvent.patch rename to patches/api/Add-BlockPreDispenseEvent.patch diff --git a/patches/unapplied/api/Add-StructureLocateEvent.patch b/patches/api/Add-StructureLocateEvent.patch similarity index 100% rename from patches/unapplied/api/Add-StructureLocateEvent.patch rename to patches/api/Add-StructureLocateEvent.patch diff --git a/patches/unapplied/api/Add-sendOpLevel-API.patch b/patches/api/Add-sendOpLevel-API.patch similarity index 100% rename from patches/unapplied/api/Add-sendOpLevel-API.patch rename to patches/api/Add-sendOpLevel-API.patch diff --git a/patches/unapplied/api/Return-chat-component-with-empty-text-instead-of-thr.patch b/patches/api/Return-chat-component-with-empty-text-instead-of-thr.patch similarity index 100% rename from patches/unapplied/api/Return-chat-component-with-empty-text-instead-of-thr.patch rename to patches/api/Return-chat-component-with-empty-text-instead-of-thr.patch diff --git a/patches/unapplied/server/Add-StructureLocateEvent.patch b/patches/server/Add-StructureLocateEvent.patch similarity index 63% rename from patches/unapplied/server/Add-StructureLocateEvent.patch rename to patches/server/Add-StructureLocateEvent.patch index 981101a98c..9f34d62710 100644 --- a/patches/unapplied/server/Add-StructureLocateEvent.patch +++ b/patches/server/Add-StructureLocateEvent.patch @@ -8,22 +8,14 @@ diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java b index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java +++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGenerator.java -@@ -0,0 +0,0 @@ package net.minecraft.world.level.chunk; - - import com.google.common.collect.Lists; - import com.mojang.serialization.Codec; -+import io.papermc.paper.event.world.StructureLocateEvent; // Paper - Add import due to naming conflict. - import java.util.BitSet; - import java.util.Iterator; - import java.util.List; -@@ -0,0 +0,0 @@ public abstract class ChunkGenerator { +@@ -0,0 +0,0 @@ public abstract class ChunkGenerator implements BiomeManager.NoiseBiomeSource { @Nullable - public BlockPos findNearestMapFeature(ServerLevel world, StructureFeature<?> feature, BlockPos center, int radius, boolean skipExistingChunks) { + public BlockPos findNearestMapFeature(ServerLevel world, StructureFeature<?> structureFeature, BlockPos center, int radius, boolean skipExistingChunks) { + // Paper start + org.bukkit.World world1 = world.getWorld(); + org.bukkit.Location originLocation = new org.bukkit.Location(world1, center.getX(), center.getY(), center.getZ()); -+ StructureLocateEvent event = new StructureLocateEvent(world1, originLocation, org.bukkit.StructureType.getStructureTypes().get(feature.getFeatureName()), radius, skipExistingChunks); ++ io.papermc.paper.event.world.StructureLocateEvent event = new io.papermc.paper.event.world.StructureLocateEvent(world1, originLocation, org.bukkit.StructureType.getStructureTypes().get(structureFeature.getFeatureName()), radius, skipExistingChunks); + if(!event.callEvent()) return null; + // If event call set a final location, skip structure finding and just return set result. + if(event.getResult() != null) return new BlockPos(event.getResult().getBlockX(), event.getResult().getBlockY(), event.getResult().getBlockZ()); @@ -32,8 +24,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Get radius and whether to find unexplored structures (re)defined by event call. + radius = event.getRadius(); + skipExistingChunks = event.shouldFindUnexplored(); -+ feature = StructureFeature.STRUCTURES_REGISTRY.get(event.getType().getName()); ++ structureFeature = StructureFeature.STRUCTURES_REGISTRY.get(event.getType().getName()); + // Paper end - if (!this.biomeSource.canGenerateStructure(feature)) { - return null; - } else if (feature == StructureFeature.STRONGHOLD) { + if (structureFeature == StructureFeature.STRONGHOLD) { + this.generateStrongholds(); + BlockPos blockposition1 = null; 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/Collision-option-for-requiring-a-player-participant.patch b/patches/server/Collision-option-for-requiring-a-player-participant.patch similarity index 81% 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 index df0094b0a3..a450d53a4f 100644 --- a/patches/unapplied/server/Collision-option-for-requiring-a-player-participant.patch +++ b/patches/server/Collision-option-for-requiring-a-player-participant.patch @@ -31,7 +31,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n +@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i public void push(Entity entity) { if (!this.isPassengerOfSameVehicle(entity)) { if (!entity.noPhysics && !this.noPhysics) { @@ -43,19 +43,11 @@ diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.j index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java -@@ -0,0 +0,0 @@ import net.minecraft.network.protocol.game.ClientboundAddEntityPacket; - import net.minecraft.network.syncher.EntityDataAccessor; - import net.minecraft.network.syncher.EntityDataSerializers; - import net.minecraft.network.syncher.SynchedEntityData; -+import net.minecraft.server.level.ServerPlayer; - import net.minecraft.tags.BlockTags; - import net.minecraft.tags.Tag; - import net.minecraft.util.Mth; @@ -0,0 +0,0 @@ public abstract class AbstractMinecart extends Entity { public void push(Entity entity) { if (!this.level.isClientSide) { if (!entity.noPhysics && !this.noPhysics) { -+ if (!this.level.paperConfig.allowVehicleCollisions && this.level.paperConfig.onlyPlayersCollide && !(entity instanceof ServerPlayer)) return; // Paper ++ if (!this.level.paperConfig.allowVehicleCollisions && this.level.paperConfig.onlyPlayersCollide && !(entity instanceof Player)) return; // Paper if (!this.hasPassenger(entity)) { // CraftBukkit start VehicleEntityCollisionEvent collisionEvent = new VehicleEntityCollisionEvent((Vehicle) this.getBukkitEntity(), entity.getBukkitEntity()); @@ -63,19 +55,11 @@ diff --git a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java b/src/ma index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java -@@ -0,0 +0,0 @@ import net.minecraft.network.protocol.game.ServerboundPaddleBoatPacket; - import net.minecraft.network.syncher.EntityDataAccessor; - import net.minecraft.network.syncher.EntityDataSerializers; - import net.minecraft.network.syncher.SynchedEntityData; -+import net.minecraft.server.level.ServerPlayer; - import net.minecraft.sounds.SoundEvent; - import net.minecraft.sounds.SoundEvents; - import net.minecraft.tags.FluidTags; @@ -0,0 +0,0 @@ public class Boat extends Entity { @Override public void push(Entity entity) { -+ if (!this.level.paperConfig.allowVehicleCollisions && this.level.paperConfig.onlyPlayersCollide && !(entity instanceof ServerPlayer)) return; // Paper ++ if (!this.level.paperConfig.allowVehicleCollisions && this.level.paperConfig.onlyPlayersCollide && !(entity instanceof Player)) return; // Paper if (entity instanceof Boat) { if (entity.getBoundingBox().minY < this.getBoundingBox().maxY) { // CraftBukkit start 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/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/Fix-villager-boat-exploit.patch b/patches/server/Fix-villager-boat-exploit.patch similarity index 88% rename from patches/unapplied/server/Fix-villager-boat-exploit.patch rename to patches/server/Fix-villager-boat-exploit.patch index 2ab1f737b3..aa9e24ec0e 100644 --- a/patches/unapplied/server/Fix-villager-boat-exploit.patch +++ b/patches/server/Fix-villager-boat-exploit.patch @@ -13,8 +13,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 entityplayer.stopRiding(); entity.getPassengersAndSelf().forEach((entity1) -> { + // Paper start -+ if (entity1 instanceof net.minecraft.world.entity.npc.AbstractVillager) { -+ final net.minecraft.world.entity.npc.AbstractVillager villager = (net.minecraft.world.entity.npc.AbstractVillager) entity1; ++ if (entity1 instanceof net.minecraft.world.entity.npc.AbstractVillager villager) { + final net.minecraft.world.entity.player.Player human = villager.getTradingPlayer(); + if (human != null) { + villager.setTradingPlayer(null); 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-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/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/Remove-ProjectileHitEvent-call-when-fireballs-dead.patch b/patches/server/Remove-ProjectileHitEvent-call-when-fireballs-dead.patch similarity index 100% rename from patches/unapplied/server/Remove-ProjectileHitEvent-call-when-fireballs-dead.patch rename to patches/server/Remove-ProjectileHitEvent-call-when-fireballs-dead.patch diff --git a/patches/unapplied/server/Remove-stale-POIs.patch b/patches/server/Remove-stale-POIs.patch similarity index 88% rename from patches/unapplied/server/Remove-stale-POIs.patch rename to patches/server/Remove-stale-POIs.patch index 72ef5f2f16..f2e0e9949a 100644 --- a/patches/unapplied/server/Remove-stale-POIs.patch +++ b/patches/server/Remove-stale-POIs.patch @@ -13,7 +13,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 optional1.ifPresent((villageplacetype) -> { this.getServer().execute(() -> { + // Paper start -+ if (!optional.isPresent() && this.getPoiManager().exists(blockposition1, com.google.common.base.Predicates.alwaysTrue())) { ++ if (optional.isEmpty() && this.getPoiManager().exists(blockposition1, poiType -> true)) { + this.getPoiManager().remove(blockposition1); + } + // Paper end diff --git a/patches/unapplied/server/Return-chat-component-with-empty-text-instead-of-thr.patch b/patches/server/Return-chat-component-with-empty-text-instead-of-thr.patch similarity index 100% rename from patches/unapplied/server/Return-chat-component-with-empty-text-instead-of-thr.patch rename to patches/server/Return-chat-component-with-empty-text-instead-of-thr.patch