Skip to content

Commit

Permalink
Small moa changes
Browse files Browse the repository at this point in the history
  • Loading branch information
MrXBlade committed Nov 19, 2024
1 parent abc4bb0 commit 463bed3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ public static DefaultAttributeContainer.Builder createMoaAttributes() {
return createMobAttributes()
.add(EntityAttributes.GENERIC_MAX_HEALTH, 35.0D)
.add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 1.0D)
.add(EntityAttributes.GENERIC_STEP_HEIGHT, 1.0)
.add(EntityAttributes.GENERIC_STEP_HEIGHT, 1.0);
//.add(EntityAttributes.GENERIC_GRAVITY, 0.95f)
.add(EntityAttributes.GENERIC_JUMP_STRENGTH, 0.22f)
.add(EntityAttributes.GENERIC_FLYING_SPEED, 0.5f);
//.add(EntityAttributes.GENERIC_JUMP_STRENGTH, 0.22f)
//.add(EntityAttributes.GENERIC_FLYING_SPEED, 0.5f);
}

@Override
Expand All @@ -105,16 +105,16 @@ protected void initGoals() {
this.goalSelector.add(2, new TemptGoal(this, 0.7D, Ingredient.fromTag(ParadiseLostItemTags.MOA_TEMPTABLES), false));


this.goalSelector.add(7, new LookAtEntityGoal(this, ParrotEntity.class, 18F, 5f));
this.goalSelector.add(7, new StopAndLookAtEntityGoal(this, ParrotEntity.class, 25, 8f));
this.goalSelector.add(7, new LookAtEntityGoal(this, ParrotEntity.class, 18F, 100f));
this.goalSelector.add(7, new StopAndLookAtEntityGoal(this, ParrotEntity.class, 25, 120f));

this.goalSelector.add(8, new LookAtEntityGoal(this, LivingEntity.class, 10F, 40f));
this.goalSelector.add(8, new StopAndLookAtEntityGoal(this, LivingEntity.class, 4, 70f));
this.goalSelector.add(8, new LookAtEntityGoal(this, LivingEntity.class, 10F, 150f));
this.goalSelector.add(8, new StopAndLookAtEntityGoal(this, LivingEntity.class, 4, 180f));

//this.goalSelector.add(9, new WanderAroundFarGoal(this, 0.32F, 0.01f)); //WanderGoal
this.goalSelector.add(9, new MoaWanderAroundGoal(this, 0.320D, 210));
this.goalSelector.add(9, new MoaWanderAroundGoal(this, 0.320D, 230));
//this.goalSelector.add(10, new MoaWanderAroundGoal(this, 0.400D, 290));
this.goalSelector.add(11, new LookAroundGoal(this)); //LookGoal
this.goalSelector.add(10, new LookAroundGoal(this)); //LookGoal
this.goalSelector.add(1, new SwimGoal(this));
this.goalSelector.add(12, new FollowParentGoal(this, 0.33D));

Expand Down Expand Up @@ -291,10 +291,10 @@ public float getWingRoll() {
curWingRoll = MathHelper.sin(age / wingFlapSpeed) * 0.73F + 0.1F;
atWingBottom = false; // Reset peak for landing
} else {
//Base position when not flapping etc
float baseWingRoll = MathHelper.sin(age / idleFlapSpeed) * 0.05F + 1.39626F; //Idle position (Default was 1.39626)
//Base position when not flapping etc, this sine is for "breating" animations
float baseWingRoll = MathHelper.sin(age / idleFlapSpeed + (randFlapSpeed * 0.1f)) * 0.05F + 1.39626F; //Idle position (Default was 1.39626)
float lDif = -baseWingRoll - curWingRoll;
if (Math.abs(lDif) > 0.005F) {
if (Math.abs(lDif) > 0.0005F) {
curWingRoll += lDif / 6;
}
}
Expand Down Expand Up @@ -715,6 +715,7 @@ public void readCustomDataFromNbt(NbtCompound compound) {
inventory.readNbtList(compound.getList("chestContents", NbtElement.COMPOUND_TYPE), this.getRegistryManager());
}

setMovementSpeed(genes.getAttribute(MoaAttributes.GROUND_SPEED));
calcGeneSpeeds();
moaSoundCallCooldown = 50 + random.nextInt(150);
songChance = MathHelper.clamp(random.nextFloat(), 0f, 0.3f);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public boolean canStart() {
double highestY = Double.NEGATIVE_INFINITY;

//Take 3 samples, get the one with the highest Y value
for (int i = 0; i < 4; i++) {
for (int i = 0; i < 2; i++) {
Vec3d sampleTarget = this.getWanderTarget();
if (sampleTarget != null && sampleTarget.y > highestY) {
highestY = sampleTarget.y;
Expand Down

0 comments on commit 463bed3

Please sign in to comment.