From 4ff15b38e5ce380f477b2b329d09218d06cd828a Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Thu, 13 Jun 2024 17:08:12 -0700 Subject: [PATCH] 650/1053 --- ...Add-API-for-resetting-a-single-score.patch | 0 .../server/Add-BlockBreakBlockEvent.patch | 0 .../server/Add-EntityDamageItemEvent.patch | 63 ++++++++++++++++++ .../Add-ItemFactory-getSpawnEgg-API.patch | 0 .../Add-PlayerItemFrameChangeEvent.patch | 4 +- .../Add-Raw-Byte-Entity-Serialization.patch | 0 .../Add-back-EntityPortalExitEvent.patch | 46 +++++++++++++ .../server/Add-critical-damage-API.patch | 36 ++++------ ...sCollision-methods-to-various-places.patch | 0 ...o-find-targets-for-lightning-strikes.patch | 0 .../server/Add-missing-InventoryType.patch | 0 ...d-missing-team-sidebar-display-slots.patch | 0 .../server/Add-more-Campfire-API.patch | 4 +- .../server/Add-more-advancement-API.patch | 0 .../server/Add-packet-limiter-config.patch | 0 ...aper-mobcaps-and-paper-playermobcaps.patch | 0 .../Add-root-admin-user-detection.patch | 0 ...llow-delegation-to-vanilla-chunk-gen.patch | 0 ...target-without-changing-other-things.patch | 0 ...irement-before-suggesting-root-nodes.patch | 0 ...g-option-for-Piglins-guarding-chests.patch | 0 .../server/Configurable-feature-seeds.patch | 0 ...tem-frame-map-cursor-update-interval.patch | 0 ...-logic-for-inventories-on-chunk-unlo.patch | 2 +- ...n-t-log-debug-logging-being-disabled.patch | 0 ...id-state-when-raytracing-skip-air-bl.patch | 0 ...bour-chunk-data-off-disk-when-conver.patch | 0 ...-ServerboundCommandSuggestionPacket-.patch | 0 .../server/Ensure-valid-vehicle-status.patch | 2 +- ...t-isSectionEmpty-int-and-optimize-Pa.patch | 0 ...or-causing-a-crash-when-trying-to-ge.patch | 0 .../Fix-CraftCriteria-defaults-map.patch | 0 .../Fix-GameProfileCache-concurrency.patch | 0 .../server/Fix-Spigot-growth-modifiers.patch | 0 .../Fix-issues-with-mob-conversion.patch | 0 ...entory-not-closing-on-entity-removal.patch | 0 ...rnColor-on-tropical-fish-bucket-meta.patch | 0 .../Fix-upstreams-block-state-factories.patch | 0 .../Get-entity-default-attributes.patch | 0 .../{unapplied => }/server/Goat-ram-API.patch | 0 .../Improve-and-expand-AsyncCatcher.patch | 2 +- .../server/Left-handed-API.patch | 0 ...d-getChunkAt-has-inlined-logic-for-l.patch | 0 ...ally-inline-methods-in-BlockPosition.patch | 0 .../server/More-CommandBlock-API.patch | 0 ...uler-threads-according-to-the-plugin.patch | 0 ...-data-to-disk-if-it-serializes-witho.patch | 4 +- ...primise-map-impl-for-tracked-players.patch | 0 ...timise-BlockSoil-nearby-water-lookup.patch | 0 .../server/Optimize-HashMapPalette.patch | 0 ...ptimize-indirect-passenger-iteration.patch | 0 ...t-data-components-copy-in-smithing-r.patch | 4 +- .../server/Preserve-overstacked-loot.patch | 0 ...rOpenersCounter-openCount-from-going.patch | 0 ...sive-velocity-through-repeated-crits.patch | 3 +- ...oftlocked-end-exit-portal-generation.patch | 0 ...de-code-using-deprecated-for-removal.patch | 8 +-- ...itize-ResourceLocation-error-logging.patch | 4 +- .../server/Time-scoreboard-search.patch | 0 ...date-head-rotation-in-missing-places.patch | 0 .../Vanilla-command-permission-fixes.patch | 0 ...-t-attempt-to-teleport-dead-entities.patch | 2 +- ...ious-menus-with-empty-level-accesses.patch | 0 ...-unintended-light-block-manipulation.patch | 0 .../server/Add-EntityDamageItemEvent.patch | 65 ------------------- .../Add-back-EntityPortalExitEvent.patch | 50 -------------- .../Clear-bucket-NBT-after-dispense.patch | 20 ------ 67 files changed, 142 insertions(+), 177 deletions(-) rename patches/{unapplied => }/server/Add-API-for-resetting-a-single-score.patch (100%) rename patches/{unapplied => }/server/Add-BlockBreakBlockEvent.patch (100%) create mode 100644 patches/server/Add-EntityDamageItemEvent.patch rename patches/{unapplied => }/server/Add-ItemFactory-getSpawnEgg-API.patch (100%) rename patches/{unapplied => }/server/Add-PlayerItemFrameChangeEvent.patch (97%) rename patches/{unapplied => }/server/Add-Raw-Byte-Entity-Serialization.patch (100%) create mode 100644 patches/server/Add-back-EntityPortalExitEvent.patch rename patches/{unapplied => }/server/Add-critical-damage-API.patch (71%) rename patches/{unapplied => }/server/Add-hasCollision-methods-to-various-places.patch (100%) rename patches/{unapplied => }/server/Add-methods-to-find-targets-for-lightning-strikes.patch (100%) rename patches/{unapplied => }/server/Add-missing-InventoryType.patch (100%) rename patches/{unapplied => }/server/Add-missing-team-sidebar-display-slots.patch (100%) rename patches/{unapplied => }/server/Add-more-Campfire-API.patch (96%) rename patches/{unapplied => }/server/Add-more-advancement-API.patch (100%) rename patches/{unapplied => }/server/Add-packet-limiter-config.patch (100%) rename patches/{unapplied => }/server/Add-paper-mobcaps-and-paper-playermobcaps.patch (100%) rename patches/{unapplied => }/server/Add-root-admin-user-detection.patch (100%) rename patches/{unapplied => }/server/Allow-delegation-to-vanilla-chunk-gen.patch (100%) rename patches/{unapplied => }/server/Change-EnderEye-target-without-changing-other-things.patch (100%) rename patches/{unapplied => }/server/Check-requirement-before-suggesting-root-nodes.patch (100%) rename patches/{unapplied => }/server/Config-option-for-Piglins-guarding-chests.patch (100%) rename patches/{unapplied => }/server/Configurable-feature-seeds.patch (100%) rename patches/{unapplied => }/server/Configurable-item-frame-map-cursor-update-interval.patch (100%) rename patches/{unapplied => }/server/Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch (97%) rename patches/{unapplied => }/server/Don-t-log-debug-logging-being-disabled.patch (100%) rename patches/{unapplied => }/server/Don-t-lookup-fluid-state-when-raytracing-skip-air-bl.patch (100%) rename patches/{unapplied => }/server/Don-t-read-neighbour-chunk-data-off-disk-when-conver.patch (100%) rename patches/{unapplied => }/server/Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch (100%) rename patches/{unapplied => }/server/Ensure-valid-vehicle-status.patch (91%) rename patches/{unapplied => }/server/Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch (100%) rename patches/{unapplied => }/server/Fix-CocaoDecorator-causing-a-crash-when-trying-to-ge.patch (100%) rename patches/{unapplied => }/server/Fix-CraftCriteria-defaults-map.patch (100%) rename patches/{unapplied => }/server/Fix-GameProfileCache-concurrency.patch (100%) rename patches/{unapplied => }/server/Fix-Spigot-growth-modifiers.patch (100%) rename patches/{unapplied => }/server/Fix-issues-with-mob-conversion.patch (100%) rename patches/{unapplied => }/server/Fix-merchant-inventory-not-closing-on-entity-removal.patch (100%) rename patches/{unapplied => }/server/Fix-setPatternColor-on-tropical-fish-bucket-meta.patch (100%) rename patches/{unapplied => }/server/Fix-upstreams-block-state-factories.patch (100%) rename patches/{unapplied => }/server/Get-entity-default-attributes.patch (100%) rename patches/{unapplied => }/server/Goat-ram-API.patch (100%) rename patches/{unapplied => }/server/Improve-and-expand-AsyncCatcher.patch (98%) rename patches/{unapplied => }/server/Left-handed-API.patch (100%) rename patches/{unapplied => }/server/Make-sure-inlined-getChunkAt-has-inlined-logic-for-l.patch (100%) rename patches/{unapplied => }/server/Manually-inline-methods-in-BlockPosition.patch (100%) rename patches/{unapplied => }/server/More-CommandBlock-API.patch (100%) rename patches/{unapplied => }/server/Name-craft-scheduler-threads-according-to-the-plugin.patch (100%) rename patches/{unapplied => }/server/Only-write-chunk-data-to-disk-if-it-serializes-witho.patch (98%) rename patches/{unapplied => }/server/Oprimise-map-impl-for-tracked-players.patch (100%) rename patches/{unapplied => }/server/Optimise-BlockSoil-nearby-water-lookup.patch (100%) rename patches/{unapplied => }/server/Optimize-HashMapPalette.patch (100%) rename patches/{unapplied => }/server/Optimize-indirect-passenger-iteration.patch (100%) rename patches/{unapplied => }/server/Option-to-prevent-data-components-copy-in-smithing-r.patch (98%) rename patches/{unapplied => }/server/Preserve-overstacked-loot.patch (100%) rename patches/{unapplied => }/server/Prevent-ContainerOpenersCounter-openCount-from-going.patch (100%) rename patches/{unapplied => }/server/Prevent-excessive-velocity-through-repeated-crits.patch (97%) rename patches/{unapplied => }/server/Prevent-softlocked-end-exit-portal-generation.patch (100%) rename patches/{unapplied => }/server/Remove-client-side-code-using-deprecated-for-removal.patch (87%) rename patches/{unapplied => }/server/Sanitize-ResourceLocation-error-logging.patch (90%) rename patches/{unapplied => }/server/Time-scoreboard-search.patch (100%) rename patches/{unapplied => }/server/Update-head-rotation-in-missing-places.patch (100%) rename patches/{unapplied => }/server/Vanilla-command-permission-fixes.patch (100%) rename patches/{unapplied => }/server/don-t-attempt-to-teleport-dead-entities.patch (96%) rename patches/{unapplied => }/server/fix-various-menus-with-empty-level-accesses.patch (100%) rename patches/{unapplied => }/server/prevent-unintended-light-block-manipulation.patch (100%) delete mode 100644 patches/unapplied/server/Add-EntityDamageItemEvent.patch delete mode 100644 patches/unapplied/server/Add-back-EntityPortalExitEvent.patch delete mode 100644 patches/unapplied/server/Clear-bucket-NBT-after-dispense.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-BlockBreakBlockEvent.patch b/patches/server/Add-BlockBreakBlockEvent.patch similarity index 100% rename from patches/unapplied/server/Add-BlockBreakBlockEvent.patch rename to patches/server/Add-BlockBreakBlockEvent.patch diff --git a/patches/server/Add-EntityDamageItemEvent.patch b/patches/server/Add-EntityDamageItemEvent.patch new file mode 100644 index 0000000000..14b1a703cb --- /dev/null +++ b/patches/server/Add-EntityDamageItemEvent.patch @@ -0,0 +1,63 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jake Potrebic +Date: Tue, 22 Dec 2020 13:52:48 -0800 +Subject: [PATCH] Add EntityDamageItemEvent + + +diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/item/ItemStack.java ++++ b/src/main/java/net/minecraft/world/item/ItemStack.java +@@ -0,0 +0,0 @@ public final class ItemStack implements DataComponentHolder { + return (Integer) this.getOrDefault(DataComponents.MAX_DAMAGE, 0); + } + +- public void hurtAndBreak(int amount, ServerLevel world, @Nullable ServerPlayer player, Consumer breakCallback) { ++ public void hurtAndBreak(int amount, ServerLevel world, @Nullable LivingEntity player, Consumer breakCallback) { // Paper - Add EntityDamageItemEvent + if (this.isDamageableItem()) { + if (player == null || !player.hasInfiniteMaterials()) { + if (amount > 0) { + amount = EnchantmentHelper.processDurabilityChange(world, this, amount); + // CraftBukkit start +- if (player != null) { +- PlayerItemDamageEvent event = new PlayerItemDamageEvent(player.getBukkitEntity(), CraftItemStack.asCraftMirror(this), amount); ++ if (player instanceof ServerPlayer serverPlayer) { // Paper - Add EntityDamageItemEvent ++ PlayerItemDamageEvent event = new PlayerItemDamageEvent(serverPlayer.getBukkitEntity(), CraftItemStack.asCraftMirror(this), amount); // Paper - Add EntityDamageItemEvent + event.getPlayer().getServer().getPluginManager().callEvent(event); + + if (amount != event.getDamage() || event.isCancelled()) { +@@ -0,0 +0,0 @@ public final class ItemStack implements DataComponentHolder { + } + + amount = event.getDamage(); ++ // Paper start - Add EntityDamageItemEvent ++ } else if (player != null) { ++ io.papermc.paper.event.entity.EntityDamageItemEvent event = new io.papermc.paper.event.entity.EntityDamageItemEvent(player.getBukkitLivingEntity(), CraftItemStack.asCraftMirror(this), amount); ++ if (!event.callEvent()) { ++ return; ++ } ++ amount = event.getDamage(); ++ // Paper end - Add EntityDamageItemEvent + } + // CraftBukkit end + if (amount <= 0) { +@@ -0,0 +0,0 @@ public final class ItemStack implements DataComponentHolder { + } + } + +- if (player != null && amount != 0) { +- CriteriaTriggers.ITEM_DURABILITY_CHANGED.trigger(player, this, this.getDamageValue() + amount); ++ if (player instanceof ServerPlayer serverPlayer && amount != 0) { // Paper - Add EntityDamageItemEvent ++ CriteriaTriggers.ITEM_DURABILITY_CHANGED.trigger(serverPlayer, this, this.getDamageValue() + amount); // Paper - Add EntityDamageItemEvent + } + + int j = this.getDamageValue() + amount; +@@ -0,0 +0,0 @@ public final class ItemStack implements DataComponentHolder { + entityplayer = null; + } + +- this.hurtAndBreak(amount, worldserver, entityplayer, (item) -> { ++ this.hurtAndBreak(amount, worldserver, entity, (item) -> { // Paper - Add EntityDamageItemEvent + // CraftBukkit start - Check for item breaking + if (this.count == 1 && entity instanceof net.minecraft.world.entity.player.Player) { + org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerItemBreakEvent((net.minecraft.world.entity.player.Player) entity, this); 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-PlayerItemFrameChangeEvent.patch b/patches/server/Add-PlayerItemFrameChangeEvent.patch similarity index 97% rename from patches/unapplied/server/Add-PlayerItemFrameChangeEvent.patch rename to patches/server/Add-PlayerItemFrameChangeEvent.patch index 8bc4567103..539e9cd835 100644 --- a/patches/unapplied/server/Add-PlayerItemFrameChangeEvent.patch +++ b/patches/server/Add-PlayerItemFrameChangeEvent.patch @@ -8,9 +8,9 @@ diff --git a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java +++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java -@@ -0,0 +0,0 @@ package net.minecraft.world.entity.decoration; +@@ -0,0 +0,0 @@ + package net.minecraft.world.entity.decoration; - import com.mojang.logging.LogUtils; import javax.annotation.Nullable; +import io.papermc.paper.event.player.PlayerItemFrameChangeEvent; // Paper - Add PlayerItemFrameChangeEvent import net.minecraft.core.BlockPos; 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/server/Add-back-EntityPortalExitEvent.patch b/patches/server/Add-back-EntityPortalExitEvent.patch new file mode 100644 index 0000000000..a332ea9918 --- /dev/null +++ b/patches/server/Add-back-EntityPortalExitEvent.patch @@ -0,0 +1,46 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jake Potrebic +Date: Sun, 16 May 2021 09:39:46 -0700 +Subject: [PATCH] Add back EntityPortalExitEvent + + +diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java +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 SyncedDataHolder, Nameable, EntityAccess + if (world instanceof ServerLevel worldserver) { + if (!this.isRemoved()) { + // CraftBukkit start +- Location to = new Location(teleportTarget.newLevel().getWorld(), teleportTarget.pos().x, teleportTarget.pos().y, teleportTarget.pos().z, teleportTarget.yRot(), teleportTarget.xRot()); ++ Location to = new Location(teleportTarget.newLevel().getWorld(), teleportTarget.pos().x, teleportTarget.pos().y, teleportTarget.pos().z, teleportTarget.yRot(), this.getXRot()); // Paper - use getXRot (doesn't respect DimensionTransition pitch) + // Paper start - gateway-specific teleport event + final EntityTeleportEvent teleEvent; + if (this.portalProcess != null && this.portalProcess.isSamePortal(((net.minecraft.world.level.block.EndGatewayBlock) net.minecraft.world.level.block.Blocks.END_GATEWAY)) && this.level.getBlockEntity(this.portalProcess.getEntryPosition()) instanceof net.minecraft.world.level.block.entity.TheEndGatewayBlockEntity theEndGatewayBlockEntity) { +@@ -0,0 +0,0 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess + return null; + } + to = teleEvent.getTo(); +- teleportTarget = new DimensionTransition(((CraftWorld) to.getWorld()).getHandle(), CraftLocation.toVec3D(to), teleportTarget.speed(), to.getYaw(), to.getPitch(), teleportTarget.missingRespawnBlock(), teleportTarget.postDimensionTransition(), teleportTarget.cause()); ++ // Paper start - Call EntityPortalExitEvent ++ CraftEntity bukkitEntity = this.getBukkitEntity(); ++ Vec3 velocity = teleportTarget.speed(); ++ org.bukkit.event.entity.EntityPortalExitEvent event = new org.bukkit.event.entity.EntityPortalExitEvent( ++ bukkitEntity, ++ bukkitEntity.getLocation(), to.clone(), ++ bukkitEntity.getVelocity(), org.bukkit.craftbukkit.util.CraftVector.toBukkit(velocity) ++ ); ++ event.callEvent(); ++ if (this.isRemoved()) { ++ return null; ++ } ++ ++ if (!event.isCancelled() && event.getTo() != null) { ++ to = event.getTo().clone(); ++ velocity = org.bukkit.craftbukkit.util.CraftVector.toNMS(event.getAfter()); ++ } ++ teleportTarget = new DimensionTransition(((CraftWorld) to.getWorld()).getHandle(), CraftLocation.toVec3D(to), velocity, to.getYaw(), to.getPitch(), teleportTarget.missingRespawnBlock(), teleportTarget.postDimensionTransition(), teleportTarget.cause()); ++ // Paper end - Call EntityPortalExitEvent + // CraftBukkit end + ServerLevel worldserver1 = teleportTarget.newLevel(); + List list = this.getPassengers(); diff --git a/patches/unapplied/server/Add-critical-damage-API.patch b/patches/server/Add-critical-damage-API.patch similarity index 71% rename from patches/unapplied/server/Add-critical-damage-API.patch rename to patches/server/Add-critical-damage-API.patch index 6a3a2dda1b..880a4ea7fb 100644 --- a/patches/unapplied/server/Add-critical-damage-API.patch +++ b/patches/server/Add-critical-damage-API.patch @@ -32,38 +32,28 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java @@ -0,0 +0,0 @@ public abstract class Player extends LivingEntity { - } - f += this.getItemInHand(InteractionHand.MAIN_HAND).getItem().getAttackDamageBonus(this, f); -- boolean flag2 = flag && this.fallDistance > 0.0F && !this.onGround() && !this.onClimbable() && !this.isInWater() && !this.hasEffect(MobEffects.BLINDNESS) && !this.isPassenger() && target instanceof LivingEntity && !this.isSprinting(); -+ boolean flag2 = flag && this.fallDistance > 0.0F && !this.onGround() && !this.onClimbable() && !this.isInWater() && !this.hasEffect(MobEffects.BLINDNESS) && !this.isPassenger() && target instanceof LivingEntity && !this.isSprinting(); // Paper - Add critical damage API; diff on change + flag2 = flag2 && !this.level().paperConfig().entities.behavior.disablePlayerCrits; // Paper - Toggleable player crits + if (flag2) { ++ damagesource = damagesource.critical(true); // Paper start - critical damage API + f *= 1.5F; + } - flag2 = flag2 && !this.level().paperConfig().entities.behavior.disablePlayerCrits; // Paper - Toggleable player crits - if (flag2) { @@ -0,0 +0,0 @@ public abstract class Player extends LivingEntity { - } + float f7 = this.getEnchantedDamage(entityliving2, f6, damagesource) * f2; - Vec3 vec3d = target.getDeltaMovement(); -- 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) { -@@ -0,0 +0,0 @@ public abstract class Player extends LivingEntity { - - 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(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, io.papermc.paper.event.entity.EntityKnockbackEvent.Cause.SWEEP_ATTACK); // CraftBukkit // Paper - knockback events - } - // CraftBukkit end + // CraftBukkit start - Only apply knockback if the damage hits +- if (entityliving2.hurt(this.damageSources().playerAttack(this).sweep(), f7)) { ++ if (entityliving2.hurt(this.damageSources().playerAttack(this).sweep().critical(flag2), f7)) { // Paper - add critical damage API + entityliving2.knockback(0.4000000059604645D, (double) Mth.sin(this.getYRot() * 0.017453292F), (double) (-Mth.cos(this.getYRot() * 0.017453292F)), this, io.papermc.paper.event.entity.EntityKnockbackEvent.Cause.SWEEP_ATTACK); // CraftBukkit // Paper - knockback events + } + // 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 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java +++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java @@ -0,0 +0,0 @@ public abstract class AbstractArrow extends Projectile { - } + entityliving.setLastHurtMob(entity); } + if (this.isCritArrow()) damagesource = damagesource.critical(); // Paper - add critical damage API diff --git a/patches/unapplied/server/Add-hasCollision-methods-to-various-places.patch b/patches/server/Add-hasCollision-methods-to-various-places.patch similarity index 100% rename from patches/unapplied/server/Add-hasCollision-methods-to-various-places.patch rename to patches/server/Add-hasCollision-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-missing-InventoryType.patch b/patches/server/Add-missing-InventoryType.patch similarity index 100% rename from patches/unapplied/server/Add-missing-InventoryType.patch rename to patches/server/Add-missing-InventoryType.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-more-Campfire-API.patch b/patches/server/Add-more-Campfire-API.patch similarity index 96% rename from patches/unapplied/server/Add-more-Campfire-API.patch rename to patches/server/Add-more-Campfire-API.patch index 1dbeb339ca..51beed7a62 100644 --- a/patches/unapplied/server/Add-more-Campfire-API.patch +++ b/patches/server/Add-more-Campfire-API.patch @@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable { public final int[] cookingProgress; public final int[] cookingTime; - private final RecipeManager.CachedCheck quickCheck; + private final RecipeManager.CachedCheck quickCheck; + public final boolean[] stopCooking; // Paper - Add more Campfire API public CampfireBlockEntity(BlockPos pos, BlockState state) { @@ -33,7 +33,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } // Paper - Add more Campfire API if (campfire.cookingProgress[i] >= campfire.cookingTime[i]) { - SimpleContainer inventorysubcontainer = new SimpleContainer(new ItemStack[]{itemstack}); + SingleRecipeInput singlerecipeinput = new SingleRecipeInput(itemstack); @@ -0,0 +0,0 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable { System.arraycopy(aint, 0, this.cookingTime, 0, Math.min(this.cookingTime.length, aint.length)); } 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-packet-limiter-config.patch b/patches/server/Add-packet-limiter-config.patch similarity index 100% rename from patches/unapplied/server/Add-packet-limiter-config.patch rename to patches/server/Add-packet-limiter-config.patch 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-root-admin-user-detection.patch b/patches/server/Add-root-admin-user-detection.patch similarity index 100% rename from patches/unapplied/server/Add-root-admin-user-detection.patch rename to patches/server/Add-root-admin-user-detection.patch diff --git a/patches/unapplied/server/Allow-delegation-to-vanilla-chunk-gen.patch b/patches/server/Allow-delegation-to-vanilla-chunk-gen.patch similarity index 100% rename from patches/unapplied/server/Allow-delegation-to-vanilla-chunk-gen.patch rename to patches/server/Allow-delegation-to-vanilla-chunk-gen.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 100% 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 diff --git a/patches/unapplied/server/Check-requirement-before-suggesting-root-nodes.patch b/patches/server/Check-requirement-before-suggesting-root-nodes.patch similarity index 100% rename from patches/unapplied/server/Check-requirement-before-suggesting-root-nodes.patch rename to patches/server/Check-requirement-before-suggesting-root-nodes.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-feature-seeds.patch b/patches/server/Configurable-feature-seeds.patch similarity index 100% rename from patches/unapplied/server/Configurable-feature-seeds.patch rename to patches/server/Configurable-feature-seeds.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/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 97% 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 index 2fa9f5beb0..34c7c15f81 100644 --- 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 @@ -31,7 +31,7 @@ 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 @@ public class ServerPlayer extends Player { +@@ -0,0 +0,0 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { this.connection.send(new ClientboundContainerClosePacket(this.containerMenu.containerId)); this.doCloseContainer(); } diff --git a/patches/unapplied/server/Don-t-log-debug-logging-being-disabled.patch b/patches/server/Don-t-log-debug-logging-being-disabled.patch similarity index 100% rename from patches/unapplied/server/Don-t-log-debug-logging-being-disabled.patch rename to patches/server/Don-t-log-debug-logging-being-disabled.patch diff --git a/patches/unapplied/server/Don-t-lookup-fluid-state-when-raytracing-skip-air-bl.patch b/patches/server/Don-t-lookup-fluid-state-when-raytracing-skip-air-bl.patch similarity index 100% rename from patches/unapplied/server/Don-t-lookup-fluid-state-when-raytracing-skip-air-bl.patch rename to patches/server/Don-t-lookup-fluid-state-when-raytracing-skip-air-bl.patch diff --git a/patches/unapplied/server/Don-t-read-neighbour-chunk-data-off-disk-when-conver.patch b/patches/server/Don-t-read-neighbour-chunk-data-off-disk-when-conver.patch similarity index 100% rename from patches/unapplied/server/Don-t-read-neighbour-chunk-data-off-disk-when-conver.patch rename to patches/server/Don-t-read-neighbour-chunk-data-off-disk-when-conver.patch diff --git a/patches/unapplied/server/Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch b/patches/server/Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch similarity index 100% rename from patches/unapplied/server/Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch rename to patches/server/Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch diff --git a/patches/unapplied/server/Ensure-valid-vehicle-status.patch b/patches/server/Ensure-valid-vehicle-status.patch similarity index 91% rename from patches/unapplied/server/Ensure-valid-vehicle-status.patch rename to patches/server/Ensure-valid-vehicle-status.patch index 66a8610ccf..62941443fe 100644 --- a/patches/unapplied/server/Ensure-valid-vehicle-status.patch +++ b/patches/server/Ensure-valid-vehicle-status.patch @@ -8,7 +8,7 @@ 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 @@ public class ServerPlayer extends Player { +@@ -0,0 +0,0 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { } } diff --git a/patches/unapplied/server/Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch b/patches/server/Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch similarity index 100% rename from patches/unapplied/server/Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch rename to patches/server/Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch diff --git a/patches/unapplied/server/Fix-CocaoDecorator-causing-a-crash-when-trying-to-ge.patch b/patches/server/Fix-CocaoDecorator-causing-a-crash-when-trying-to-ge.patch similarity index 100% rename from patches/unapplied/server/Fix-CocaoDecorator-causing-a-crash-when-trying-to-ge.patch rename to patches/server/Fix-CocaoDecorator-causing-a-crash-when-trying-to-ge.patch diff --git a/patches/unapplied/server/Fix-CraftCriteria-defaults-map.patch b/patches/server/Fix-CraftCriteria-defaults-map.patch similarity index 100% rename from patches/unapplied/server/Fix-CraftCriteria-defaults-map.patch rename to patches/server/Fix-CraftCriteria-defaults-map.patch 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-Spigot-growth-modifiers.patch b/patches/server/Fix-Spigot-growth-modifiers.patch similarity index 100% rename from patches/unapplied/server/Fix-Spigot-growth-modifiers.patch rename to patches/server/Fix-Spigot-growth-modifiers.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-merchant-inventory-not-closing-on-entity-removal.patch b/patches/server/Fix-merchant-inventory-not-closing-on-entity-removal.patch similarity index 100% rename from patches/unapplied/server/Fix-merchant-inventory-not-closing-on-entity-removal.patch rename to patches/server/Fix-merchant-inventory-not-closing-on-entity-removal.patch diff --git a/patches/unapplied/server/Fix-setPatternColor-on-tropical-fish-bucket-meta.patch b/patches/server/Fix-setPatternColor-on-tropical-fish-bucket-meta.patch similarity index 100% rename from patches/unapplied/server/Fix-setPatternColor-on-tropical-fish-bucket-meta.patch rename to patches/server/Fix-setPatternColor-on-tropical-fish-bucket-meta.patch diff --git a/patches/unapplied/server/Fix-upstreams-block-state-factories.patch b/patches/server/Fix-upstreams-block-state-factories.patch similarity index 100% rename from patches/unapplied/server/Fix-upstreams-block-state-factories.patch rename to patches/server/Fix-upstreams-block-state-factories.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/Improve-and-expand-AsyncCatcher.patch b/patches/server/Improve-and-expand-AsyncCatcher.patch similarity index 98% rename from patches/unapplied/server/Improve-and-expand-AsyncCatcher.patch rename to patches/server/Improve-and-expand-AsyncCatcher.patch index 95181ef737..061be9e938 100644 --- a/patches/unapplied/server/Improve-and-expand-AsyncCatcher.patch +++ b/patches/server/Improve-and-expand-AsyncCatcher.patch @@ -200,7 +200,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + org.spigotmc.AsyncCatcher.catchOp("play sound"); // Paper if (!(entity instanceof CraftEntity craftEntity) || entity.getWorld() != this || sound == null || category == null) return; - ClientboundSoundEntityPacket packet = new ClientboundSoundEntityPacket(Holder.direct(SoundEvent.createVariableRangeEvent(new ResourceLocation(sound))), net.minecraft.sounds.SoundSource.valueOf(category.name()), craftEntity.getHandle(), volume, pitch, seed); + ClientboundSoundEntityPacket packet = new ClientboundSoundEntityPacket(Holder.direct(SoundEvent.createVariableRangeEvent(ResourceLocation.parse(sound))), net.minecraft.sounds.SoundSource.valueOf(category.name()), craftEntity.getHandle(), volume, pitch, seed); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java 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/Make-sure-inlined-getChunkAt-has-inlined-logic-for-l.patch b/patches/server/Make-sure-inlined-getChunkAt-has-inlined-logic-for-l.patch similarity index 100% rename from patches/unapplied/server/Make-sure-inlined-getChunkAt-has-inlined-logic-for-l.patch rename to patches/server/Make-sure-inlined-getChunkAt-has-inlined-logic-for-l.patch diff --git a/patches/unapplied/server/Manually-inline-methods-in-BlockPosition.patch b/patches/server/Manually-inline-methods-in-BlockPosition.patch similarity index 100% rename from patches/unapplied/server/Manually-inline-methods-in-BlockPosition.patch rename to patches/server/Manually-inline-methods-in-BlockPosition.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/Name-craft-scheduler-threads-according-to-the-plugin.patch b/patches/server/Name-craft-scheduler-threads-according-to-the-plugin.patch similarity index 100% rename from patches/unapplied/server/Name-craft-scheduler-threads-according-to-the-plugin.patch rename to patches/server/Name-craft-scheduler-threads-according-to-the-plugin.patch diff --git a/patches/unapplied/server/Only-write-chunk-data-to-disk-if-it-serializes-witho.patch b/patches/server/Only-write-chunk-data-to-disk-if-it-serializes-witho.patch similarity index 98% rename from patches/unapplied/server/Only-write-chunk-data-to-disk-if-it-serializes-witho.patch rename to patches/server/Only-write-chunk-data-to-disk-if-it-serializes-witho.patch index 496622a480..1c1103b17a 100644 --- a/patches/unapplied/server/Only-write-chunk-data-to-disk-if-it-serializes-witho.patch +++ b/patches/server/Only-write-chunk-data-to-disk-if-it-serializes-witho.patch @@ -79,8 +79,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // Paper start - Chunk save reattempt return; @@ -0,0 +0,0 @@ public class RegionFileStorage implements AutoCloseable { - } - + public RegionStorageInfo info() { + return this.info; } + + // Paper start - don't write garbage data to disk if writing serialization fails diff --git a/patches/unapplied/server/Oprimise-map-impl-for-tracked-players.patch b/patches/server/Oprimise-map-impl-for-tracked-players.patch similarity index 100% rename from patches/unapplied/server/Oprimise-map-impl-for-tracked-players.patch rename to patches/server/Oprimise-map-impl-for-tracked-players.patch diff --git a/patches/unapplied/server/Optimise-BlockSoil-nearby-water-lookup.patch b/patches/server/Optimise-BlockSoil-nearby-water-lookup.patch similarity index 100% rename from patches/unapplied/server/Optimise-BlockSoil-nearby-water-lookup.patch rename to patches/server/Optimise-BlockSoil-nearby-water-lookup.patch diff --git a/patches/unapplied/server/Optimize-HashMapPalette.patch b/patches/server/Optimize-HashMapPalette.patch similarity index 100% rename from patches/unapplied/server/Optimize-HashMapPalette.patch rename to patches/server/Optimize-HashMapPalette.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-data-components-copy-in-smithing-r.patch b/patches/server/Option-to-prevent-data-components-copy-in-smithing-r.patch similarity index 98% rename from patches/unapplied/server/Option-to-prevent-data-components-copy-in-smithing-r.patch rename to patches/server/Option-to-prevent-data-components-copy-in-smithing-r.patch index dd95527fed..35aa037fd9 100644 --- a/patches/unapplied/server/Option-to-prevent-data-components-copy-in-smithing-r.patch +++ b/patches/server/Option-to-prevent-data-components-copy-in-smithing-r.patch @@ -25,8 +25,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.base = base; this.addition = addition; @@ -0,0 +0,0 @@ public class SmithingTransformRecipe implements SmithingRecipe { - public ItemStack assemble(Container inventory, HolderLookup.Provider lookup) { - ItemStack itemstack = inventory.getItem(1).transmuteCopy(this.result.getItem(), this.result.getCount()); + public ItemStack assemble(SmithingRecipeInput input, HolderLookup.Provider lookup) { + ItemStack itemstack = input.base().transmuteCopy(this.result.getItem(), this.result.getCount()); + if (this.copyDataComponents) { // Paper - Option to prevent data components copy itemstack.applyComponents(this.result.getComponentsPatch()); diff --git a/patches/unapplied/server/Preserve-overstacked-loot.patch b/patches/server/Preserve-overstacked-loot.patch similarity index 100% rename from patches/unapplied/server/Preserve-overstacked-loot.patch rename to patches/server/Preserve-overstacked-loot.patch diff --git a/patches/unapplied/server/Prevent-ContainerOpenersCounter-openCount-from-going.patch b/patches/server/Prevent-ContainerOpenersCounter-openCount-from-going.patch similarity index 100% rename from patches/unapplied/server/Prevent-ContainerOpenersCounter-openCount-from-going.patch rename to patches/server/Prevent-ContainerOpenersCounter-openCount-from-going.patch diff --git a/patches/unapplied/server/Prevent-excessive-velocity-through-repeated-crits.patch b/patches/server/Prevent-excessive-velocity-through-repeated-crits.patch similarity index 97% rename from patches/unapplied/server/Prevent-excessive-velocity-through-repeated-crits.patch rename to patches/server/Prevent-excessive-velocity-through-repeated-crits.patch index 65e4bccdeb..3b63047cc1 100644 --- a/patches/unapplied/server/Prevent-excessive-velocity-through-repeated-crits.patch +++ b/patches/server/Prevent-excessive-velocity-through-repeated-crits.patch @@ -13,7 +13,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } + protected long lastJumpTime = 0L; // Paper - Prevent excessive velocity through repeated crits - protected void jumpFromGround() { + @VisibleForTesting + public void jumpFromGround() { float f = this.getJumpPower(); if (f > 1.0E-5F) { diff --git a/patches/unapplied/server/Prevent-softlocked-end-exit-portal-generation.patch b/patches/server/Prevent-softlocked-end-exit-portal-generation.patch similarity index 100% rename from patches/unapplied/server/Prevent-softlocked-end-exit-portal-generation.patch rename to patches/server/Prevent-softlocked-end-exit-portal-generation.patch diff --git a/patches/unapplied/server/Remove-client-side-code-using-deprecated-for-removal.patch b/patches/server/Remove-client-side-code-using-deprecated-for-removal.patch similarity index 87% rename from patches/unapplied/server/Remove-client-side-code-using-deprecated-for-removal.patch rename to patches/server/Remove-client-side-code-using-deprecated-for-removal.patch index 96ebdc863f..3814651071 100644 --- a/patches/unapplied/server/Remove-client-side-code-using-deprecated-for-removal.patch +++ b/patches/server/Remove-client-side-code-using-deprecated-for-removal.patch @@ -13,18 +13,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public class Util { } - public void openUrl(URL url) { + public void openUri(URI uri) { - try { - Process process = AccessController.doPrivileged( -- (PrivilegedExceptionAction)(() -> Runtime.getRuntime().exec(this.getOpenUrlArguments(url))) +- (PrivilegedExceptionAction)(() -> Runtime.getRuntime().exec(this.getOpenUriArguments(uri))) - ); - process.getInputStream().close(); - process.getErrorStream().close(); - process.getOutputStream().close(); - } catch (IOException | PrivilegedActionException var3) { -- Util.LOGGER.error("Couldn't open url '{}'", url, var3); +- Util.LOGGER.error("Couldn't open location '{}'", uri, var3); - } + throw new IllegalStateException("This method is not useful on dedicated servers."); // Paper - Fix warnings on build by removing client-only code } - public void openUri(URI uri) { + public void openFile(File file) { diff --git a/patches/unapplied/server/Sanitize-ResourceLocation-error-logging.patch b/patches/server/Sanitize-ResourceLocation-error-logging.patch similarity index 90% rename from patches/unapplied/server/Sanitize-ResourceLocation-error-logging.patch rename to patches/server/Sanitize-ResourceLocation-error-logging.patch index f2863e33ec..7523c295c8 100644 --- a/patches/unapplied/server/Sanitize-ResourceLocation-error-logging.patch +++ b/patches/server/Sanitize-ResourceLocation-error-logging.patch @@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/resources/ResourceLocation.java b/src/m index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/resources/ResourceLocation.java +++ b/src/main/java/net/minecraft/resources/ResourceLocation.java -@@ -0,0 +0,0 @@ public class ResourceLocation implements Comparable { +@@ -0,0 +0,0 @@ public final class ResourceLocation implements Comparable { private static String assertValidNamespace(String namespace, String path) { if (!isValidNamespace(namespace)) { @@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } else { return namespace; } -@@ -0,0 +0,0 @@ public class ResourceLocation implements Comparable { +@@ -0,0 +0,0 @@ public final class ResourceLocation implements Comparable { private static String assertValidPath(String namespace, String path) { if (!isValidPath(path)) { diff --git a/patches/unapplied/server/Time-scoreboard-search.patch b/patches/server/Time-scoreboard-search.patch similarity index 100% rename from patches/unapplied/server/Time-scoreboard-search.patch rename to patches/server/Time-scoreboard-search.patch diff --git a/patches/unapplied/server/Update-head-rotation-in-missing-places.patch b/patches/server/Update-head-rotation-in-missing-places.patch similarity index 100% rename from patches/unapplied/server/Update-head-rotation-in-missing-places.patch rename to patches/server/Update-head-rotation-in-missing-places.patch 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/don-t-attempt-to-teleport-dead-entities.patch b/patches/server/don-t-attempt-to-teleport-dead-entities.patch similarity index 96% rename from patches/unapplied/server/don-t-attempt-to-teleport-dead-entities.patch rename to patches/server/don-t-attempt-to-teleport-dead-entities.patch index a18e4840d5..b852113638 100644 --- a/patches/unapplied/server/don-t-attempt-to-teleport-dead-entities.patch +++ b/patches/server/don-t-attempt-to-teleport-dead-entities.patch @@ -14,6 +14,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // No clean way to break out of ticking once the entity has been copied to a new world, so instead we move the portalling later in the tick cycle - if (!(this instanceof ServerPlayer)) { + if (!(this instanceof ServerPlayer) && this.isAlive()) { // Paper - don't attempt to teleport dead entities - this.handleNetherPortal(); + this.handlePortal(); } } diff --git a/patches/unapplied/server/fix-various-menus-with-empty-level-accesses.patch b/patches/server/fix-various-menus-with-empty-level-accesses.patch similarity index 100% rename from patches/unapplied/server/fix-various-menus-with-empty-level-accesses.patch rename to patches/server/fix-various-menus-with-empty-level-accesses.patch diff --git a/patches/unapplied/server/prevent-unintended-light-block-manipulation.patch b/patches/server/prevent-unintended-light-block-manipulation.patch similarity index 100% rename from patches/unapplied/server/prevent-unintended-light-block-manipulation.patch rename to patches/server/prevent-unintended-light-block-manipulation.patch diff --git a/patches/unapplied/server/Add-EntityDamageItemEvent.patch b/patches/unapplied/server/Add-EntityDamageItemEvent.patch deleted file mode 100644 index 86ffdb0ace..0000000000 --- a/patches/unapplied/server/Add-EntityDamageItemEvent.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jake Potrebic -Date: Tue, 22 Dec 2020 13:52:48 -0800 -Subject: [PATCH] Add EntityDamageItemEvent - - -diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/item/ItemStack.java -+++ b/src/main/java/net/minecraft/world/item/ItemStack.java -@@ -0,0 +0,0 @@ public final class ItemStack implements DataComponentHolder { - return (Integer) this.getOrDefault(DataComponents.MAX_DAMAGE, 0); - } - -- public void hurtAndBreak(int amount, RandomSource random, @Nullable ServerPlayer player, Runnable breakCallback) { -+ public void hurtAndBreak(int amount, RandomSource random, @Nullable LivingEntity player, Runnable breakCallback) { // Paper - Add EntityDamageItemEvent - if (this.isDamageableItem()) { - int j; - -@@ -0,0 +0,0 @@ public final class ItemStack implements DataComponentHolder { - - amount -= k; - // CraftBukkit start -- if (player != null) { -- PlayerItemDamageEvent event = new PlayerItemDamageEvent(player.getBukkitEntity(), CraftItemStack.asCraftMirror(this), amount); -+ if (player instanceof ServerPlayer serverPlayer) { // Paper - Add EntityDamageItemEvent -+ PlayerItemDamageEvent event = new PlayerItemDamageEvent(serverPlayer.getBukkitEntity(), CraftItemStack.asCraftMirror(this), amount); // Paper - Add EntityDamageItemEvent - event.getPlayer().getServer().getPluginManager().callEvent(event); - - if (amount != event.getDamage() || event.isCancelled()) { -@@ -0,0 +0,0 @@ public final class ItemStack implements DataComponentHolder { - } - - amount = event.getDamage(); -+ // Paper start - Add EntityDamageItemEvent -+ } else if (player != null) { -+ io.papermc.paper.event.entity.EntityDamageItemEvent event = new io.papermc.paper.event.entity.EntityDamageItemEvent(player.getBukkitLivingEntity(), CraftItemStack.asCraftMirror(this), amount); -+ if (!event.callEvent()) { -+ return; -+ } -+ amount = event.getDamage(); -+ // Paper end - Add EntityDamageItemEvent - } - // CraftBukkit end - if (amount <= 0) { -@@ -0,0 +0,0 @@ public final class ItemStack implements DataComponentHolder { - } - } - -- if (player != null && amount != 0) { -- CriteriaTriggers.ITEM_DURABILITY_CHANGED.trigger(player, this, this.getDamageValue() + amount); -+ if (player instanceof ServerPlayer serverPlayer && amount != 0) { // Paper - Add EntityDamageItemEvent -+ CriteriaTriggers.ITEM_DURABILITY_CHANGED.trigger(serverPlayer, this, this.getDamageValue() + amount); // Paper - Add EntityDamageItemEvent - } - - j = this.getDamageValue() + amount; -@@ -0,0 +0,0 @@ public final class ItemStack implements DataComponentHolder { - entityplayer = null; - } - -- this.hurtAndBreak(amount, randomsource, entityplayer, () -> { -+ this.hurtAndBreak(amount, randomsource, entity, () -> { // Paper - Add EntityDamageItemEvent - entity.broadcastBreakEvent(slot); - Item item = this.getItem(); - // CraftBukkit start - Check for item breaking diff --git a/patches/unapplied/server/Add-back-EntityPortalExitEvent.patch b/patches/unapplied/server/Add-back-EntityPortalExitEvent.patch deleted file mode 100644 index 6c5d1feb9c..0000000000 --- a/patches/unapplied/server/Add-back-EntityPortalExitEvent.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jake Potrebic -Date: Sun, 16 May 2021 09:39:46 -0700 -Subject: [PATCH] Add back EntityPortalExitEvent - - -diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -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 SyncedDataHolder, Nameable, EntityAccess - } else { - // CraftBukkit start - worldserver = shapedetectorshape.world; -+ // Paper start - Call EntityPortalExitEvent -+ Vec3 position = shapedetectorshape.pos; -+ float yaw = shapedetectorshape.yRot; -+ float pitch = this.getXRot(); // Keep entity pitch as per moveTo line below -+ Vec3 velocity = shapedetectorshape.speed; -+ CraftEntity bukkitEntity = this.getBukkitEntity(); -+ org.bukkit.event.entity.EntityPortalExitEvent event = new org.bukkit.event.entity.EntityPortalExitEvent(bukkitEntity, -+ bukkitEntity.getLocation(), new Location(worldserver.getWorld(), position.x, position.y, position.z, yaw, pitch), -+ bukkitEntity.getVelocity(), org.bukkit.craftbukkit.util.CraftVector.toBukkit(shapedetectorshape.speed)); -+ event.callEvent(); -+ if (this.isRemoved()) { -+ return null; -+ } -+ -+ if (!event.isCancelled() && event.getTo() != null) { -+ worldserver = ((CraftWorld) event.getTo().getWorld()).getHandle(); -+ position = CraftLocation.toVec3D(event.getTo()); -+ yaw = event.getTo().getYaw(); -+ pitch = event.getTo().getPitch(); -+ velocity = org.bukkit.craftbukkit.util.CraftVector.toNMS(event.getAfter()); -+ } -+ // Paper end - Call EntityPortalExitEvent - if (worldserver == this.level) { - // SPIGOT-6782: Just move the entity if a plugin changed the world to the one the entity is already in - this.moveTo(shapedetectorshape.pos.x, shapedetectorshape.pos.y, shapedetectorshape.pos.z, shapedetectorshape.yRot, shapedetectorshape.xRot); -@@ -0,0 +0,0 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess - - if (entity != null) { - entity.restoreFrom(this); -- entity.moveTo(shapedetectorshape.pos.x, shapedetectorshape.pos.y, shapedetectorshape.pos.z, shapedetectorshape.yRot, entity.getXRot()); -- entity.setDeltaMovement(shapedetectorshape.speed); -+ entity.moveTo(position.x, position.y, position.z, yaw, pitch); // Paper - EntityPortalExitEvent -+ entity.setDeltaMovement(velocity); // Paper - EntityPortalExitEvent - // CraftBukkit start - Don't spawn the new entity if the current entity isn't spawned - if (this.inWorld) { - worldserver.addDuringTeleport(entity); diff --git a/patches/unapplied/server/Clear-bucket-NBT-after-dispense.patch b/patches/unapplied/server/Clear-bucket-NBT-after-dispense.patch deleted file mode 100644 index 7671481a18..0000000000 --- a/patches/unapplied/server/Clear-bucket-NBT-after-dispense.patch +++ /dev/null @@ -1,20 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jake Potrebic -Date: Fri, 13 Aug 2021 15:00:06 -0700 -Subject: [PATCH] Clear bucket NBT after dispense - - -diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java -+++ b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java -@@ -0,0 +0,0 @@ public interface DispenseItemBehavior { - Item item = Items.BUCKET; - stack.shrink(1); - if (stack.isEmpty()) { -- stack.setItem(Items.BUCKET); -- stack.setCount(1); -+ stack = new ItemStack(item); // Paper - Clear bucket NBT after dispense - } else if (pointer.blockEntity().addItem(new ItemStack(item)) < 0) { - this.defaultDispenseItemBehavior.dispense(pointer, new ItemStack(item)); - }