Skip to content

Commit

Permalink
finish battle mage armour
Browse files Browse the repository at this point in the history
  • Loading branch information
CammiePone committed Jan 15, 2024
1 parent 6d140d8 commit d885773
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,29 @@

public class BattleMageArmourModel<T extends LivingEntity> extends BipedEntityModel<T> {
public static final EntityModelLayer MODEL_LAYER = new EntityModelLayer(Arcanus.id("battle_mage_armor"), "main");
public final ModelPart armorHead;
public final ModelPart armorBody;
public final ModelPart helmet;
public final ModelPart chestplate;
public final ModelPart surcoatFront;
public final ModelPart surcoatBack;
public final ModelPart armorRightArm;
public final ModelPart armorLeftArm;
public final ModelPart armorRightLeg;
public final ModelPart armorRightBoot;
public final ModelPart armorLeftLeg;
public final ModelPart armorLeftBoot;
public final ModelPart rightGauntlet;
public final ModelPart leftGauntlet;
public final ModelPart rightGreaves;
public final ModelPart rightBoot;
public final ModelPart leftGreaves;
public final ModelPart leftBoot;

public BattleMageArmourModel(ModelPart root) {
super(root);
armorHead = head.getChild("armorHead");
armorBody = body.getChild("armorBody");
surcoatFront = armorBody.getChild("surcoatFront");
surcoatBack = armorBody.getChild("surcoatBack");
armorRightArm = rightArm.getChild("armorRightArm");
armorLeftArm = leftArm.getChild("armorLeftArm");
armorRightLeg = rightLeg.getChild("armorRightLeg");
armorLeftLeg = leftLeg.getChild("armorLeftLeg");
armorRightBoot = rightLeg.getChild("armorRightBoot");
armorLeftBoot = leftLeg.getChild("armorLeftBoot");
helmet = head.getChild("armorHead");
chestplate = body.getChild("armorBody");
surcoatFront = chestplate.getChild("surcoatFront");
surcoatBack = chestplate.getChild("surcoatBack");
rightGauntlet = rightArm.getChild("armorRightArm");
leftGauntlet = leftArm.getChild("armorLeftArm");
rightGreaves = rightLeg.getChild("armorRightLeg");
leftGreaves = leftLeg.getChild("armorLeftLeg");
rightBoot = rightLeg.getChild("armorRightBoot");
leftBoot = leftLeg.getChild("armorLeftBoot");
}

public static TexturedModelData getTexturedModelData() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,19 @@ public void render(MatrixStack matrices, VertexConsumerProvider vertexConsumers,

contextModel.setAttributes(model);
model.setVisible(true);
model.armorHead.visible = slot == EquipmentSlot.HEAD;
model.armorBody.visible = slot == EquipmentSlot.CHEST;
model.helmet.visible = slot == EquipmentSlot.HEAD;
model.chestplate.visible = slot == EquipmentSlot.CHEST;
model.surcoatFront.visible = slot == EquipmentSlot.CHEST;
model.surcoatBack.visible = slot == EquipmentSlot.CHEST;
model.armorRightArm.visible = slot == EquipmentSlot.CHEST;
model.armorLeftArm.visible = slot == EquipmentSlot.CHEST;
model.armorRightLeg.visible = slot == EquipmentSlot.LEGS;
model.armorLeftLeg.visible = slot == EquipmentSlot.LEGS;
model.armorRightBoot.visible = slot == EquipmentSlot.FEET;
model.armorLeftBoot.visible = slot == EquipmentSlot.FEET;
model.rightGauntlet.visible = slot == EquipmentSlot.CHEST;
model.leftGauntlet.visible = slot == EquipmentSlot.CHEST;
model.rightGreaves.visible = slot == EquipmentSlot.LEGS;
model.leftGreaves.visible = slot == EquipmentSlot.LEGS;
model.rightBoot.visible = slot == EquipmentSlot.FEET;
model.leftBoot.visible = slot == EquipmentSlot.FEET;

model.surcoatFront.pitch = Math.min(contextModel.leftLeg.pitch, contextModel.rightLeg.pitch) - 0.0436f;
model.surcoatBack.pitch = Math.max(contextModel.leftLeg.pitch, contextModel.rightLeg.pitch) + 0.0436f;

model.render(matrices, ItemRenderer.getArmorGlintConsumer(vertexConsumers, RenderLayer.getArmorCutoutNoCull(mainTexture), false, false), light, OverlayTexture.DEFAULT_UV, 1f, 1f, 1f, 1f);
model.render(matrices, ItemRenderer.getArmorGlintConsumer(vertexConsumers, RenderLayer.getArmorCutoutNoCull(overlayTexture), false, false), light, OverlayTexture.DEFAULT_UV, r, g, b, 1f);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,15 @@ public abstract class ArmorStandEntityMixin extends LivingEntity {
BattleMageArmorItem.setWaxed(stack, false);
heldStack.damage(1, player, player1 -> player1.sendToolBreakStatus(hand));
info.setReturnValue(ActionResult.SUCCESS);
return;
}

if(BattleMageArmorItem.getOxidation(stack) != Oxidizable.OxidizationLevel.UNAFFECTED) {
getWorld().playSound(player, getBlockPos(), SoundEvents.ITEM_AXE_SCRAPE, SoundCategory.BLOCKS, 1f, 1f);
BattleMageArmorItem.setOxidation(stack, Oxidizable.OxidizationLevel.values()[BattleMageArmorItem.getOxidation(stack).ordinal() - 1]);
heldStack.damage(1, player, player1 -> player1.sendToolBreakStatus(hand));
info.setReturnValue(ActionResult.SUCCESS);
return;
}
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
"type": "minecraft:crafting_shaped",
"category": "misc",
"pattern": [
"#S#",
"#C#",
"###"
"CTC",
"CSC",
"CCC"
],
"key": {
"#": {
"item": "minecraft:copper_block"
},
"C": {
"item": "minecraft:smooth_basalt"
"item": "minecraft:copper_block"
},
"S": {
"item": "minecraft:stone"
},
"T": {
"item": "minecraft:amethyst_shard"
}
},
Expand Down

0 comments on commit d885773

Please sign in to comment.