-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
790 additions
and
124 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,33 @@ | ||
// Made with Blockbench 4.8.3 | ||
// Exported for Minecraft version 1.17 or later with Mojang mappings | ||
// Paste this class into your mod and generate all required imports | ||
|
||
|
||
public class 0<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("modid", "0"), "main"); | ||
private final ModelPart bb_main; | ||
|
||
public 0(ModelPart root) { | ||
this.bb_main = root.getChild("bb_main"); | ||
} | ||
|
||
public static LayerDefinition createBodyLayer() { | ||
MeshDefinition meshdefinition = new MeshDefinition(); | ||
PartDefinition partdefinition = meshdefinition.getRoot(); | ||
|
||
PartDefinition bb_main = partdefinition.addOrReplaceChild("bb_main", CubeListBuilder.create().texOffs(0, 0).addBox(-1.0F, -1.0F, -1.0F, 2.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 24.0F, 0.0F)); | ||
|
||
return LayerDefinition.create(meshdefinition, 16, 16); | ||
} | ||
|
||
@Override | ||
public void setupAnim(T entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) { | ||
|
||
} | ||
|
||
@Override | ||
public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { | ||
bb_main.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); | ||
} | ||
} |
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.5","model_format":"modded_entity","box_uv":true},"name":"MissileBullet","model_identifier":"0","modded_entity_version":"1.17","modded_entity_flip_y":true,"visible_box":[1,1,0],"variable_placeholders":"","variable_placeholder_buttons":[],"unhandled_root_fields":{},"resolution":{"width":16,"height":16},"elements":[{"name":"cube","box_uv":true,"rescale":false,"locked":false,"render_order":"default","allow_mirror_modeling":true,"from":[-1,-1,-1],"to":[1,1,1],"autouv":1,"color":4,"origin":[0,0,0],"faces":{"north":{"uv":[2,2,4,4],"texture":0},"east":{"uv":[0,2,2,4],"texture":0},"south":{"uv":[6,2,8,4],"texture":0},"west":{"uv":[4,2,6,4],"texture":0},"up":{"uv":[4,2,2,0],"texture":0},"down":{"uv":[6,0,4,2],"texture":0}},"type":"cube","uuid":"0ad43cce-9897-9d64-e4ea-5fda6c45ff7d"}],"outliner":["0ad43cce-9897-9d64-e4ea-5fda6c45ff7d"],"textures":[{"path":"C:\\Users\\qiuzhenxuan\\Desktop\\Project\\MinecraftMod\\mindustry\\bbmodel\\missile_bullet\\missile_bullet.png","name":"missile_bullet.png","folder":"block","namespace":"","id":"0","particle":false,"render_mode":"default","render_sides":"auto","frame_time":1,"frame_order_type":"loop","frame_order":"","frame_interpolate":false,"visible":true,"mode":"bitmap","saved":true,"uuid":"44a9d5b5-1787-d722-088f-09dc550d0c66","relative_path":"../missile_bullet.png","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAB9JREFUOE9jZKAQMFKon2HUAIbRMGAYDQNQPhr4vAAAJpgAEX/anFwAAAAASUVORK5CYII="}]} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
46 changes: 46 additions & 0 deletions
46
src/main/java/com/hechu/mindustry/client/model/MissileBulletModel.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,46 @@ | ||
package com.hechu.mindustry.client.model;// Made with Blockbench 4.8.3 | ||
// Exported for Minecraft version 1.17 or later with Mojang mappings | ||
// Paste this class into your mod and generate all required imports | ||
|
||
|
||
import com.hechu.mindustry.MindustryConstants; | ||
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.client.renderer.RenderType; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.world.entity.Entity; | ||
|
||
public class MissileBulletModel<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(MindustryConstants.MOD_ID, "missile_bullet"), "main"); | ||
private final ModelPart body; | ||
|
||
public MissileBulletModel(ModelPart root) { | ||
super(RenderType::entitySolid); | ||
this.body = root; | ||
} | ||
|
||
public static LayerDefinition createBodyLayer() { | ||
MeshDefinition meshdefinition = new MeshDefinition(); | ||
PartDefinition partdefinition = meshdefinition.getRoot(); | ||
|
||
PartDefinition bb_main = partdefinition.addOrReplaceChild("main", CubeListBuilder.create().texOffs(0, 0).addBox(-1.0F, -1.0F, -1.0F, 2.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 24.0F, 0.0F)); | ||
|
||
return LayerDefinition.create(meshdefinition, 16, 16); | ||
} | ||
|
||
@Override | ||
public void setupAnim(T entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) { | ||
|
||
} | ||
|
||
@Override | ||
public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { | ||
body.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); | ||
} | ||
} |
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
31 changes: 31 additions & 0 deletions
31
src/main/java/com/hechu/mindustry/client/renderer/entity/BasicBulletRender.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,31 @@ | ||
package com.hechu.mindustry.client.renderer.entity; | ||
|
||
import com.hechu.mindustry.MindustryConstants; | ||
import com.hechu.mindustry.client.model.MissileBulletModel; | ||
import com.hechu.mindustry.world.entity.projectile.BasicBullet; | ||
import com.hechu.mindustry.world.entity.projectile.MissileBullet; | ||
import net.minecraft.client.model.EntityModel; | ||
import net.minecraft.client.renderer.entity.EntityRenderer; | ||
import net.minecraft.client.renderer.entity.EntityRendererProvider; | ||
import net.minecraft.resources.ResourceLocation; | ||
|
||
public class BasicBulletRender extends EntityRenderer<BasicBullet> { | ||
private EntityModel<BasicBullet> model; | ||
|
||
public static final ResourceLocation TEXTURE = new ResourceLocation(MindustryConstants.MOD_ID, "textures/entity/bullets/missile_bullet.png"); | ||
|
||
public BasicBulletRender(EntityRendererProvider.Context pContext) { | ||
super(pContext); | ||
model = new MissileBulletModel(pContext.bakeLayer(MissileBulletModel.LAYER_LOCATION)); | ||
} | ||
|
||
/** | ||
* Returns the location of an entity's texture. | ||
* | ||
* @param pEntity | ||
*/ | ||
@Override | ||
public ResourceLocation getTextureLocation(BasicBullet pEntity) { | ||
return TEXTURE; | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/com/hechu/mindustry/client/renderer/entity/MissileBulletRender.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,30 @@ | ||
package com.hechu.mindustry.client.renderer.entity; | ||
|
||
import com.hechu.mindustry.MindustryConstants; | ||
import com.hechu.mindustry.client.model.MissileBulletModel; | ||
import com.hechu.mindustry.world.entity.projectile.MissileBullet; | ||
import net.minecraft.client.model.EntityModel; | ||
import net.minecraft.client.renderer.entity.EntityRenderer; | ||
import net.minecraft.client.renderer.entity.EntityRendererProvider; | ||
import net.minecraft.resources.ResourceLocation; | ||
|
||
public class MissileBulletRender extends EntityRenderer<MissileBullet> { | ||
private EntityModel<MissileBullet> model; | ||
|
||
public static final ResourceLocation TEXTURE = new ResourceLocation(MindustryConstants.MOD_ID, "textures/entity/bullets/missile_bullet.png"); | ||
|
||
public MissileBulletRender(EntityRendererProvider.Context pContext) { | ||
super(pContext); | ||
model = new MissileBulletModel(pContext.bakeLayer(MissileBulletModel.LAYER_LOCATION)); | ||
} | ||
|
||
/** | ||
* Returns the location of an entity's texture. | ||
* | ||
* @param pEntity | ||
*/ | ||
@Override | ||
public ResourceLocation getTextureLocation(MissileBullet pEntity) { | ||
return TEXTURE; | ||
} | ||
} |
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.