-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add new substitution log model
- Loading branch information
Showing
14 changed files
with
105 additions
and
99 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Blockbench Help | ||
========= | ||
|
||
# Blockbench models | ||
When saving the blockbench models you will have missing imports and package name. Make sure to re-add them. | ||
```java | ||
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.*; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.world.entity.Entity; | ||
``` | ||
Also use RenderType.entityCutoutNoCull for if you want the mob to render while your camera is inside the mob. | ||
|
||
It also better represets what youll see from blockbench a lot more especially for 0 thick cubes. |
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 @@ | ||
{"meta":{"format_version":"4.0","creation_time":1648078165,"model_format":"modded_entity","box_uv":true},"name":"SubstitutionLogModel","geometry_name":"SubstitutionLogModel","modded_entity_version":"1.17","visible_box":[1,1,0],"variable_placeholders":"","resolution":{"width":32,"height":32},"elements":[{"name":"branch","rescale":false,"locked":false,"from":[-4.4,5.500000000000002,-0.5],"to":[-2.4000000000000004,6.500000000000002,0.5],"autouv":0,"color":0,"rotation":[-19.999999999999996,0,0],"origin":[-2.5,6.000000000000002,-5.551115123125783e-17],"uv_offset":[0,15],"faces":{"north":{"uv":[1,16,3,17],"texture":0},"east":{"uv":[0,16,1,17],"texture":0},"south":{"uv":[4,16,6,17],"texture":0},"west":{"uv":[3,16,4,17],"texture":0},"up":{"uv":[3,16,1,15],"texture":0},"down":{"uv":[5,15,3,16],"texture":0}},"uuid":"2a17638f-24ad-b9ca-f436-ae5a8af261b5"},{"name":"leaf","rescale":false,"locked":false,"from":[-5.61731656763491,6.423879532511287,0.15000000000000002],"to":[-3.6173165676349104,8.423879532511286,0.15000000000000002],"autouv":0,"color":3,"rotation":[0,0,-10],"origin":[-4.61731656763491,7.423879532511287,0.15000000000000002],"faces":{"north":{"uv":[0,0,2,2],"texture":0},"east":{"uv":[0,0,0,2],"texture":0},"south":{"uv":[2,0,4,2],"texture":0},"west":{"uv":[2,0,2,2],"texture":0},"up":{"uv":[2,0,0,0],"texture":0},"down":{"uv":[4,0,2,0],"texture":0}},"uuid":"971466d1-29dd-36ba-af7f-0cc581f9010d"},{"name":"log","rescale":false,"locked":false,"from":[-2.4999999999999996,0,-2.4999999999999996],"to":[2.5000000000000004,10,2.5000000000000004],"autouv":0,"color":6,"origin":[4.440892098500626e-16,5,-5.551115123125783e-17],"faces":{"north":{"uv":[5,5,10,15],"texture":0},"east":{"uv":[0,5,5,15],"texture":0},"south":{"uv":[15,5,20,15],"texture":0},"west":{"uv":[10,5,15,15],"texture":0},"up":{"uv":[10,5,5,0],"texture":0},"down":{"uv":[15,0,10,5],"texture":0}},"uuid":"69337f8d-eb96-480d-026c-2392c6c7b66b"}],"outliner":[{"name":"main","origin":[-2.6724388558783034,6.141293177503762,0.04999999999999988],"color":0,"uuid":"695fb92b-8e92-f0c8-c7f2-cc14a6fea135","export":true,"isOpen":true,"locked":false,"visibility":true,"autouv":0,"children":["69337f8d-eb96-480d-026c-2392c6c7b66b","2a17638f-24ad-b9ca-f436-ae5a8af261b5","971466d1-29dd-36ba-af7f-0cc581f9010d"]}],"textures":[{"path":"/home/sekwah/.projects/MC_1_18/Naruto-Mod/src/main/resources/assets/narutomod/textures/entity/jutsu/substitution_log.png","name":"substitution_log.png","folder":"block","namespace":"","id":"0","particle":false,"render_mode":"normal","visible":true,"mode":"bitmap","saved":true,"uuid":"6726496f-f6e9-e127-b4e2-16e7c5481388","relative_path":"../../src/main/resources/assets/narutomod/textures/entity/jutsu/substitution_log.png","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAACGklEQVRYR+1VSytFURReJ3S93VyPxL0GhCivRMJEMdBVpkwYmkn5EQZK/gETZiZEUR5RyjOKXEm5pMRFHqWko2/nu+2Om5yD2dmTfe7ae+31rW99a12jbiLNNDLeZKvr1ZDPFWwpMX1pCRJ5ehPsWPzWbRNzh1Ef+trdjZpRrxmX+S7bvU/Rx3o7KszqogzxeDySmJQqqztn6l2r7U8AxEIMAA3lOZKXnyX3d68yvRJSTFhts2snv2fgOwA4S06Ml+XdK3UNAHTbvzFADRAc6o5FPVATf8LAUE+9eXzxIG11BXJx/RwlZH0/LM1VAfW7OOCT8Zk96W4vl8XtSynze8Xqg/s4HxhdslUWgwCCTUWycRCWbG+KCkoANw8vysYAOgDdB+d9nTXSPzxvHwCcSwt9KrAOAA8SFDLmAgNWH8cAxgZbzamFI0U3s0UgBEQg2rCHziOSlZmuymX14f2RyU17DAAAadUBsATMDExg1Zbmqt3qw/uOAEB8zMCfm6oCwIZvPRC6AazAbvWhgG0DwNBB3XUAu6FrpQXYbu8ev5SHTMXycQxAbzsqXs8SwTAHAEzvDGiHjMBudzhF2xCZQvWn4YhSOL/xKLvDKlLdB3ccA6Dq0dcEwK7AGdTPIcSBxTYkI42VAdWyjhhAEF18TjKJ9Z/yE5uBNqTq9drbFdNPgsW6Y2toOA3ynZ8LwGXAZcBlwGXAZcBl4AMUaIkwf64ZfAAAAABJRU5ErkJggg=="}]} |
94 changes: 42 additions & 52 deletions
94
src/main/java/com/sekwah/narutomod/client/model/entity/SubstitutionLogModel.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 |
---|---|---|
@@ -1,58 +1,48 @@ | ||
package com.sekwah.narutomod.client.model.entity; | ||
// Made with Blockbench 4.0.3 | ||
// Exported for Minecraft version 1.17 with Mojang mappings | ||
// Paste this class into your mod and generate all required imports | ||
|
||
import com.mojang.blaze3d.vertex.PoseStack; | ||
import com.mojang.blaze3d.vertex.VertexConsumer; | ||
import net.minecraft.client.model.Model; | ||
import com.sekwah.narutomod.NarutoMod; | ||
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.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 net.minecraft.client.renderer.RenderType; | ||
|
||
public class SubstitutionLogModel extends Model { | ||
|
||
private final ModelPart main; | ||
|
||
public SubstitutionLogModel(ModelPart modelPart) | ||
{ | ||
super(RenderType::entitySolid); | ||
this.main = modelPart.getChild("main"); | ||
} | ||
|
||
|
||
public static LayerDefinition createLayer() { | ||
|
||
MeshDefinition meshdefinition = new MeshDefinition(); | ||
PartDefinition partdefinition = meshdefinition.getRoot(); | ||
|
||
PartDefinition main = partdefinition.addOrReplaceChild("main", | ||
CubeListBuilder.create() | ||
.mirror(true) | ||
.texOffs(0, 0) | ||
.addBox(-2F, 0F, -2F, 4, 8, 4) | ||
, PartPose.offsetAndRotation(0F, 5F, 0F, (float) Math.PI, 0F, 0F)); | ||
|
||
main.addOrReplaceChild("Shape2", | ||
CubeListBuilder.create() | ||
.mirror(true) | ||
.texOffs(16, 0) | ||
.addBox(-0.2666667F, 2F, -1.866667F, 4, 1, 1) | ||
, PartPose.offsetAndRotation(0F, 0F, 0F, 0.4461433F, 0F, 0F)); | ||
|
||
main.addOrReplaceChild("Shape3", | ||
CubeListBuilder.create() | ||
.mirror(true) | ||
.texOffs(26, 0) | ||
.addBox(2.066667F, 1.733333F, 0F, 2, 2, 0) | ||
, PartPose.offsetAndRotation(0F, 0F, 0F, 0F, 0F, -0.3717861F)); | ||
|
||
return LayerDefinition.create(meshdefinition, 64, 64); | ||
} | ||
|
||
@Override | ||
public void renderToBuffer(PoseStack matrixStack, VertexConsumer vertexConsumer, int p_225598_3_, int p_225598_4_, float p_225598_5_, float p_225598_6_, float p_225598_7_, float p_225598_8_) { | ||
this.main.render(matrixStack, vertexConsumer, p_225598_3_, p_225598_4_, p_225598_5_, p_225598_6_, p_225598_7_, p_225598_8_); | ||
} | ||
} | ||
import net.minecraft.client.model.geom.builders.*; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.world.entity.Entity; | ||
|
||
public class SubstitutionLogModel<T extends Entity> extends EntityModel<T> { | ||
// This layer location should be baked with EntityRendererProvider.Context in the entity renderer and passed into this model's constructor | ||
public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation(new ResourceLocation(NarutoMod.MOD_ID, "substitution_log"), "main"); | ||
private final ModelPart main; | ||
|
||
public SubstitutionLogModel(ModelPart root) { | ||
this.main = root.getChild("main"); | ||
} | ||
|
||
public static LayerDefinition createBodyLayer() { | ||
MeshDefinition meshdefinition = new MeshDefinition(); | ||
PartDefinition partdefinition = meshdefinition.getRoot(); | ||
|
||
PartDefinition main = partdefinition.addOrReplaceChild("main", CubeListBuilder.create().texOffs(0, 0).addBox(-5.1724F, -3.8587F, -2.55F, 5.0F, 10.0F, 5.0F, new CubeDeformation(0.0F)), PartPose.offset(2.6724F, 17.8587F, 0.05F)); | ||
|
||
PartDefinition leaf_r1 = main.addOrReplaceChild("leaf_r1", CubeListBuilder.create().texOffs(0, 0).addBox(-1.0F, -1.0F, 0.0F, 2.0F, 2.0F, 0.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(1.9449F, -1.2826F, 0.1F, 0.0F, 0.0F, -0.1745F)); | ||
|
||
PartDefinition branch_r1 = main.addOrReplaceChild("branch_r1", CubeListBuilder.create().texOffs(0, 15).addBox(-0.1F, -0.5F, -0.5F, 2.0F, 1.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-0.1724F, 0.1413F, -0.05F, 0.3491F, 0.0F, 0.0F)); | ||
|
||
return LayerDefinition.create(meshdefinition, 32, 32); | ||
} | ||
|
||
@Override | ||
public void setupAnim(T entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) { | ||
|
||
} | ||
|
||
@Override | ||
public void renderToBuffer(PoseStack poseStack, VertexConsumer buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { | ||
main.render(poseStack, buffer, packedLight, packedOverlay); | ||
} | ||
} |
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
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
Oops, something went wrong.