Skip to content

Commit

Permalink
reduce moa spawn count + popom basics
Browse files Browse the repository at this point in the history
  • Loading branch information
MBatt1 committed Jan 10, 2025
1 parent 71ddcc3 commit 8ad8999
Show file tree
Hide file tree
Showing 14 changed files with 51 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.google.common.collect.ImmutableList;
import net.id.paradiselost.entities.passive.PopomEntity;
import net.minecraft.client.model.Dilation;
import net.minecraft.client.model.ModelData;
import net.minecraft.client.model.ModelPart;
import net.minecraft.client.model.ModelPartBuilder;
Expand Down Expand Up @@ -44,13 +45,13 @@ public static TexturedModelData getTexturedModelData() {
ModelData ModelData = new ModelData();
ModelPartData root = ModelData.getRoot();

ModelPartData body0 = root.addChild("body0", ModelPartBuilder.create().uv(0, 78).cuboid(-5.0F, -9.0F, -8.0F, 10.0F, 6.0F, 15.0F), ModelTransform.pivot(0.0F, 24.0F, 0.0F));
ModelPartData body0 = root.addChild("body0", ModelPartBuilder.create().uv(0, 78).cuboid(-5.0F, -9.0F, -8.0F, 10.0F, 6.0F, 15.0F, new Dilation(1F)), ModelTransform.pivot(0.0F, 24.0F, 0.0F));

ModelPartData body1 = root.addChild("body1", ModelPartBuilder.create().uv(0, 54).cuboid(-5.5F, -11.0F, -8.0F, 11.0F, 8.0F, 16.0F), ModelTransform.pivot(0.0F, 24.0F, 0.0F));
ModelPartData body1 = root.addChild("body1", ModelPartBuilder.create().uv(0, 54).cuboid(-5.5F, -11.0F, -8.0F, 11.0F, 8.0F, 16.0F, new Dilation(1.05F)), ModelTransform.pivot(0.0F, 24.0F, 0.0F));

ModelPartData body2 = root.addChild("body2", ModelPartBuilder.create().uv(0, 28).cuboid(-6.0F, -12.0F, -8.0F, 12.0F, 9.0F, 17.0F), ModelTransform.pivot(0.0F, 24.0F, 0.0F));
ModelPartData body2 = root.addChild("body2", ModelPartBuilder.create().uv(0, 28).cuboid(-6.0F, -12.0F, -8.0F, 12.0F, 9.0F, 17.0F, new Dilation(1.1F)), ModelTransform.pivot(0.0F, 24.0F, 0.0F));

ModelPartData body3 = root.addChild("body3", ModelPartBuilder.create().uv(0, 0).cuboid(-7.0F, -13.0F, -8.0F, 14.0F, 10.0F, 18.0F), ModelTransform.pivot(0.0F, 24.0F, 0.0F));
ModelPartData body3 = root.addChild("body3", ModelPartBuilder.create().uv(0, 0).cuboid(-7.0F, -13.0F, -8.0F, 14.0F, 10.0F, 18.0F, new Dilation(1.15F)), ModelTransform.pivot(0.0F, 24.0F, 0.0F));

ModelPartData head = root.addChild("head", ModelPartBuilder.create().uv(38, 54).cuboid(-4.0F, -2.0F, -4.0F, 8.0F, 4.0F, 4.0F)
.uv(38, 62).cuboid(-3.0F, -5.0F, -5.0F, 6.0F, 3.0F, 3.0F), ModelTransform.pivot(0.0F, 19.0F, -8.0F));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
package net.id.paradiselost.entities.passive;

import net.id.paradiselost.tag.ParadiseLostItemTags;
import net.id.paradiselost.util.ParadiseLostSoundEvents;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.ai.goal.AnimalMateGoal;
import net.minecraft.entity.ai.goal.EscapeDangerGoal;
import net.minecraft.entity.ai.goal.FollowParentGoal;
import net.minecraft.entity.ai.goal.LookAroundGoal;
import net.minecraft.entity.ai.goal.LookAtEntityGoal;
import net.minecraft.entity.ai.goal.SwimGoal;
import net.minecraft.entity.ai.goal.TemptGoal;
import net.minecraft.entity.ai.goal.WanderAroundFarGoal;
import net.minecraft.entity.attribute.DefaultAttributeContainer;
import net.minecraft.entity.attribute.EntityAttributes;
import net.minecraft.entity.data.DataTracker;
import net.minecraft.entity.data.TrackedData;
import net.minecraft.entity.data.TrackedDataHandlerRegistry;
import net.minecraft.entity.passive.AnimalEntity;
import net.minecraft.entity.passive.PassiveEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.registry.tag.ItemTags;
Expand All @@ -30,6 +40,21 @@ protected void initDataTracker(DataTracker.Builder builder) {
builder.add(FUR_SIZE, 0);
}

@Override
protected void initGoals() {

this.goalSelector.add(0, new SwimGoal(this));
this.goalSelector.add(1, new EscapeDangerGoal(this, 1.1));
this.goalSelector.add(2, new AnimalMateGoal(this, 0.9));
this.goalSelector.add(3, new TemptGoal(this, 0.8, stack -> stack.isIn(ParadiseLostItemTags.MOA_TEMPTABLES), false));
this.goalSelector.add(4, new FollowParentGoal(this, 1.05));
this.goalSelector.add(6, new WanderAroundFarGoal(this, 0.6));
this.goalSelector.add(7, new LookAtEntityGoal(this, PlayerEntity.class, 8.0F));
this.goalSelector.add(8, new LookAroundGoal(this));

super.initGoals();
}

// Custom sounds for Popom
@Override
protected SoundEvent getAmbientSound() {
Expand Down Expand Up @@ -61,13 +86,13 @@ public PassiveEntity createChild(ServerWorld world, PassiveEntity entity) {
@Override
public void writeCustomDataToNbt(NbtCompound compound) {
super.writeCustomDataToNbt(compound);
compound.putInt("furSize", this.dataTracker.get(FUR_SIZE));
compound.putInt("FurSize", this.dataTracker.get(FUR_SIZE));
}

@Override
public void readCustomDataFromNbt(NbtCompound compound) {
super.readCustomDataFromNbt(compound);
this.dataTracker.set(FUR_SIZE, compound.getInt("furSize"));
this.dataTracker.set(FUR_SIZE, compound.getInt("FurSize"));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ protected void initGoals() {
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 WanderAroundFarGoal(this, 0.32F, 0.01f)); //WanderGoal
this.goalSelector.add(9, new MoaWanderAroundGoal(this, 0.320D, 230));
//this.goalSelector.add(10, new MoaWanderAroundGoal(this, 0.400D, 290));
this.goalSelector.add(10, new LookAroundGoal(this)); //LookGoal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,15 @@
import net.minecraft.fluid.Fluids;
import net.minecraft.item.*;
import net.minecraft.item.Item.Settings;
import net.minecraft.item.map.MapDecorationTypes;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.registry.TradeRebalanceBuiltinRegistries;
import net.minecraft.registry.entry.RegistryEntry;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import net.minecraft.util.Identifier;
import net.minecraft.util.Rarity;
import net.minecraft.util.Util;
import net.minecraft.util.math.Direction;
import net.minecraft.village.TradeOffers;
import org.jetbrains.annotations.NotNull;

import java.util.Arrays;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import net.minecraft.block.MapColor;
import net.minecraft.item.FilledMapItem;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3i;
import net.minecraft.world.BlockView;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@
"creature": [
{
"type": "paradise_lost:moa",
"maxCount": 13,
"minCount": 5,
"maxCount": 4,
"minCount": 2,
"weight": 6
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@
"creature": [
{
"type": "paradise_lost:moa",
"maxCount": 13,
"minCount": 5,
"maxCount": 4,
"minCount": 2,
"weight": 6
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@
"creature": [
{
"type": "paradise_lost:moa",
"maxCount": 13,
"minCount": 5,
"maxCount": 4,
"minCount": 2,
"weight": 6
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@
"creature": [
{
"type": "paradise_lost:moa",
"maxCount": 13,
"minCount": 5,
"maxCount": 4,
"minCount": 2,
"weight": 6
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@
"creature": [
{
"type": "paradise_lost:moa",
"maxCount": 13,
"minCount": 5,
"maxCount": 4,
"minCount": 2,
"weight": 6
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@
"creature": [
{
"type": "paradise_lost:moa",
"maxCount": 13,
"minCount": 5,
"maxCount": 4,
"minCount": 2,
"weight": 6
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@
"creature": [
{
"type": "paradise_lost:moa",
"maxCount": 13,
"minCount": 5,
"maxCount": 4,
"minCount": 2,
"weight": 6
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
"creature": [
{
"type": "paradise_lost:moa",
"maxCount": 13,
"minCount": 5,
"maxCount": 4,
"minCount": 2,
"weight": 6
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@
"creature": [
{
"type": "paradise_lost:moa",
"maxCount": 13,
"minCount": 5,
"maxCount": 4,
"minCount": 2,
"weight": 6
}
],
Expand Down

0 comments on commit 8ad8999

Please sign in to comment.