mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-14 01:04:12 +00:00
#19 end butterfly lifecycle after a Minecraft week
This commit is contained in:
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--;
|
||||
|
||||
Reference in new issue
Block a user