Fix arrows and fireworks not having their despawn counters ticked when inactive

This commit is contained in:
Thinkofdeath 2014-04-14 17:22:45 +01:00
parent e8f4653025
commit 7313a6b822
2 changed files with 46 additions and 7 deletions

View File

@ -1,4 +1,4 @@
From 6232c33ae23c495c7aebf1e6575a39d2132ff76c Mon Sep 17 00:00:00 2001
From ab979a085fe27c1d0b799b69288544965117daa3 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 3 Feb 2013 05:10:21 -0500
Subject: [PATCH] Entity Activation Range
@ -85,7 +85,7 @@ index 36ed831..7ddca48 100644
super(world);
}
diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java
index 3628774..c2afb17 100644
index 3628774..3137bcf 100644
--- a/src/main/java/net/minecraft/server/EntityArrow.java
+++ b/src/main/java/net/minecraft/server/EntityArrow.java
@@ -15,7 +15,7 @@ public class EntityArrow extends Entity implements IProjectile {
@ -97,6 +97,45 @@ index 3628774..c2afb17 100644
public int fromPlayer;
public int shake;
public Entity shooter;
@@ -24,6 +24,18 @@ public class EntityArrow extends Entity implements IProjectile {
private double damage = 2.0D;
public int knockbackStrength; // CraftBukkit - private -> public
+ // Spigot Start
+ @Override
+ public void inactiveTick()
+ {
+ if ( this.inGround )
+ {
+ this.at += 19; // Despawn counter. First int after shooter
+ }
+ super.inactiveTick();
+ }
+ // Spigot End
+
public EntityArrow(World world) {
super(world);
this.j = 10.0D;
diff --git a/src/main/java/net/minecraft/server/EntityFireworks.java b/src/main/java/net/minecraft/server/EntityFireworks.java
index a228a2c..0a81006 100644
--- a/src/main/java/net/minecraft/server/EntityFireworks.java
+++ b/src/main/java/net/minecraft/server/EntityFireworks.java
@@ -5,6 +5,15 @@ public class EntityFireworks extends Entity {
private int ticksFlown;
public int expectedLifespan; // CraftBukkit - private -> public
+ // Spigot Start
+ @Override
+ public void inactiveTick()
+ {
+ this.ticksFlown += 19;
+ super.inactiveTick();
+ }
+ // Spigot End
+
public EntityFireworks(World world) {
super(world);
this.a(0.25F, 0.25F);
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index f90e2a3..6c77253 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
@ -477,5 +516,5 @@ index 46249d7..ed2836a 100644
+ }
}
--
1.8.3.2
1.8.5.2.msysgit.0

View File

@ -1,14 +1,14 @@
From 7f4fc5deeaf1722ba8bb9330f990688f9bf8f607 Mon Sep 17 00:00:00 2001
From 5b09851dfc3f83d53d8591efac06dbdb9079b90d Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Mon, 14 Oct 2013 19:20:10 +1100
Subject: [PATCH] Arrow Despawn Rate
diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java
index c2afb17..08232d5 100644
index 3137bcf..344f917 100644
--- a/src/main/java/net/minecraft/server/EntityArrow.java
+++ b/src/main/java/net/minecraft/server/EntityArrow.java
@@ -144,7 +144,7 @@ public class EntityArrow extends Entity implements IProjectile {
@@ -156,7 +156,7 @@ public class EntityArrow extends Entity implements IProjectile {
if (block == this.g && i == this.h) {
++this.at;
@ -34,5 +34,5 @@ index 82d59e7..2ec047c 100644
+ }
}
--
1.8.3.2
1.8.5.2.msysgit.0