generated from TropheusJ/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
restore entity models, krill water balloons
- Loading branch information
Showing
15 changed files
with
467 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 0 additions & 28 deletions
28
src/main/java/one/devos/nautical/up_and_away/content/balloon/entity/WaterBalloon.java
This file was deleted.
Oops, something went wrong.
42 changes: 42 additions & 0 deletions
42
...in/java/one/devos/nautical/up_and_away/content/balloon/entity/renderer/BalloonModels.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package one.devos.nautical.up_and_away.content.balloon.entity.renderer; | ||
|
||
import one.devos.nautical.up_and_away.content.balloon.BalloonShape; | ||
import one.devos.nautical.up_and_away.content.balloon.entity.AbstractBalloon; | ||
import one.devos.nautical.up_and_away.content.balloon.entity.renderer.model.DogBalloonModel; | ||
import one.devos.nautical.up_and_away.content.balloon.entity.renderer.model.CubeBalloonModel; | ||
import one.devos.nautical.up_and_away.content.balloon.entity.renderer.model.HeartBalloonModel; | ||
import one.devos.nautical.up_and_away.content.balloon.entity.renderer.model.LongBalloonModel; | ||
import one.devos.nautical.up_and_away.content.balloon.entity.renderer.model.RoundBalloonModel; | ||
import net.minecraft.client.model.EntityModel; | ||
import net.minecraft.client.model.geom.ModelLayerLocation; | ||
import net.minecraft.client.model.geom.ModelPart; | ||
|
||
public class BalloonModels { | ||
private final CubeBalloonModel cubeModel; | ||
private final DogBalloonModel dogModel; | ||
private final HeartBalloonModel heartModel; | ||
private final LongBalloonModel longModel; | ||
private final RoundBalloonModel roundModel; | ||
|
||
public BalloonModels(EntityModelBakery bakery) { | ||
this.cubeModel = new CubeBalloonModel(bakery.bake(CubeBalloonModel.LAYER_LOCATION)); | ||
this.dogModel = new DogBalloonModel(bakery.bake(DogBalloonModel.LAYER_LOCATION)); | ||
this.heartModel = new HeartBalloonModel(bakery.bake(HeartBalloonModel.LAYER_LOCATION)); | ||
this.longModel = new LongBalloonModel(bakery.bake(LongBalloonModel.LAYER_LOCATION)); | ||
this.roundModel = new RoundBalloonModel(bakery.bake(RoundBalloonModel.LAYER_LOCATION)); | ||
} | ||
|
||
public EntityModel<AbstractBalloon> choose(BalloonShape shape) { | ||
return switch (shape) { | ||
case CUBE -> this.cubeModel; | ||
case DOG -> this.dogModel; | ||
case HEART -> this.heartModel; | ||
case LONG -> this.longModel; | ||
case ROUND -> this.roundModel; | ||
}; | ||
} | ||
|
||
public interface EntityModelBakery { | ||
ModelPart bake(ModelLayerLocation layer); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
...ne/devos/nautical/up_and_away/content/balloon/entity/renderer/model/CubeBalloonModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package one.devos.nautical.up_and_away.content.balloon.entity.renderer.model; | ||
|
||
import com.mojang.blaze3d.vertex.PoseStack; | ||
import com.mojang.blaze3d.vertex.VertexConsumer; | ||
|
||
import net.minecraft.client.model.EntityModel; | ||
import net.minecraft.client.model.geom.ModelLayerLocation; | ||
import net.minecraft.client.model.geom.ModelPart; | ||
import net.minecraft.client.model.geom.PartPose; | ||
import net.minecraft.client.model.geom.builders.CubeDeformation; | ||
import net.minecraft.client.model.geom.builders.CubeListBuilder; | ||
import net.minecraft.client.model.geom.builders.LayerDefinition; | ||
import net.minecraft.client.model.geom.builders.MeshDefinition; | ||
import net.minecraft.client.model.geom.builders.PartDefinition; | ||
import one.devos.nautical.up_and_away.UpAndAway; | ||
import one.devos.nautical.up_and_away.content.balloon.entity.AbstractBalloon; | ||
|
||
public class CubeBalloonModel extends EntityModel<AbstractBalloon> { | ||
public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation(UpAndAway.id("cube_balloon"), "main"); | ||
|
||
private final ModelPart balloon; | ||
private final ModelPart tie; | ||
|
||
public CubeBalloonModel(ModelPart root) { | ||
this.balloon = root.getChild("balloon"); | ||
this.tie = root.getChild("tie"); | ||
} | ||
|
||
public static LayerDefinition createBodyLayer() { | ||
MeshDefinition meshdefinition = new MeshDefinition(); | ||
PartDefinition partdefinition = meshdefinition.getRoot(); | ||
|
||
PartDefinition balloon = partdefinition.addOrReplaceChild("balloon", CubeListBuilder.create().texOffs(0, 34).addBox(-7.0F, -14.0F, -7.0F, 14.0F, 14.0F, 14.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 22.0F, 0.0F)); | ||
|
||
PartDefinition tie = partdefinition.addOrReplaceChild("tie", CubeListBuilder.create(), PartPose.offset(0.0F, 23.0F, 0.0F)); | ||
|
||
PartDefinition cube_r1 = tie.addOrReplaceChild("cube_r1", CubeListBuilder.create().texOffs(0, 34).mirror().addBox(-1.5F, -1.0F, 0.0F, 3.0F, 2.0F, 0.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -0.7854F, 0.0F)); | ||
|
||
PartDefinition cube_r2 = tie.addOrReplaceChild("cube_r2", CubeListBuilder.create().texOffs(0, 34).addBox(-1.5F, -1.0F, 0.0F, 3.0F, 2.0F, 0.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, 0.7854F, 0.0F)); | ||
|
||
return LayerDefinition.create(meshdefinition, 128, 128); | ||
} | ||
|
||
|
||
@Override | ||
public void setupAnim(AbstractBalloon entity, float f, float g, float h, float i, float j) { | ||
} | ||
|
||
@Override | ||
public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int i, int j, int k) { | ||
balloon.render(poseStack, vertexConsumer, i, j, k); | ||
tie.render(poseStack, vertexConsumer, i, j, k); | ||
} | ||
} |
Oops, something went wrong.