diff --git a/src/main/java/io/github/teampropulsive/space/rocket/RocketEntityRenderer.java b/src/main/java/io/github/teampropulsive/space/rocket/RocketEntityRenderer.java index 650a4d5..7ea4ecf 100644 --- a/src/main/java/io/github/teampropulsive/space/rocket/RocketEntityRenderer.java +++ b/src/main/java/io/github/teampropulsive/space/rocket/RocketEntityRenderer.java @@ -13,6 +13,6 @@ public RocketEntityRenderer(EntityRendererFactory.Context context) { @Override public Identifier getTexture(RocketEntity entity) { - return new Identifier("entitytesting", "textures/entity/cube/cube.png"); + return new Identifier("propulsive", "textures/spacecraft/rocket.png"); } } diff --git a/src/main/java/io/github/teampropulsive/space/spacecraft/SpacecraftEntity.java b/src/main/java/io/github/teampropulsive/space/spacecraft/SpacecraftEntity.java index e62d53a..8b5000d 100644 --- a/src/main/java/io/github/teampropulsive/space/spacecraft/SpacecraftEntity.java +++ b/src/main/java/io/github/teampropulsive/space/spacecraft/SpacecraftEntity.java @@ -45,8 +45,6 @@ public boolean isOnGround() { // it's on the ground I swear! return true; } - - @Override public boolean isTame() { return true; diff --git a/src/main/java/io/github/teampropulsive/space/station/StationEntity.java b/src/main/java/io/github/teampropulsive/space/station/StationEntity.java index a142f33..f63bf74 100644 --- a/src/main/java/io/github/teampropulsive/space/station/StationEntity.java +++ b/src/main/java/io/github/teampropulsive/space/station/StationEntity.java @@ -1,4 +1,14 @@ package io.github.teampropulsive.space.station; -public class StationEntity { +import io.github.teampropulsive.space.spacecraft.SpacecraftEntity; +import net.minecraft.entity.EntityType; +import net.minecraft.entity.passive.AbstractHorseEntity; +import net.minecraft.util.Identifier; +import net.minecraft.world.World; + +public class StationEntity extends SpacecraftEntity { + public Identifier variation; + protected StationEntity(EntityType entityType, World world) { + super(entityType, world); + } } diff --git a/src/main/java/io/github/teampropulsive/space/station/StationEntityModel.java b/src/main/java/io/github/teampropulsive/space/station/StationEntityModel.java new file mode 100644 index 0000000..33e202d --- /dev/null +++ b/src/main/java/io/github/teampropulsive/space/station/StationEntityModel.java @@ -0,0 +1,37 @@ +package io.github.teampropulsive.space.station; + +import com.google.common.collect.ImmutableList; +import io.github.teampropulsive.space.rocket.RocketEntity; +import io.github.teampropulsive.space.station.StationEntity; +import net.minecraft.client.model.*; +import net.minecraft.client.render.VertexConsumer; +import net.minecraft.client.render.entity.model.EntityModel; +import net.minecraft.client.render.entity.model.EntityModelPartNames; +import net.minecraft.client.util.math.MatrixStack; + +public class StationEntityModel extends EntityModel { + + private final ModelPart base; + + public StationEntityModel(ModelPart modelPart) { + this.base = modelPart.getChild(EntityModelPartNames.CUBE); + } + + public static TexturedModelData getTexturedModelData() { + ModelData modelData = new ModelData(); + ModelPartData modelPartData = modelData.getRoot(); + modelPartData.addChild(EntityModelPartNames.CUBE, ModelPartBuilder.create().uv(0, 0).cuboid(-6F, 12F, -6F, 12F, 12F, 12F), ModelTransform.pivot(0F, 0F, 0F)); + return TexturedModelData.of(modelData, 64, 64); + } + @Override + public void setAngles(StationEntity entity, float limbAngle, float limbDistance, float animationProgress, float headYaw, float headPitch) { + } + + @Override + public void render(MatrixStack matrices, VertexConsumer vertices, int light, int overlay, float red, float green, float blue, float alpha) { + ImmutableList.of(this.base).forEach((modelRenderer) -> { + modelRenderer.render(matrices, vertices, light, overlay, red, green, blue, alpha); + }); + } + +} \ No newline at end of file diff --git a/src/main/java/io/github/teampropulsive/space/station/StationEntityRenderer.java b/src/main/java/io/github/teampropulsive/space/station/StationEntityRenderer.java new file mode 100644 index 0000000..292b100 --- /dev/null +++ b/src/main/java/io/github/teampropulsive/space/station/StationEntityRenderer.java @@ -0,0 +1,20 @@ +package io.github.teampropulsive.space.station; + +import io.github.teampropulsive.PropulsiveClient; +import io.github.teampropulsive.space.rocket.RocketEntity; +import io.github.teampropulsive.space.rocket.RocketEntityModel; +import net.minecraft.client.render.entity.EntityRendererFactory; +import net.minecraft.client.render.entity.MobEntityRenderer; +import net.minecraft.util.Identifier; + +public class StationEntityRenderer extends MobEntityRenderer { + + public StationEntityRenderer(EntityRendererFactory.Context context) { + super(context, new StationEntityModel(context.getPart(PropulsiveClient.MODEL_CUBE_LAYER)), 0.5f); + } + + @Override + public Identifier getTexture(StationEntity entity) { + return new Identifier("propulsive", "textures/spacecraft/"+entity.variation.getPath()+"/texture.png"); + } +}