aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0828-Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch
diff options
context:
space:
mode:
authorNassim Jahnke <[email protected]>2022-10-02 09:56:36 +0200
committerGitHub <[email protected]>2022-10-02 09:56:36 +0200
commit928bcc8d3a058221146cea1de7d42d7e178e78f2 (patch)
treefdb518a8812097f983c41d36ea693baf5c208554 /patches/server/0828-Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch
parentec3cfa9b7f147cf097692144f665893748fadc3b (diff)
downloadPaper-928bcc8d3a058221146cea1de7d42d7e178e78f2.tar.gz
Paper-928bcc8d3a058221146cea1de7d42d7e178e78f2.zip
Updated Upstream (Bukkit/CraftBukkit) (#8430)
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 09943450 Update SnakeYAML version 5515734f SPIGOT-7162: Incorrect description for Entity#getVehicle javadoc 6f82b381 PR-788: Add getHand() to all relevant events CraftBukkit Changes: aaf484f6f SPIGOT-7163: CraftMerchantRecipe doesn't copy demand and specialPrice from BukkitMerchantRecipe 5329dd6fd PR-1107: Add getHand() to all relevant events 93061706e SPIGOT-7045: Ocelots never spawn with babies with spawn reason OCELOT_BABY
Diffstat (limited to 'patches/server/0828-Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch')
-rw-r--r--patches/server/0828-Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch37
1 files changed, 0 insertions, 37 deletions
diff --git a/patches/server/0828-Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch b/patches/server/0828-Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch
deleted file mode 100644
index a9cdda7a75..0000000000
--- a/patches/server/0828-Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Jake Potrebic <[email protected]>
-Date: Sat, 19 Feb 2022 19:05:59 -0800
-Subject: [PATCH] Fix cancelling ProjectileHitEvent for piercing arrows
-
-Piercing arrows search for multiple entities inside a while
-loop that is checking the projectile entity's removed state.
-If the hit event is cancelled on the first entity, the event will
-be called over and over again inside that while loop until the event
-is not cancelled. The solution here, is to make use of an
-already-existing field on AbstractArrow for tracking entities hit by
-piercing arrows to avoid duplicate damage being applied.
-
-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 8564ecd20578d907bcfa1b9c149da22e424e254a..bc01e5014e1355a225bdf5c47f2965290b45e2d2 100644
---- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
-+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
-@@ -300,6 +300,19 @@ public abstract class AbstractArrow extends Projectile {
- }
- }
-
-+ // Paper start
-+ @Override
-+ protected void preOnHit(HitResult hitResult) {
-+ super.preOnHit(hitResult);
-+ if (hitResult instanceof EntityHitResult entityHitResult && this.hitCancelled && this.getPierceLevel() > 0) {
-+ if (this.piercingIgnoreEntityIds == null) {
-+ this.piercingIgnoreEntityIds = new IntOpenHashSet(5);
-+ }
-+ this.piercingIgnoreEntityIds.add(entityHitResult.getEntity().getId());
-+ }
-+ }
-+ // Paper end
-+
- private boolean shouldFall() {
- return this.inGround && this.level.noCollision((new AABB(this.position(), this.position())).inflate(0.06D));
- }