From 3ceb5297a3b5cf66edd23889213e0842ce080a1a Mon Sep 17 00:00:00 2001 From: William Blake Galbreath Date: Wed, 8 Jul 2020 11:24:30 -0500 Subject: [PATCH] Fix arrows never despawning MC-125757 This forces the despawn counter to start ticking regardless of state after the arrow has been alive for 200 ticks (10 seconds) instead of getting stuck in a never despawn state (bubble columns, etc). --- .../projectile/AbstractArrow.java.patch | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/paper-server/patches/sources/net/minecraft/world/entity/projectile/AbstractArrow.java.patch b/paper-server/patches/sources/net/minecraft/world/entity/projectile/AbstractArrow.java.patch index e427ce764e..dda4a1fe3c 100644 --- a/paper-server/patches/sources/net/minecraft/world/entity/projectile/AbstractArrow.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/entity/projectile/AbstractArrow.java.patch @@ -89,7 +89,15 @@ } public void setSoundEvent(SoundEvent sound) { -@@ -282,7 +306,7 @@ +@@ -220,6 +244,7 @@ + } + + } else { ++ if (tickCount > 200) this.tickDespawn(); // Paper - tick despawnCounter regardless after 10 seconds + this.inGroundTime = 0; + Vec3 vec3d2 = this.position(); + +@@ -282,7 +307,7 @@ if (movingobjectpositionentity == null) { if (this.isAlive() && blockHitResult.getType() != HitResult.Type.MISS) { @@ -98,7 +106,7 @@ this.hasImpulse = true; } } else { -@@ -290,7 +314,7 @@ +@@ -290,7 +315,7 @@ continue; } @@ -107,7 +115,7 @@ this.hasImpulse = true; if (this.getPierceLevel() > 0 && projectiledeflection == ProjectileDeflection.NONE) { -@@ -356,8 +380,8 @@ +@@ -356,8 +381,8 @@ protected void tickDespawn() { ++this.life; @@ -118,7 +126,7 @@ } } -@@ -386,9 +410,9 @@ +@@ -386,9 +411,9 @@ } @Override @@ -130,7 +138,7 @@ } } -@@ -423,7 +447,7 @@ +@@ -423,7 +448,7 @@ } if (this.piercingIgnoreEntityIds.size() >= this.getPierceLevel() + 1) { @@ -139,7 +147,7 @@ return; } -@@ -444,7 +468,13 @@ +@@ -444,7 +469,13 @@ int k = entity.getRemainingFireTicks(); if (this.isOnFire() && !flag) { @@ -154,7 +162,7 @@ } if (entity.hurtOrSimulate(damagesource, (float) i)) { -@@ -490,7 +520,7 @@ +@@ -490,7 +521,7 @@ this.playSound(this.soundEvent, 1.0F, 1.2F / (this.random.nextFloat() * 0.2F + 0.9F)); if (this.getPierceLevel() <= 0) { @@ -163,7 +171,7 @@ } } else { entity.setRemainingFireTicks(k); -@@ -506,7 +536,7 @@ +@@ -506,7 +537,7 @@ this.spawnAtLocation(worldserver2, this.getPickupItem(), 0.1F); } @@ -172,7 +180,7 @@ } } } -@@ -538,7 +568,7 @@ +@@ -538,7 +569,7 @@ Vec3 vec3d = this.getDeltaMovement().multiply(1.0D, 0.0D, 1.0D).normalize().scale(d0 * 0.6D * d1); if (vec3d.lengthSqr() > 0.0D) { @@ -181,7 +189,7 @@ } } -@@ -675,7 +705,7 @@ +@@ -675,7 +706,7 @@ } if (nbt.contains("weapon", 10)) { @@ -190,7 +198,7 @@ } else { this.firedFromWeapon = null; } -@@ -688,34 +718,31 @@ +@@ -688,34 +719,31 @@ Entity entity1 = entity; byte b0 = 0; @@ -237,7 +245,7 @@ } this.pickup = entityarrow_pickupstatus; -@@ -724,9 +751,24 @@ +@@ -724,9 +752,24 @@ @Override public void playerTouch(Player player) { if (!this.level().isClientSide && (this.isInGround() || this.isNoPhysics()) && this.shakeTime <= 0) {