mirror of
https://github.com/BX-Team/DivineMC.git
synced 2025-12-19 14:59:25 +00:00
25 lines
1.3 KiB
Diff
25 lines
1.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
|
Date: Wed, 4 Nov 2020 13:12:50 -0600
|
|
Subject: [PATCH] Arrows should not reset despawn counter
|
|
|
|
This prevents keeping arrows alive indefinitely (such as when the block
|
|
the arrow is stuck in gets removed, like a piston head going up/down)
|
|
|
|
Original code by PurpurMC, licensed under MIT
|
|
You can find the original code on https://github.com/PurpurMC/Purpur
|
|
|
|
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 5d6d26cfe8f0ab68a3145214b3fc126ca7a71a66..6d00e5d22147ae69de3723a46eabf0ecc577d421 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
|
@@ -312,7 +312,7 @@ public abstract class AbstractArrow extends Projectile {
|
|
Vec3 vec3d = this.getDeltaMovement();
|
|
|
|
this.setDeltaMovement(vec3d.multiply((double) (this.random.nextFloat() * 0.2F), (double) (this.random.nextFloat() * 0.2F), (double) (this.random.nextFloat() * 0.2F)));
|
|
- this.life = 0;
|
|
+ // this.life = 0; // Purpur - do not reset despawn counter
|
|
}
|
|
|
|
@Override
|