diff --git a/src/main/java/net/id/paradiselost/client/model/ParadiseLostModelLayers.java b/src/main/java/net/id/paradiselost/client/model/ParadiseLostModelLayers.java index fff5b1978..9984b91f4 100644 --- a/src/main/java/net/id/paradiselost/client/model/ParadiseLostModelLayers.java +++ b/src/main/java/net/id/paradiselost/client/model/ParadiseLostModelLayers.java @@ -28,6 +28,7 @@ public class ParadiseLostModelLayers { public static final EntityModelLayer ENVOY_OUTER_ARMOR = register("envoy", "outer_armor", OUTER_ARMOR_MODEL_DATA); public static final EntityModelLayer MOA = register("moa", "main", MoaModel.getTexturedModelData()); public static final EntityModelLayer PHOENIX_ARMOR = register("phoenix_armor", "main", PhoenixArmorModel.getTexturedModelData()); + public static final EntityModelLayer POPOM = register("popom", "main", EnvoyEntityModel.getTexturedModelData()); public static EntityModelLayer register(Identifier id, String layer, TexturedModelData data) { diff --git a/src/main/java/net/id/paradiselost/client/rendering/entity/ParadiseLostEntityRenderers.java b/src/main/java/net/id/paradiselost/client/rendering/entity/ParadiseLostEntityRenderers.java index 0c0a2ac98..268caf0c3 100644 --- a/src/main/java/net/id/paradiselost/client/rendering/entity/ParadiseLostEntityRenderers.java +++ b/src/main/java/net/id/paradiselost/client/rendering/entity/ParadiseLostEntityRenderers.java @@ -5,6 +5,7 @@ import net.fabricmc.fabric.api.client.rendering.v1.EntityRendererRegistry; import net.id.paradiselost.client.rendering.entity.hostile.EnvoyEntityRenderer; import net.id.paradiselost.client.rendering.entity.passive.MoaEntityRenderer; +import net.id.paradiselost.client.rendering.entity.passive.PopomEntityRenderer; import net.id.paradiselost.entities.ParadiseLostEntityTypes; import net.minecraft.client.render.entity.EntityRendererFactory; import net.minecraft.client.render.entity.FlyingItemEntityRenderer; @@ -24,6 +25,8 @@ public static void initClient() { // passive register(ParadiseLostEntityTypes.MOA, MoaEntityRenderer::new); + register(ParadiseLostEntityTypes.POPOM, PopomEntityRenderer::new); + // projectile register(ParadiseLostEntityTypes.THROWN_NITRA, FlyingItemEntityRenderer::new); } diff --git a/src/main/java/net/id/paradiselost/client/rendering/entity/passive/PopomEntityRenderer.java b/src/main/java/net/id/paradiselost/client/rendering/entity/passive/PopomEntityRenderer.java new file mode 100644 index 000000000..d284fbca9 --- /dev/null +++ b/src/main/java/net/id/paradiselost/client/rendering/entity/passive/PopomEntityRenderer.java @@ -0,0 +1,25 @@ +package net.id.paradiselost.client.rendering.entity.passive; + +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; +import net.id.paradiselost.ParadiseLost; +import net.id.paradiselost.client.model.ParadiseLostModelLayers; +import net.id.paradiselost.entities.passive.PopomEntity; +import net.minecraft.client.render.entity.EntityRendererFactory; +import net.minecraft.client.render.entity.PigEntityRenderer; +import net.id.paradiselost.client.rendering.entity.passive.PopomEntityRenderer; +import net.minecraft.entity.passive.PigEntity; +import net.minecraft.util.Identifier; + +@Environment(EnvType.CLIENT) +public class PopomEntityRenderer extends PigEntityRenderer { + private static final Identifier TEXTURE = ParadiseLost.locate("textures/entity/popom/popom.png"); + + public PopomEntityRenderer(EntityRendererFactory.Context renderManager) { + super(renderManager); + } + + public Identifier getTexture(PigEntity entity) { + return TEXTURE; + } +} \ No newline at end of file diff --git a/src/main/java/net/id/paradiselost/entities/ParadiseLostEntityTypes.java b/src/main/java/net/id/paradiselost/entities/ParadiseLostEntityTypes.java index c667c709c..9addeee5e 100644 --- a/src/main/java/net/id/paradiselost/entities/ParadiseLostEntityTypes.java +++ b/src/main/java/net/id/paradiselost/entities/ParadiseLostEntityTypes.java @@ -6,6 +6,7 @@ import net.id.paradiselost.entities.block.SliderEntity; import net.id.paradiselost.entities.hostile.EnvoyEntity; import net.id.paradiselost.entities.passive.ParadiseLostAnimalEntity; +import net.id.paradiselost.entities.passive.PopomEntity; import net.id.paradiselost.entities.passive.moa.MoaEntity; import net.id.paradiselost.entities.projectile.ThrownNitraEntity; import net.minecraft.entity.*; @@ -41,6 +42,9 @@ public class ParadiseLostEntityTypes { public static final EntityType MOA = add("moa", of(MoaEntity::new, CREATURE, changing(1.0F, 2.0F), 5), attributes(MoaEntity::createMoaAttributes), spawnRestrictions(ParadiseLostAnimalEntity::isValidNaturalParadiseLostSpawn)); + public static final EntityType POPOM = add("popom", of(PopomEntity::new, CREATURE, changing(1.0F, 2.0F), 5), + attributes(PopomEntity::createPopomAttributes), spawnRestrictions(PopomEntity::canMobSpawn)); + // projectile public static final EntityType THROWN_NITRA = add("thrown_nitra", of(ThrownNitraEntity::new, MISC, changing(0.5F, 0.5F), 5)); diff --git a/src/main/java/net/id/paradiselost/entities/passive/PopomEntity.java b/src/main/java/net/id/paradiselost/entities/passive/PopomEntity.java new file mode 100644 index 000000000..8dcaed3b4 --- /dev/null +++ b/src/main/java/net/id/paradiselost/entities/passive/PopomEntity.java @@ -0,0 +1,51 @@ +package net.id.paradiselost.entities.passive; + +import net.id.paradiselost.util.ParadiseLostSoundEvents; +import net.minecraft.entity.EntityType; +import net.minecraft.entity.attribute.DefaultAttributeContainer; +import net.minecraft.entity.attribute.EntityAttributes; +import net.minecraft.entity.passive.PigEntity; +import net.minecraft.nbt.NbtCompound; +import net.minecraft.sound.SoundEvent; +import net.minecraft.world.World; + +public class PopomEntity extends PigEntity { + + public PopomEntity(EntityType entityType, World world) { + super(entityType, world); + } + + // Custom sounds for Popom + @Override + protected SoundEvent getAmbientSound() { + return ParadiseLostSoundEvents.ENTITY_POPOM_AMBIENT; + } +/* @Override + protected SoundEvent getHurtSound(DamageSource source) { + return ParadiseLostSoundEvents.ENTITY_POPOM_HURT; + }*/ + + @Override + protected SoundEvent getDeathSound() { + return ParadiseLostSoundEvents.ENTITY_POPOM_DEATH; + } + + // Define attributes for Popom + public static DefaultAttributeContainer.Builder createPopomAttributes() { + return createMobAttributes() + .add(EntityAttributes.GENERIC_MAX_HEALTH, 20.0D) + .add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.25D); + } + + @Override + public void writeCustomDataToNbt(NbtCompound compound) { + super.writeCustomDataToNbt(compound); + // Any custom data you want to save + } + + @Override + public void readCustomDataFromNbt(NbtCompound compound) { + super.readCustomDataFromNbt(compound); + // Any custom data you want to load + } +} \ No newline at end of file diff --git a/src/main/java/net/id/paradiselost/entities/passive/moa/MoaEntity.java b/src/main/java/net/id/paradiselost/entities/passive/moa/MoaEntity.java index fe3b66e7c..5fdee1747 100644 --- a/src/main/java/net/id/paradiselost/entities/passive/moa/MoaEntity.java +++ b/src/main/java/net/id/paradiselost/entities/passive/moa/MoaEntity.java @@ -314,8 +314,7 @@ public void attemptMoaSound() } } private boolean canFlap = true; - public void attemptMoaFlap(boolean bypassFlapCheck) - { + public void attemptMoaFlap(boolean bypassFlapCheck) { if (getWingRoll() > 0.8 && canFlap || bypassFlapCheck) { this.getWorld().playSound(null, this.getX(), this.getY(), this.getZ(), ParadiseLostSoundEvents.ENTITY_MOA_GLIDING, SoundCategory.NEUTRAL, 0.25F, getRandomFloat(0.9f, 0.97f)); canFlap = false; diff --git a/src/main/java/net/id/paradiselost/items/ParadiseLostItemGroups.java b/src/main/java/net/id/paradiselost/items/ParadiseLostItemGroups.java index a1b4ff9e3..734ce65c9 100644 --- a/src/main/java/net/id/paradiselost/items/ParadiseLostItemGroups.java +++ b/src/main/java/net/id/paradiselost/items/ParadiseLostItemGroups.java @@ -324,6 +324,7 @@ public static void init() { .register((itemGroup) -> { itemGroup.add(MOA_SPAWN_EGG); itemGroup.add(ENVOY_SPAWN_EGG); + itemGroup.add(POPOM_SPAWN_EGG); }); } diff --git a/src/main/java/net/id/paradiselost/items/ParadiseLostItems.java b/src/main/java/net/id/paradiselost/items/ParadiseLostItems.java index b905ef5bf..a20666bff 100644 --- a/src/main/java/net/id/paradiselost/items/ParadiseLostItems.java +++ b/src/main/java/net/id/paradiselost/items/ParadiseLostItems.java @@ -209,6 +209,7 @@ private static Settings food(FoodComponent foodComponent) { public static final SpawnEggItem ENVOY_SPAWN_EGG = add("envoy_spawn_egg", new SpawnEggItem(ParadiseLostEntityTypes.ENVOY, 0xc5b1af, 0x993c3c, new Settings()), spawnEggBehavior); public static final SpawnEggItem MOA_SPAWN_EGG = add("moa_spawn_egg", new SpawnEggItem(ParadiseLostEntityTypes.MOA, 0xC55C2E4, 0xB3A8BB, new Settings()), spawnEggBehavior); + public static final SpawnEggItem POPOM_SPAWN_EGG = add("popom_spawn_egg", new SpawnEggItem(ParadiseLostEntityTypes.POPOM, 0xd984e8, 0xd4d0cf, new Settings()), spawnEggBehavior); public static final BlockItem BLOOMED_CALCITE = add(ParadiseLostBlocks.BLOOMED_CALCITE); diff --git a/src/main/java/net/id/paradiselost/util/ParadiseLostSoundEvents.java b/src/main/java/net/id/paradiselost/util/ParadiseLostSoundEvents.java index d1fdf8e11..7fca59410 100644 --- a/src/main/java/net/id/paradiselost/util/ParadiseLostSoundEvents.java +++ b/src/main/java/net/id/paradiselost/util/ParadiseLostSoundEvents.java @@ -37,6 +37,11 @@ public final class ParadiseLostSoundEvents { public static final SoundEvent ENTITY_MOA_EGG_HATCH = register("entity.moa.egg_hatch"); public static final SoundEvent ENTITY_MOA_STEP = register("entity.moa.step"); + public static final SoundEvent ENTITY_POPOM_AMBIENT = register(("entity.popom.ambient")); + public static final SoundEvent ENTITY_POPOM_HURT = register(("entity.popom.hurt")); + public static final SoundEvent ENTITY_POPOM_DEATH = register(("entity.popom.death")); + + public static final SoundEvent ENTITY_ENVOY_AMBIENT = register(("entity.envoy.ambient")); public static final SoundEvent ENTITY_ENVOY_HURT = register(("entity.envoy.hurt")); public static final SoundEvent ENTITY_ENVOY_DEATH = register(("entity.envoy.death")); diff --git a/src/main/resources/assets/paradise_lost/models/item/popom_spawn_egg.json b/src/main/resources/assets/paradise_lost/models/item/popom_spawn_egg.json new file mode 100644 index 000000000..cbd5c36b9 --- /dev/null +++ b/src/main/resources/assets/paradise_lost/models/item/popom_spawn_egg.json @@ -0,0 +1,3 @@ +{ + "parent": "paradise_lost:item/template_spawn_egg" +} diff --git a/src/main/resources/assets/paradise_lost/textures/entity/popom/popom.png b/src/main/resources/assets/paradise_lost/textures/entity/popom/popom.png new file mode 100644 index 000000000..54322cf94 Binary files /dev/null and b/src/main/resources/assets/paradise_lost/textures/entity/popom/popom.png differ