From 752fd058f17bb4d8157d0e33590535f1a090ee8d Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Wed, 7 Jun 2023 16:56:33 -0700 Subject: [PATCH] 45 more patches --- .../server/Add-Destroy-Speed-API.patch | 0 .../server/Add-EntityLoadCrossbowEvent.patch | 12 +++++++----- .../server/Add-LivingEntity-clearActiveItem.patch | 0 .../Add-OBSTRUCTED-reason-to-BedEnterResult.patch | 0 .../server/Add-PlayerItemCooldownEvent.patch | 0 .../server/Add-PlayerShearBlockEvent.patch | 0 ...dd-PlayerTradeEvent-and-PlayerPurchaseEvent.patch | 0 ...-Wandering-Trader-spawn-rate-config-options.patch | 0 .../{unapplied => }/server/Add-sendOpLevel-API.patch | 0 .../server/Added-PlayerLecternPageChangeEvent.patch | 0 .../server/Added-PlayerLoomPatternSelectEvent.patch | 0 .../server/Added-ServerResourcesReloadedEvent.patch | 0 .../server/Added-WorldGameRuleChangeEvent.patch | 6 +++--- .../Added-missing-default-perms-for-commands.patch | 0 ...ded-world-settings-for-mobs-picking-up-loot.patch | 0 .../server/Additional-Block-Material-API-s.patch | 2 +- ...abling-mob-spawner-spawn-egg-transformation.patch | 0 .../server/Cache-burn-durations.patch | 0 ...limbing-should-not-bypass-cramming-gamerule.patch | 8 ++++---- .../Configurable-door-breaking-difficulty.patch | 0 ...ash-from-invalid-ingredient-lists-in-Villag.patch | 0 .../Empty-commands-shall-not-be-dispatched.patch | 0 .../server/Expose-LivingEntity-hurt-direction.patch | 0 .../server/Expose-world-spawn-angle.patch | 0 .../Fix-CraftSound-backwards-compatibility.patch | 0 .../Fix-Not-a-string-Map-Conversion-spam.patch | 0 ...x-Player-spawnParticle-x-y-z-precision-loss.patch | 0 ...Fix-curing-zombie-villager-discount-exploit.patch | 0 .../server/Fix-harming-potion-dupe.patch | 0 ...nteract-event-not-being-called-in-adventure.patch | 2 +- .../server/Fix-nerfed-slime-when-splitting.patch | 0 .../server/Fix-villager-boat-exploit.patch | 0 ...ement-API-to-expose-exact-interaction-point.patch | 0 ...-API-to-get-Material-from-Boats-and-Minecar.patch | 0 .../Implement-PlayerFlowerPotManipulateEvent.patch | 0 .../server/Implement-TargetHitEvent.patch | 0 .../Implemented-BlockFailedDispenseEvent.patch | 2 +- .../server/Limit-recipe-packets.patch | 7 ++++--- .../server/MC-4-Fix-item-position-desync.patch | 6 +++--- .../{unapplied => }/server/More-lightning-API.patch | 0 .../server/Optimize-Dynamic-get-Missing-Keys.patch | 0 .../server/Player-Chunk-Load-Unload-Events.patch | 0 .../{unapplied => }/server/Remove-stale-POIs.patch | 0 ...ntly-improve-performance-of-the-end-generat.patch | 0 .../server/Zombie-API-breaking-doors.patch | 0 45 files changed, 24 insertions(+), 21 deletions(-) rename patches/{unapplied => }/server/Add-Destroy-Speed-API.patch (100%) rename patches/{unapplied => }/server/Add-EntityLoadCrossbowEvent.patch (89%) rename patches/{unapplied => }/server/Add-LivingEntity-clearActiveItem.patch (100%) rename patches/{unapplied => }/server/Add-OBSTRUCTED-reason-to-BedEnterResult.patch (100%) rename patches/{unapplied => }/server/Add-PlayerItemCooldownEvent.patch (100%) rename patches/{unapplied => }/server/Add-PlayerShearBlockEvent.patch (100%) rename patches/{unapplied => }/server/Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch (100%) rename patches/{unapplied => }/server/Add-Wandering-Trader-spawn-rate-config-options.patch (100%) rename patches/{unapplied => }/server/Add-sendOpLevel-API.patch (100%) rename patches/{unapplied => }/server/Added-PlayerLecternPageChangeEvent.patch (100%) rename patches/{unapplied => }/server/Added-PlayerLoomPatternSelectEvent.patch (100%) rename patches/{unapplied => }/server/Added-ServerResourcesReloadedEvent.patch (100%) rename patches/{unapplied => }/server/Added-WorldGameRuleChangeEvent.patch (97%) rename patches/{unapplied => }/server/Added-missing-default-perms-for-commands.patch (100%) rename patches/{unapplied => }/server/Added-world-settings-for-mobs-picking-up-loot.patch (100%) rename patches/{unapplied => }/server/Additional-Block-Material-API-s.patch (96%) rename patches/{unapplied => }/server/Allow-disabling-mob-spawner-spawn-egg-transformation.patch (100%) rename patches/{unapplied => }/server/Cache-burn-durations.patch (100%) rename patches/{unapplied => }/server/Climbing-should-not-bypass-cramming-gamerule.patch (92%) rename patches/{unapplied => }/server/Configurable-door-breaking-difficulty.patch (100%) rename patches/{unapplied => }/server/Do-not-crash-from-invalid-ingredient-lists-in-Villag.patch (100%) rename patches/{unapplied => }/server/Empty-commands-shall-not-be-dispatched.patch (100%) rename patches/{unapplied => }/server/Expose-LivingEntity-hurt-direction.patch (100%) rename patches/{unapplied => }/server/Expose-world-spawn-angle.patch (100%) rename patches/{unapplied => }/server/Fix-CraftSound-backwards-compatibility.patch (100%) rename patches/{unapplied => }/server/Fix-Not-a-string-Map-Conversion-spam.patch (100%) rename patches/{unapplied => }/server/Fix-Player-spawnParticle-x-y-z-precision-loss.patch (100%) rename patches/{unapplied => }/server/Fix-curing-zombie-villager-discount-exploit.patch (100%) rename patches/{unapplied => }/server/Fix-harming-potion-dupe.patch (100%) rename patches/{unapplied => }/server/Fix-interact-event-not-being-called-in-adventure.patch (91%) rename patches/{unapplied => }/server/Fix-nerfed-slime-when-splitting.patch (100%) rename patches/{unapplied => }/server/Fix-villager-boat-exploit.patch (100%) rename patches/{unapplied => }/server/Implement-API-to-expose-exact-interaction-point.patch (100%) rename patches/{unapplied => }/server/Implement-API-to-get-Material-from-Boats-and-Minecar.patch (100%) rename patches/{unapplied => }/server/Implement-PlayerFlowerPotManipulateEvent.patch (100%) rename patches/{unapplied => }/server/Implement-TargetHitEvent.patch (100%) rename patches/{unapplied => }/server/Implemented-BlockFailedDispenseEvent.patch (96%) rename patches/{unapplied => }/server/Limit-recipe-packets.patch (82%) rename patches/{unapplied => }/server/MC-4-Fix-item-position-desync.patch (95%) rename patches/{unapplied => }/server/More-lightning-API.patch (100%) rename patches/{unapplied => }/server/Optimize-Dynamic-get-Missing-Keys.patch (100%) rename patches/{unapplied => }/server/Player-Chunk-Load-Unload-Events.patch (100%) rename patches/{unapplied => }/server/Remove-stale-POIs.patch (100%) rename patches/{unapplied => }/server/Significantly-improve-performance-of-the-end-generat.patch (100%) rename patches/{unapplied => }/server/Zombie-API-breaking-doors.patch (100%) 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-EntityLoadCrossbowEvent.patch b/patches/server/Add-EntityLoadCrossbowEvent.patch similarity index 89% rename from patches/unapplied/server/Add-EntityLoadCrossbowEvent.patch rename to patches/server/Add-EntityLoadCrossbowEvent.patch index 099ef63b54..b361bbba92 100644 --- a/patches/unapplied/server/Add-EntityLoadCrossbowEvent.patch +++ b/patches/server/Add-EntityLoadCrossbowEvent.patch @@ -25,18 +25,20 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 SoundSource soundcategory = user instanceof Player ? SoundSource.PLAYERS : SoundSource.HOSTILE; @@ -0,0 +0,0 @@ public class CrossbowItem extends ProjectileWeaponItem implements Vanishable { + } - private static boolean tryLoadProjectiles(LivingEntity shooter, ItemStack projectile) { ++ @io.papermc.paper.annotation.DoNotUse // Paper + private static boolean tryLoadProjectiles(LivingEntity shooter, ItemStack crossbow) { + // Paper start -+ return CrossbowItem.tryLoadProjectiles(shooter, projectile, true); ++ return CrossbowItem.tryLoadProjectiles(shooter, crossbow, true); + } -+ private static boolean tryLoadProjectiles(LivingEntity shooter, ItemStack projectile, boolean consume) { ++ private static boolean tryLoadProjectiles(LivingEntity shooter, ItemStack crossbow, boolean consume) { + // Paper end - int i = EnchantmentHelper.getItemEnchantmentLevel(Enchantments.MULTISHOT, projectile); + int i = EnchantmentHelper.getItemEnchantmentLevel(Enchantments.MULTISHOT, crossbow); int j = i == 0 ? 1 : 3; - boolean flag = shooter instanceof Player && ((Player) shooter).getAbilities().instabuild; + boolean flag = !consume || shooter instanceof Player && ((Player) shooter).getAbilities().instabuild; // Paper - add consume - ItemStack itemstack1 = shooter.getProjectile(projectile); + ItemStack itemstack1 = shooter.getProjectile(crossbow); ItemStack itemstack2 = itemstack1.copy(); 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-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-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 100% rename from patches/unapplied/server/Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch rename to patches/server/Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch 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 100% 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 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/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-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 97% rename from patches/unapplied/server/Added-WorldGameRuleChangeEvent.patch rename to patches/server/Added-WorldGameRuleChangeEvent.patch index 155a040df5..28625d738f 100644 --- a/patches/unapplied/server/Added-WorldGameRuleChangeEvent.patch +++ b/patches/server/Added-WorldGameRuleChangeEvent.patch @@ -14,9 +14,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - t0.setFromArgument(context, "value"); + t0.setFromArgument(context, "value", key); // Paper - commandlistenerwrapper.sendSuccess(Component.translatable("commands.gamerule.set", key.getId(), t0.toString()), true); - return t0.getCommandResult(); - } + commandlistenerwrapper.sendSuccess(() -> { + return Component.translatable("commands.gamerule.set", key.getId(), t0.toString()); + }, true); diff --git a/src/main/java/net/minecraft/world/level/GameRules.java b/src/main/java/net/minecraft/world/level/GameRules.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/GameRules.java 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 96% rename from patches/unapplied/server/Additional-Block-Material-API-s.patch rename to patches/server/Additional-Block-Material-API-s.patch index 346a59c3e6..c292d85bc5 100644 --- a/patches/unapplied/server/Additional-Block-Material-API-s.patch +++ b/patches/server/Additional-Block-Material-API-s.patch @@ -13,7 +13,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java @@ -0,0 +0,0 @@ public class CraftBlock implements Block { - return this.getNMS().getMaterial().isLiquid(); + return this.getNMS().liquid(); } + // Paper start 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/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/Climbing-should-not-bypass-cramming-gamerule.patch b/patches/server/Climbing-should-not-bypass-cramming-gamerule.patch similarity index 92% rename from patches/unapplied/server/Climbing-should-not-bypass-cramming-gamerule.patch rename to patches/server/Climbing-should-not-bypass-cramming-gamerule.patch index 3ab7366829..05f04eea7c 100644 --- a/patches/unapplied/server/Climbing-should-not-bypass-cramming-gamerule.patch +++ b/patches/server/Climbing-should-not-bypass-cramming-gamerule.patch @@ -42,7 +42,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - if (!entity1.canCollideWithBukkit(entity) || !entity.canCollideWithBukkit(entity1)) { // CraftBukkit - collidable API + if (!entity1.isCollidable(ignoreClimbing) || !entity1.canCollideWithBukkit(entity) || !entity.canCollideWithBukkit(entity1)) { // CraftBukkit - collidable API // Paper - isCollidable return false; - } else if (entity.level.isClientSide && (!(entity1 instanceof Player) || !((Player) entity1).isLocalPlayer())) { + } else if (entity.level().isClientSide && (!(entity1 instanceof Player) || !((Player) entity1).isLocalPlayer())) { return false; diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 @@ -52,8 +52,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return; } // Paper end - don't run getEntities if we're not going to use its result -- List list = this.level.getEntities((Entity) this, this.getBoundingBox(), EntitySelector.pushableBy(this)); -+ List list = this.level.getEntities((Entity) this, this.getBoundingBox(), EntitySelector.pushable(this, level.paperConfig().collisions.fixClimbingBypassingCrammingRule)); // Paper - fix climbing bypassing cramming rule +- List list = this.level().getEntities((Entity) this, this.getBoundingBox(), EntitySelector.pushableBy(this)); ++ List list = this.level().getEntities((Entity) this, this.getBoundingBox(), EntitySelector.pushable(this, this.level().paperConfig().collisions.fixClimbingBypassingCrammingRule)); // Paper - fix climbing bypassing cramming rule if (!list.isEmpty()) { // Paper - moved up @@ -65,7 +65,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override public boolean isPushable() { - return this.isAlive() && !this.isSpectator() && !this.onClimbable() && this.collides; // CraftBukkit -+ return this.isCollidable(level.paperConfig().collisions.fixClimbingBypassingCrammingRule); ++ return this.isCollidable(this.level().paperConfig().collisions.fixClimbingBypassingCrammingRule); + } + + @Override 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/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/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/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-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/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-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-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-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-interact-event-not-being-called-in-adventure.patch b/patches/server/Fix-interact-event-not-being-called-in-adventure.patch similarity index 91% 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 index 1122d7f6c2..3db0b43c8b 100644 --- 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 @@ -20,7 +20,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic // SPIGOT-5607: Only call interact event if no block or entity is being clicked. Use bukkit ray trace method, because it handles blocks and entities at the same time - org.bukkit.util.RayTraceResult result = this.player.level.getWorld().rayTrace(origin, origin.getDirection(), d3, org.bukkit.FluidCollisionMode.NEVER, false, 0.1, entity -> entity != this.player.getBukkitEntity() && this.player.getBukkitEntity().canSee(entity)); + org.bukkit.util.RayTraceResult result = this.player.level().getWorld().rayTrace(origin, origin.getDirection(), d3, org.bukkit.FluidCollisionMode.NEVER, false, 0.1, entity -> entity != this.player.getBukkitEntity() && this.player.getBukkitEntity().canSee(entity)); - if (result == null) { + if (result == null || this.player.gameMode.getGameModeForPlayer() == GameType.ADVENTURE) { // Paper - call PlayerInteractEvent when left-clicking on a block in adventure mode 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-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/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-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/Implemented-BlockFailedDispenseEvent.patch b/patches/server/Implemented-BlockFailedDispenseEvent.patch similarity index 96% rename from patches/unapplied/server/Implemented-BlockFailedDispenseEvent.patch rename to patches/server/Implemented-BlockFailedDispenseEvent.patch index 363d4c83e4..017e82a105 100644 --- a/patches/unapplied/server/Implemented-BlockFailedDispenseEvent.patch +++ b/patches/server/Implemented-BlockFailedDispenseEvent.patch @@ -14,7 +14,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (i < 0) { + if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFailedDispenseEvent(world, pos)) {// Paper - BlockFailedDispenseEvent is called here world.levelEvent(1001, pos, 0); - world.gameEvent((Entity) null, GameEvent.DISPENSE_FAIL, pos); + world.gameEvent(GameEvent.BLOCK_ACTIVATE, pos, GameEvent.Context.of(tileentitydispenser.getBlockState())); + } // Paper } else { ItemStack itemstack = tileentitydispenser.getItem(i); diff --git a/patches/unapplied/server/Limit-recipe-packets.patch b/patches/server/Limit-recipe-packets.patch similarity index 82% rename from patches/unapplied/server/Limit-recipe-packets.patch rename to patches/server/Limit-recipe-packets.patch index 0c112dffc7..e470651e13 100644 --- a/patches/unapplied/server/Limit-recipe-packets.patch +++ b/patches/server/Limit-recipe-packets.patch @@ -28,14 +28,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override public void handlePlaceRecipe(ServerboundPlaceRecipePacket packet) { ++ PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); + // Paper start + if (!org.bukkit.Bukkit.isPrimaryThread()) { -+ if (recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) { -+ server.scheduleOnMain(() -> this.disconnect(net.minecraft.network.chat.Component.translatable("disconnect.spam", new Object[0]))); // Paper ++ if (this.recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) { ++ this.server.scheduleOnMain(() -> this.disconnect(net.minecraft.network.chat.Component.translatable("disconnect.spam", new Object[0]))); // Paper + return; + } + } + // Paper end - PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); + PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); this.player.resetLastActionTime(); if (!this.player.isSpectator() && this.player.containerMenu.containerId == packet.getContainerId() && this.player.containerMenu instanceof RecipeBookMenu) { 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 95% rename from patches/unapplied/server/MC-4-Fix-item-position-desync.patch rename to patches/server/MC-4-Fix-item-position-desync.patch index 03813c29b8..68b1547082 100644 --- a/patches/unapplied/server/MC-4-Fix-item-position-desync.patch +++ b/patches/server/MC-4-Fix-item-position-desync.patch @@ -32,9 +32,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- 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 { - return; - } - // Paper end - rewrite chunk system + } + public final void setPosRaw(double x, double y, double z, boolean forceBoundingBoxUpdate) { + // Paper end + // Paper start - fix MC-4 + if (this instanceof ItemEntity) { + if (io.papermc.paper.configuration.GlobalConfiguration.get().misc.fixEntityPositionDesync) { 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/Optimize-Dynamic-get-Missing-Keys.patch b/patches/server/Optimize-Dynamic-get-Missing-Keys.patch similarity index 100% rename from patches/unapplied/server/Optimize-Dynamic-get-Missing-Keys.patch rename to patches/server/Optimize-Dynamic-get-Missing-Keys.patch diff --git a/patches/unapplied/server/Player-Chunk-Load-Unload-Events.patch b/patches/server/Player-Chunk-Load-Unload-Events.patch similarity index 100% rename from patches/unapplied/server/Player-Chunk-Load-Unload-Events.patch rename to patches/server/Player-Chunk-Load-Unload-Events.patch diff --git a/patches/unapplied/server/Remove-stale-POIs.patch b/patches/server/Remove-stale-POIs.patch similarity index 100% rename from patches/unapplied/server/Remove-stale-POIs.patch rename to patches/server/Remove-stale-POIs.patch diff --git a/patches/unapplied/server/Significantly-improve-performance-of-the-end-generat.patch b/patches/server/Significantly-improve-performance-of-the-end-generat.patch similarity index 100% rename from patches/unapplied/server/Significantly-improve-performance-of-the-end-generat.patch rename to patches/server/Significantly-improve-performance-of-the-end-generat.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