#19 end butterfly lifecycle after a Minecraft week

This commit is contained in:
mezz committed 2015-02-04 01:18:37 -08:00
1 parent f6e1147271
commit dceffe23c3
1 file changed
+8
@@ -108,6 +108,8 @@ public class EntityButterfly extends EntityCreature implements IEntityButterfly
public int cooldownPollination = 0;
public int cooldownEgg = 0;
public int lifespanRemaining = 24000 * 7; // one minecraft week in ticks
/* CONSTRUCTOR */
public EntityButterfly(World world) {
super(world);
@@ -455,6 +457,12 @@ public class EntityButterfly extends EntityCreature implements IEntityButterfly
attackEntityFrom(DamageSource.generic, 1);
}
if (lifespanRemaining > 0) {
lifespanRemaining--;
} else {
attackEntityFrom(DamageSource.generic, 1);
}
// Reduce cooldowns
if (cooldownEgg > 0) {
cooldownEgg--;