Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: edward and josediya #365

Draft
wants to merge 6 commits into
base: 1.21.0-develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/generated/resources/assets/aether_ii/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@
"entity.aether_ii.arctic_kirrid": "Arctic Kirrid",
"entity.aether_ii.arctic_taegore": "Arctic Taegore",
"entity.aether_ii.cockatrice": "Cockatrice",
"entity.aether_ii.edward": "Edward",
"entity.aether_ii.flying_cow": "Flying Cow",
"entity.aether_ii.highfields_burrukai": "Highfields Burrukai",
"entity.aether_ii.highfields_kirrid": "Highfields Kirrid",
Expand Down Expand Up @@ -636,6 +637,7 @@
"item.aether_ii.gravitite_trowel.aether_ii.ability.tooltip.2": "§3Use:§r Crouch-Interact",
"item.aether_ii.green_swet_gel": "Green Swet Gel",
"item.aether_ii.green_swet_jelly": "Green Swet Jelly",
"item.aether_ii.guidebook_page": "Guidebook Page",
"item.aether_ii.healing_stone": "Healing Stone",
"item.aether_ii.highfields_burrukai_spawn_egg": "Burrukai Spawn Egg",
"item.aether_ii.highfields_kirrid_spawn_egg": "Kirrid Spawn Egg",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "aether_ii:item/miscellaneous/guidebook_page"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "minecraft:entity",
"random_sequence": "aether_ii:entities/edward"
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,36 @@ private void trackBestiaryEntries(ServerPlayer serverPlayer, RegistryAccess regi
Registry<BestiaryEntry> bestiaryEntries = registryAccess.registryOrThrow(AetherIIBestiaryEntries.BESTIARY_ENTRY_REGISTRY_KEY);
for (Holder.Reference<BestiaryEntry> entry : bestiaryEntries.holders().toList()) {
if (advancement.id().equals(entry.value().observationAdvancement())) {
this.observedBestiaryEntries.add(entry);
this.uncheckedBestiaryEntries.add(entry);
this.sync = true;
boolean flag = false;
if (!this.observedBestiaryEntries.contains(entry)) {
this.observedBestiaryEntries.add(entry);
flag = true;
}
if (!this.uncheckedBestiaryEntries.contains(entry)) {
this.uncheckedBestiaryEntries.add(entry);
flag = true;
}
if (flag) {
this.sync = true;
}
}
if (advancement.id().equals(entry.value().understandingAdvancement())) {
this.understoodBestiaryEntries.add(entry);
this.uncheckedBestiaryEntries.add(entry);
this.sync = true;
boolean flag = false;
if (!this.observedBestiaryEntries.contains(entry)) {
this.observedBestiaryEntries.add(entry);
flag = true;
}
if (!this.understoodBestiaryEntries.contains(entry)) {
this.understoodBestiaryEntries.add(entry);
flag = true;
}
if (!this.uncheckedBestiaryEntries.contains(entry)) {
this.uncheckedBestiaryEntries.add(entry);
flag = true;
}
if (flag) {
this.sync = true;
}
}
}
if (this.sync) {
Expand All @@ -123,6 +145,10 @@ public List<Holder<BestiaryEntry>> getUncheckedBestiaryEntries() {
return this.uncheckedBestiaryEntries;
}

public boolean hasAnyBestiaryEntryStatus(Holder<BestiaryEntry> bestiaryEntry) {
return this.getObservedBestiaryEntries().contains(bestiaryEntry) || this.getUncheckedBestiaryEntries().contains(bestiaryEntry);
}

public void syncAttachment(GuidebookDiscoveryAttachment other) {
this.observedBestiaryEntries = other.observedBestiaryEntries;
this.understoodBestiaryEntries = other.understoodBestiaryEntries;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ public class AetherIIModelLayers {
public static final ModelLayerLocation SKYROOT_LIZARD = register("skyroot_lizard");

public static final ModelLayerLocation AECHOR_PLANT = register("aechor_plant");

public static final ModelLayerLocation ZEPHYR = register("zephyr");
public static final ModelLayerLocation TEMPEST = register("tempest");

public static final ModelLayerLocation COCKATRICE = register("cockatrice");
public static final ModelLayerLocation SWET = register("swet");

public static final ModelLayerLocation EDWARD = register("edward");

public static final ModelLayerLocation GLOVES = register("gloves");
public static final ModelLayerLocation GLOVES_SLIM = register("gloves_slim");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ public static void registerEntityRenderers(EntityRenderersEvent.RegisterRenderer
event.registerEntityRenderer(AetherIIEntityTypes.COCKATRICE.get(), CockatriceRenderer::new);
event.registerEntityRenderer(AetherIIEntityTypes.SWET.get(), SwetRenderer::new);

// NPCs
event.registerEntityRenderer(AetherIIEntityTypes.EDWARD.get(), EdwardRenderer::new);

// Projectiles
event.registerEntityRenderer(AetherIIEntityTypes.HOLYSTONE_ROCK.get(), ThrownItemRenderer::new);
event.registerEntityRenderer(AetherIIEntityTypes.ARCTIC_SNOWBALL.get(), ThrownItemRenderer::new);
Expand Down Expand Up @@ -145,6 +148,9 @@ public static void registerLayerDefinition(EntityRenderersEvent.RegisterLayerDef
event.registerLayerDefinition(AetherIIModelLayers.COCKATRICE, CockatriceModel::createBodyLayer);
event.registerLayerDefinition(AetherIIModelLayers.SWET, SwetModel::createBodyLayer);

// NPCs
event.registerLayerDefinition(AetherIIModelLayers.EDWARD, EdwardModel::createBodyLayer);

// Accessories
// Handwear
event.registerLayerDefinition(AetherIIModelLayers.GLOVES, () -> GlovesModel.createLayer(new CubeDeformation(0.6F), false));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.aetherteam.aetherii.client.renderer.entity;

import com.aetherteam.aetherii.AetherII;
import com.aetherteam.aetherii.client.renderer.AetherIIModelLayers;
import com.aetherteam.aetherii.client.renderer.entity.model.EdwardModel;
import com.aetherteam.aetherii.entity.npc.outpost.Edward;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import net.minecraft.client.renderer.entity.MobRenderer;
import net.minecraft.resources.ResourceLocation;

public class EdwardRenderer extends MobRenderer<Edward, EdwardModel> {
private static final ResourceLocation EDWARD_TEXTURE = ResourceLocation.fromNamespaceAndPath(AetherII.MODID, "textures/entity/npcs/edward/edward.png");

public EdwardRenderer(EntityRendererProvider.Context context) {
super(context, new EdwardModel(context.bakeLayer(AetherIIModelLayers.EDWARD)), 0.5F);
}

@Override
public ResourceLocation getTextureLocation(Edward entity) {
return EDWARD_TEXTURE;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
package com.aetherteam.aetherii.client.renderer.entity.model;

import com.aetherteam.aetherii.entity.npc.outpost.Edward;
import com.google.common.collect.ImmutableList;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import net.minecraft.client.model.*;
import net.minecraft.client.model.geom.ModelPart;
import net.minecraft.client.model.geom.PartPose;
import net.minecraft.client.model.geom.builders.*;
import net.minecraft.util.Mth;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.entity.HumanoidArm;

public class EdwardModel extends HierarchicalModel<Edward> implements ArmedModel, HeadedModel {
private final ModelPart root;
private final ModelPart waist;
private final ModelPart abdomen;
private final ModelPart chest;
private final ModelPart head;
private final ModelPart earleft;
private final ModelPart earright;
private final ModelPart hatlayer;
private final ModelPart armleft1;
private final ModelPart armleft2;
private final ModelPart elbowleft;
private final ModelPart armright1;
private final ModelPart armright2;
private final ModelPart elbowright;
private final ModelPart backpack;
private final ModelPart bedroll;
private final ModelPart legleft1;
private final ModelPart legleft2;
private final ModelPart legright1;
private final ModelPart legright2;
private final ModelPart book;

public EdwardModel(ModelPart root) {
this.root = root.getChild("root");
this.waist = this.root.getChild("waist");
this.abdomen = this.waist.getChild("abdomen");
this.chest = this.abdomen.getChild("chest");
this.head = this.root.getChild("head");
this.earleft = this.head.getChild("earleft");
this.earright = this.head.getChild("earright");
this.hatlayer = this.head.getChild("hatlayer");
this.armleft1 = this.chest.getChild("armleft1");
this.armleft2 = this.armleft1.getChild("armleft2");
this.elbowleft = this.armleft1.getChild("elbowleft");
this.armright1 = this.chest.getChild("armright1");
this.armright2 = this.armright1.getChild("armright2");
this.elbowright = this.armright1.getChild("elbowright");
this.backpack = this.chest.getChild("backpack");
this.bedroll = this.backpack.getChild("bedroll");
this.legleft1 = this.waist.getChild("legleft1");
this.legleft2 = this.legleft1.getChild("legleft2");
this.legright1 = this.waist.getChild("legright1");
this.legright2 = this.legright1.getChild("legright2");
this.book = this.waist.getChild("book");
}

public static LayerDefinition createBodyLayer() {
MeshDefinition meshdefinition = new MeshDefinition();
PartDefinition partdefinition = meshdefinition.getRoot();

PartDefinition root = partdefinition.addOrReplaceChild("root", CubeListBuilder.create(), PartPose.offset(0.0F, 0.0F, 0.0F));

PartDefinition waist = root.addOrReplaceChild("waist", CubeListBuilder.create().texOffs(0, 37).mirror().addBox(-4.5F, 10.0F, -2.5F, 9.0F, 4.0F, 5.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offset(0.0F, 0.0F, 0.0F));

PartDefinition abdomen = waist.addOrReplaceChild("abdomen", CubeListBuilder.create().texOffs(2, 28).mirror().addBox(-4.0F, -5.0F, -2.0F, 8.0F, 5.0F, 4.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offset(0.0F, 11.0F, 0.0F));

PartDefinition chest = abdomen.addOrReplaceChild("chest", CubeListBuilder.create().texOffs(0, 16).mirror().addBox(-4.5F, -7.0F, -2.5F, 9.0F, 7.0F, 5.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offset(0.0F, -4.0F, 0.0F));

PartDefinition head = root.addOrReplaceChild("head", CubeListBuilder.create().texOffs(0, 0).addBox(-4.0F, -8.0F, -4.0F, 8.0F, 8.0F, 8.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, -7.0F, 0.0F));

PartDefinition earleft = head.addOrReplaceChild("earleft", CubeListBuilder.create().texOffs(24, 2).mirror().addBox(0.0F, -2.0F, 0.0F, 1.0F, 3.0F, 3.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(-4.0F, -3.0F, -2.0F, 0.0F, -0.2618F, -0.0873F));

PartDefinition earright = head.addOrReplaceChild("earright", CubeListBuilder.create().texOffs(24, 2).addBox(-1.0F, -2.0F, 0.0F, 1.0F, 3.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(4.0F, -3.0F, -2.0F, 0.0F, 0.2618F, 0.0873F));

PartDefinition hatlayer = head.addOrReplaceChild("hatlayer", CubeListBuilder.create().texOffs(32, 0).addBox(-4.0F, -8.0F, -4.0F, 8.0F, 8.0F, 8.0F, new CubeDeformation(0.2F)), PartPose.offset(0.0F, 0.0F, 0.0F));

PartDefinition armleft1 = chest.addOrReplaceChild("armleft1", CubeListBuilder.create().texOffs(28, 16).mirror().addBox(-3.0F, -2.0F, -2.0F, 4.0F, 6.0F, 4.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(-5.0F, -5.0F, 0.0F, 0.0F, 0.0F, 0.0873F));

PartDefinition armleft2 = armleft1.addOrReplaceChild("armleft2", CubeListBuilder.create().texOffs(28, 26).mirror().addBox(-2.01F, 0.0F, -1.0F, 4.0F, 6.0F, 4.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offset(-1.0F, 4.0F, -1.0F));

PartDefinition elbowleft = armleft1.addOrReplaceChild("elbowleft", CubeListBuilder.create().texOffs(44, 24).mirror().addBox(-2.5F, 3.8F, -1.2F, 3.0F, 3.0F, 3.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offset(0.0F, 0.0F, 0.0F));

PartDefinition armright1 = chest.addOrReplaceChild("armright1", CubeListBuilder.create().texOffs(28, 16).mirror().addBox(-1.0F, -2.0F, -2.0F, 4.0F, 6.0F, 4.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(5.0F, -5.0F, 0.0F, 0.0F, 0.0F, -0.0873F));

PartDefinition armright2 = armright1.addOrReplaceChild("armright2", CubeListBuilder.create().texOffs(28, 26).mirror().addBox(0.01F, 0.0F, -1.0F, 4.0F, 6.0F, 4.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offset(-1.0F, 4.0F, -1.0F));

PartDefinition elbowright = armright1.addOrReplaceChild("elbowright", CubeListBuilder.create().texOffs(44, 24).mirror().addBox(-0.5F, 3.8F, -1.2F, 3.0F, 3.0F, 3.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offset(0.0F, 0.0F, 0.0F));

PartDefinition backpack = chest.addOrReplaceChild("backpack", CubeListBuilder.create().texOffs(33, 46).addBox(-5.0F, -1.0F, 0.0F, 10.0F, 12.0F, 5.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, -5.0F, 2.0F));

PartDefinition bedroll = backpack.addOrReplaceChild("bedroll", CubeListBuilder.create().texOffs(32, 36).mirror().addBox(-5.5F, -4.5F, 1.6F, 11.0F, 5.0F, 5.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(0.0F, -1.3F, 0.2F, -0.1745F, 0.0F, 0.0F));

PartDefinition legleft1 = waist.addOrReplaceChild("legleft1", CubeListBuilder.create().texOffs(0, 46).mirror().addBox(-2.0F, 0.0F, -2.0F, 4.0F, 6.0F, 4.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offset(-2.4F, 12.0F, 0.0F));

PartDefinition legleft2 = legleft1.addOrReplaceChild("legleft2", CubeListBuilder.create().texOffs(16, 46).addBox(-2.01F, 0.0F, 0.0F, 4.0F, 6.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 6.0F, -2.0F));

PartDefinition legright1 = waist.addOrReplaceChild("legright1", CubeListBuilder.create().texOffs(0, 46).addBox(-2.0F, 0.0F, -2.0F, 4.0F, 6.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offset(2.4F, 12.0F, 0.0F));

PartDefinition legright2 = legright1.addOrReplaceChild("legright2", CubeListBuilder.create().texOffs(16, 46).mirror().addBox(-2.01F, 0.0F, 0.0F, 4.0F, 6.0F, 4.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offset(0.0F, 6.0F, -2.0F));

PartDefinition book = waist.addOrReplaceChild("book", CubeListBuilder.create().texOffs(52, 26).mirror().addBox(0.0F, -0.5F, -2.0F, 2.0F, 6.0F, 4.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(4.5F, 10.0F, -1.5F, 0.3491F, -0.2618F, -0.0873F));

return LayerDefinition.create(meshdefinition, 64, 64);
}

@Override
public ModelPart root() {
return this.root;
}

@Override
public ModelPart getHead() {
return this.head;
}

@Override
public void setupAnim(Edward entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) {
this.root().getAllParts().forEach(ModelPart::resetPose);

this.head.xRot = headPitch * (float) (Math.PI / 180.0);
this.head.yRot = netHeadYaw * (float) (Math.PI / 180.0);

if (entity.isSitting()) {
this.head.y = 5.25F;
this.head.z = -1.0F;

this.waist.y = 5.0F;
this.waist.z = 2.0F;

this.abdomen.xRot = 0.0873F;

this.chest.xRot = 0.2618F;

this.armleft1.yRot = -0.5009F;
this.armleft1.zRot = 0.2731F;

this.armleft2.xRot = -1.309F;

this.armright1.xRot = 0.3643F;
this.armright1.yRot = -0.3187F;
this.armright1.zRot = -0.0456F;

this.armright2.xRot = -0.8196F;

this.legleft1.xRot = -1.2217F;
this.legleft1.yRot = 0.3142F;

this.legleft2.xRot = 0.3491F;

this.legright1.xRot = -1.1839F;
this.legright2.yRot = -0.2731F;

this.legright2.xRot = 0.1745F;

this.backpack.x = -4.0F;
this.backpack.y = 12.0F;
this.backpack.z = -2.0F;
this.backpack.xRot = 1.5708F;
this.backpack.yRot = 1.5708F;
this.backpack.zRot = 0.0F;
} else {
this.head.y = 0.0F;

this.waist.yRot = 0.0F;

float f = 1.0F;

this.armright1.xRot = Mth.cos(limbSwing * 0.6662F + (float) Math.PI) * 2.0F * limbSwingAmount * 0.5F / f;
this.armleft1.xRot = Mth.cos(limbSwing * 0.6662F) * 2.0F * limbSwingAmount * 0.5F / f;
this.armright1.zRot = 0.0F;
this.armleft1.zRot = 0.0F;
this.legright1.xRot = Mth.cos(limbSwing * 0.6662F) * 1.4F * limbSwingAmount / f;
this.legleft1.xRot = Mth.cos(limbSwing * 0.6662F + (float) Math.PI) * 1.4F * limbSwingAmount / f;
this.legright1.yRot = 0.005F;
this.legleft1.yRot = -0.005F;
this.legright1.zRot = 0.005F;
this.legleft1.zRot = -0.005F;
if (this.riding) {
this.armright1.xRot += (float) (-Math.PI / 5);
this.armleft1.xRot += (float) (-Math.PI / 5);
this.legright1.xRot = -1.4137167F;
this.legright1.yRot = (float) (Math.PI / 10);
this.legright1.zRot = 0.07853982F;
this.legleft1.xRot = -1.4137167F;
this.legleft1.yRot = (float) (-Math.PI / 10);
this.legleft1.zRot = -0.07853982F;
}

this.armright1.yRot = 0.0F;
this.armleft1.yRot = 0.0F;

this.waist.xRot = 0.0F;

AnimationUtils.bobModelPart(this.armright1, ageInTicks, -1.0F);
AnimationUtils.bobModelPart(this.armleft1, ageInTicks, 1.0F);
}
}

@Override
public void renderToBuffer(PoseStack poseStack, VertexConsumer buffer, int packedLight, int packedOverlay, int color) {
super.renderToBuffer(poseStack, buffer, packedLight, packedOverlay, color);
}

@Override
public void translateToHand(HumanoidArm side, PoseStack poseStack) {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ protected void registerModels() {
this.item(AetherIIItems.BLUEBERRY_MOA_FEED.get(), "miscellaneous/");
this.item(AetherIIItems.ENCHANTED_MOA_FEED.get(), "miscellaneous/");
this.item(AetherIIItems.GLINT_COIN.get(), "miscellaneous/");
this.item(AetherIIItems.GUIDEBOOK_PAGE.get(), "miscellaneous/");
this.portalItem(AetherIIItems.AETHER_PORTAL_FRAME.get(), "miscellaneous/");

// Blocks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,7 @@ protected void addTranslations() {
this.addItem(AetherIIItems.BLUEBERRY_MOA_FEED, "Blueberry Moa Feed");
this.addItem(AetherIIItems.ENCHANTED_MOA_FEED, "Enchanted Moa Feed");
this.addItem(AetherIIItems.GLINT_COIN, "Glint Coin");
this.addItem(AetherIIItems.GUIDEBOOK_PAGE, "Guidebook Page");
this.addItem(AetherIIItems.AETHER_PORTAL_FRAME, "Aether Portal Frame");

// Tooltips
Expand Down Expand Up @@ -857,6 +858,9 @@ protected void addTranslations() {
// Structures
this.addStructure(AetherIIStructures.OUTPOST, "Outpost");

// NPCs
this.addEntityType(AetherIIEntityTypes.EDWARD, "Edward");


// Attributes
this.addAttribute(AetherIIAttributes.SLASH_DAMAGE.get(), "§9Slash§r Damage");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ public void generate() {
)
))
);

this.add(AetherIIEntityTypes.EDWARD.get(), LootTable.lootTable());
}

protected LootTable.Builder createTaegoreTable() {
Expand Down
Loading