Skip to content

Commit 62c1e47

Browse files
committed
Fix aquatics growth
1 parent 1125300 commit 62c1e47

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

src/main/java/drzhark/mocreatures/entity/aquatic/MoCEntityDolphin.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ public class MoCEntityDolphin extends MoCEntityTameableAquatic {
4343
public MoCEntityDolphin(World world) {
4444
super(world);
4545
setSize(1.3F, 0.605F);
46-
setAdult(true);
4746
// TODO: Make hitboxes adjust depending on size
4847
//setAge(60 + this.rand.nextInt(100));
4948
setAge(120);
@@ -322,11 +321,11 @@ public void onLivingUpdate() {
322321
setIsHungry(true);
323322
}*/
324323
// fixes growth
324+
if (getAge() >= 120) {
325+
setAdult(true);
326+
}
325327
if (!getIsAdult() && (rand.nextInt(50) == 0)) {
326328
setAge(getAge() + 1);
327-
if (getAge() >= 150) {
328-
setAdult(true);
329-
}
330329
}
331330
//TODO
332331
if ((!this.isBeingRidden()) && (this.deathTime == 0) && (!getIsTamed() || getIsHungry())) {

src/main/java/drzhark/mocreatures/entity/aquatic/MoCEntityShark.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
import drzhark.mocreatures.MoCreatures;
77
import drzhark.mocreatures.entity.MoCEntityAquatic;
8-
import drzhark.mocreatures.entity.ai.EntityAIHuntAquatic;
98
import drzhark.mocreatures.entity.ai.EntityAITargetNonTamedMoC;
109
import drzhark.mocreatures.entity.ai.EntityAIWanderMoC2;
1110
import drzhark.mocreatures.entity.item.MoCEntityEgg;
@@ -18,7 +17,6 @@
1817
import net.minecraft.entity.SharedMonsterAttributes;
1918
import net.minecraft.entity.ai.EntityAIAttackMelee;
2019
import net.minecraft.entity.ai.EntityAIHurtByTarget;
21-
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
2220
import net.minecraft.entity.passive.EntityWolf;
2321
import net.minecraft.entity.player.EntityPlayer;
2422
import net.minecraft.init.SoundEvents;
@@ -37,7 +35,6 @@ public MoCEntityShark(World world) {
3735
super(world);
3836
this.texture = "shark.png";
3937
setSize(1.65F, 0.9F);
40-
setAdult(true);
4138
// TODO: Make hitboxes adjust depending on size
4239
//setAge(60 + this.rand.nextInt(100));
4340
setAge(160);
@@ -143,11 +140,11 @@ public EntityLivingBase FindTarget(Entity entity, double d) {
143140
public void onLivingUpdate() {
144141
super.onLivingUpdate();
145142
if (!this.world.isRemote) {
143+
if (getAge() >= 160) {
144+
setAdult(true);
145+
}
146146
if (!getIsAdult() && (this.rand.nextInt(50) == 0)) {
147147
setAge(getAge() + 1);
148-
if (getAge() >= 200) {
149-
setAdult(true);
150-
}
151148
}
152149
}
153150
}

0 commit comments

Comments
 (0)