-
Notifications
You must be signed in to change notification settings - Fork 1
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
16 changed files
with
423 additions
and
82 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
49 changes: 49 additions & 0 deletions
49
src/main/java/ru/pinkgoosik/hiddenrealm/client/model/MoonblessedZombieModel.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,49 @@ | ||
package ru.pinkgoosik.hiddenrealm.client.model; | ||
|
||
import net.minecraft.client.model.*; | ||
import net.minecraft.client.render.RenderLayer; | ||
import net.minecraft.client.render.VertexConsumer; | ||
import net.minecraft.client.render.entity.model.BipedEntityModel; | ||
import net.minecraft.client.render.entity.model.CrossbowPosing; | ||
import net.minecraft.client.util.math.MatrixStack; | ||
import ru.pinkgoosik.hiddenrealm.entity.MoonblessedZombieEntity; | ||
|
||
public class MoonblessedZombieModel extends BipedEntityModel<MoonblessedZombieEntity> { | ||
|
||
private final ModelPart headwear; | ||
private final ModelPart body_wear; | ||
|
||
public MoonblessedZombieModel(ModelPart root) { | ||
super(root, RenderLayer::getEntityTranslucent); | ||
this.headwear = root.getChild("headwear"); | ||
this.body_wear = root.getChild("body_wear"); | ||
} | ||
public static TexturedModelData getTexturedModelData() { | ||
ModelData modelData = BipedEntityModel.getModelData(Dilation.NONE,0); | ||
ModelPartData modelPartData = modelData.getRoot(); | ||
modelPartData.addChild("headwear", ModelPartBuilder.create().uv(32, 0).cuboid(-4.0F, -8.0F, -4.0F, 8.0F, 8.0F, 8.0F, new Dilation(0.5F)), ModelTransform.pivot(0.0F, 0.0F, 0.0F)); | ||
|
||
modelPartData.addChild("body_wear", ModelPartBuilder.create().uv(12, 44).cuboid(-4.0F, 0.0F, -2.0F, 8.0F, 13.0F, 4.0F, new Dilation(0.5F)), ModelTransform.pivot(0.0F, 0.0F, 0.0F)); | ||
|
||
return TexturedModelData.of(modelData, 64, 64); | ||
} | ||
|
||
public void setAngles(MoonblessedZombieEntity moonblessedZombie, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) { | ||
super.setAngles(moonblessedZombie, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch); | ||
this.headwear.copyTransform(this.head); | ||
this.body_wear.copyTransform(this.body); | ||
|
||
CrossbowPosing.meleeAttack(this.leftArm, this.rightArm, this.isAttacking(moonblessedZombie), this.handSwingProgress, ageInTicks); | ||
} | ||
|
||
@Override | ||
public void render(MatrixStack matrices, VertexConsumer vertices, int light, int overlay, int color) { | ||
super.render(matrices, vertices, light, overlay, color); | ||
this.headwear.render(matrices,vertices,light,overlay,color); | ||
this.body_wear.render(matrices,vertices,light,overlay,color); | ||
} | ||
|
||
public boolean isAttacking(MoonblessedZombieEntity zombieEntity) { | ||
return zombieEntity.isAttacking(); | ||
} | ||
} |
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
22 changes: 22 additions & 0 deletions
22
src/main/java/ru/pinkgoosik/hiddenrealm/client/render/MoonblessedZombieRenderer.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,22 @@ | ||
package ru.pinkgoosik.hiddenrealm.client.render; | ||
|
||
import net.minecraft.client.render.entity.EntityRendererFactory; | ||
import net.minecraft.client.render.entity.MobEntityRenderer; | ||
import net.minecraft.util.Identifier; | ||
import ru.pinkgoosik.hiddenrealm.HiddenRealmMod; | ||
import ru.pinkgoosik.hiddenrealm.client.HiddenRealmClient; | ||
import ru.pinkgoosik.hiddenrealm.client.model.MoonblessedZombieModel; | ||
import ru.pinkgoosik.hiddenrealm.entity.MoonblessedZombieEntity; | ||
|
||
public class MoonblessedZombieRenderer extends MobEntityRenderer<MoonblessedZombieEntity, MoonblessedZombieModel> { | ||
private static final Identifier TEXTURE = Identifier.of(HiddenRealmMod.MOD_ID,"textures/entity/moonblessed_zombie.png"); | ||
|
||
public MoonblessedZombieRenderer(EntityRendererFactory.Context ctx) { | ||
super(ctx, new MoonblessedZombieModel(ctx.getPart(HiddenRealmClient.MOONBLESSED_ZOMBIE_LAYER)), 0.5F); | ||
} | ||
|
||
public Identifier getTexture(MoonblessedZombieEntity abstractSkeletonEntity) { | ||
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
Oops, something went wrong.