Skip to content

Commit

Permalink
Thief
Browse files Browse the repository at this point in the history
  • Loading branch information
Starexify committed Sep 1, 2024
1 parent 117cbba commit f9d8ac4
Show file tree
Hide file tree
Showing 21 changed files with 178 additions and 5 deletions.
10 changes: 9 additions & 1 deletion src/generated/resources/assets/hexxit_gear/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,13 @@
"item.hexxit_gear.scale_boots": "Scale Boots",
"item.hexxit_gear.scale_chestguard": "Scale Chestguard",
"item.hexxit_gear.scale_helmet": "Scale Helmet",
"item.hexxit_gear.scale_leggings": "Scale Leggings"
"item.hexxit_gear.scale_leggings": "Scale Leggings",
"item.hexxit_gear.thief_hood": "Thief Hood",
"item.hexxit_gear.thief_trousers": "Thief Trousers",
"item.hexxit_gear.thief_tunic": "Thief Tunic",
"item.hexxit_gear.thief_turnshoes": "Thief Turnshoes",
"item.hexxit_gear.tribal_greaves": "Tribal Greaves",
"item.hexxit_gear.tribal_skull": "Tribal Skull",
"item.hexxit_gear.tribal_tunic": "Tribal Tunic",
"item.hexxit_gear.tribal_warboots": "Tribal Warboots"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "hexxit_gear:item/thief_hood"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "hexxit_gear:item/thief_trousers"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "hexxit_gear:item/thief_tunic"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "hexxit_gear:item/thief_turnshoes"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "hexxit_gear:item/tribal_greaves"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "hexxit_gear:item/tribal_skull"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "hexxit_gear:item/tribal_tunic"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "hexxit_gear:item/tribal_warboots"
}
}
30 changes: 30 additions & 0 deletions src/main/java/net/nova/hexxit_gear/client/model/SageHoodModel.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package net.nova.hexxit_gear.client.model;

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.nova.hexxit_gear.HexxitGearR;

public class SageHoodModel extends BaseHelmetModel {
public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation(HexxitGearR.rl("sage_hood"), "main");
public static final ResourceLocation TEXTURE = HexxitGearR.rl("textures/models/armor/sage_hood.png");

public SageHoodModel(ModelPart root) {
super(root);
}

public static LayerDefinition createLayer() {
MeshDefinition meshdefinition = new MeshDefinition();
PartDefinition partdefinition = meshdefinition.getRoot();

PartDefinition root = partdefinition.addOrReplaceChild("root", CubeListBuilder.create().texOffs(0, 0).addBox(-5.0F, -9.0F, -6.0F, 10.0F, 9.0F, 10.0F, new CubeDeformation(0.0F))
.texOffs(0, 20).addBox(-4.0F, -4.0F, -5.5F, 8.0F, 4.0F, 8.0F, new CubeDeformation(0.25F)), PartPose.offset(0.0F, 24.0F, 1.0F));

PartDefinition hood_back_2_r1 = root.addOrReplaceChild("hood_back_2_r1", CubeListBuilder.create().texOffs(45, 0).addBox(-2.5F, -10.5F, 4.75F, 5.0F, 3.0F, 1.0F, new CubeDeformation(0.0F))
.texOffs(43, 5).addBox(-3.5F, -10.0F, 4.0F, 7.0F, 5.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, -1.0F, -0.0873F, 0.0F, 0.0F));

return LayerDefinition.create(meshdefinition, 64, 32);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package net.nova.hexxit_gear.client.model;

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.nova.hexxit_gear.HexxitGearR;

public class ThiefHoodModel extends BaseHelmetModel {
public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation(HexxitGearR.rl("thief_hood"), "main");
public static final ResourceLocation TEXTURE = HexxitGearR.rl("textures/models/armor/thief_hood.png");

public ThiefHoodModel(ModelPart root) {
super(root);
}

public static LayerDefinition createLayer() {
MeshDefinition meshdefinition = new MeshDefinition();
PartDefinition partdefinition = meshdefinition.getRoot();

PartDefinition root = partdefinition.addOrReplaceChild("root", CubeListBuilder.create().texOffs(0, 0).addBox(-5.0F, -9.0F, -5.0F, 10.0F, 9.0F, 10.0F, new CubeDeformation(0.0F))
.texOffs(0, 19).addBox(-4.0F, -8.0F, -4.5F, 8.0F, 8.0F, 8.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 24.0F, 0.0F));

PartDefinition hood_back_3_r1 = root.addOrReplaceChild("hood_back_3_r1", CubeListBuilder.create().texOffs(47, 1).addBox(-2.0F, -11.1F, 5.0F, 4.0F, 1.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, -0.1309F, 0.0F, 0.0F));
PartDefinition hood_back_2_r1 = root.addOrReplaceChild("hood_back_2_r1", CubeListBuilder.create().texOffs(45, 4).addBox(-3.0F, -10.55F, 4.75F, 6.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, -0.0873F, 0.0F, 0.0F));
PartDefinition hood_back_1_r1 = root.addOrReplaceChild("hood_back_1_r1", CubeListBuilder.create().texOffs(43, 9).addBox(-4.0F, -9.75F, 4.5F, 8.0F, 5.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, -0.0436F, 0.0F, 0.0F));

return LayerDefinition.create(meshdefinition, 64, 35);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import net.minecraft.world.item.ItemStack;
import net.neoforged.neoforge.client.extensions.common.IClientItemExtensions;
import net.nova.hexxit_gear.client.model.ScaleHelmetModel;
import net.nova.hexxit_gear.client.model.ThiefHoodModel;
import net.nova.hexxit_gear.client.model.TribalSkullModel;

import java.util.Collections;
Expand Down Expand Up @@ -45,5 +46,21 @@ public HumanoidModel<?> getHumanoidArmorModel(LivingEntity livingEntity, ItemSta
}
};
}

public static IClientItemExtensions thiefHood() {
return new IClientItemExtensions() {
@Override
public HumanoidModel<?> getHumanoidArmorModel(LivingEntity livingEntity, ItemStack itemStack, EquipmentSlot equipmentSlot, HumanoidModel original) {
HumanoidModel armorModel = new HumanoidModel(new ModelPart(Collections.emptyList(),
Map.of("head", new ThiefHoodModel(Minecraft.getInstance().getEntityModels().bakeLayer(ThiefHoodModel.LAYER_LOCATION)).root, "hat", new ModelPart(Collections.emptyList(), Collections.emptyMap()), "body",
new ModelPart(Collections.emptyList(), Collections.emptyMap()), "right_arm", new ModelPart(Collections.emptyList(), Collections.emptyMap()), "left_arm", new ModelPart(Collections.emptyList(), Collections.emptyMap()),
"right_leg", new ModelPart(Collections.emptyList(), Collections.emptyMap()), "left_leg", new ModelPart(Collections.emptyList(), Collections.emptyMap()))));
armorModel.crouching = livingEntity.isShiftKeyDown();
armorModel.riding = original.riding;
armorModel.young = livingEntity.isBaby();
return armorModel;
}
};
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,11 @@ protected void registerModels() {
basicItem(HGItems.TRIBAL_TUNIC.get());
basicItem(HGItems.TRIBAL_GREAVES.get());
basicItem(HGItems.TRIBAL_WARBOOTS.get());

// Thief
basicItem(HGItems.THIEF_HOOD.get());
basicItem(HGItems.THIEF_TUNIC.get());
basicItem(HGItems.THIEF_TROUSERS.get());
basicItem(HGItems.THIEF_TURNSHOES.get());
}
}
5 changes: 5 additions & 0 deletions src/main/java/net/nova/hexxit_gear/data/LangProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ protected void addTranslations() {
addItem(HGItems.TRIBAL_GREAVES, "Tribal Greaves");
addItem(HGItems.TRIBAL_WARBOOTS, "Tribal Warboots");

addItem(HGItems.THIEF_HOOD, "Thief Hood");
addItem(HGItems.THIEF_TUNIC, "Thief Tunic");
addItem(HGItems.THIEF_TROUSERS, "Thief Trousers");
addItem(HGItems.THIEF_TURNSHOES, "Thief Turnshoes");

// Creative Tab
add(CreativeTab.HEXXIT_GEAR_TAB_TITLE, "Hexxit Gear R");
}
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/net/nova/hexxit_gear/init/CreativeTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ public class CreativeTab {
output.accept(HGItems.TRIBAL_TUNIC);
output.accept(HGItems.TRIBAL_GREAVES);
output.accept(HGItems.TRIBAL_WARBOOTS);

// Thief
output.accept(HGItems.THIEF_HOOD);
output.accept(HGItems.THIEF_TUNIC);
output.accept(HGItems.THIEF_TROUSERS);
output.accept(HGItems.THIEF_TURNSHOES);
}).build()
);
}
21 changes: 17 additions & 4 deletions src/main/java/net/nova/hexxit_gear/init/HGArmorMaterial.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,27 @@ public class HGArmorMaterial {
));

public static Holder<ArmorMaterial> TRIBAL = ARMOR_MATERIALS.register("tribal", () -> new ArmorMaterial(Util.make(new EnumMap<>(ArmorItem.Type.class), map -> {
map.put(ArmorItem.Type.BOOTS, 2);
map.put(ArmorItem.Type.BOOTS, 3);
map.put(ArmorItem.Type.LEGGINGS, 6);
map.put(ArmorItem.Type.CHESTPLATE, 7);
map.put(ArmorItem.Type.HELMET, 3);
map.put(ArmorItem.Type.BODY, 11);
map.put(ArmorItem.Type.CHESTPLATE, 8);
map.put(ArmorItem.Type.HELMET, 2);
map.put(ArmorItem.Type.BODY, 10);
}), 18, ARMOR_EQUIP_BONE_BLOCK, () -> Ingredient.of(HGItems.HEXICAL_DIAMOND),
List.of(new ArmorMaterial.Layer(
HexxitGearR.rl("tribal")
)), 1F, 0F
));

public static Holder<ArmorMaterial> THIEF = ARMOR_MATERIALS.register("thief", () -> new ArmorMaterial(Util.make(new EnumMap<>(ArmorItem.Type.class), map -> {
map.put(ArmorItem.Type.BOOTS, 2);
map.put(ArmorItem.Type.LEGGINGS, 6);
map.put(ArmorItem.Type.CHESTPLATE, 7);
map.put(ArmorItem.Type.HELMET, 3);
map.put(ArmorItem.Type.BODY, 7);
}), 20, SoundEvents.ARMOR_EQUIP_GENERIC, () -> Ingredient.of(HGItems.HEXICAL_DIAMOND),
List.of(new ArmorMaterial.Layer(
HexxitGearR.rl("thief")
)), 0F, 0F
));

}
9 changes: 9 additions & 0 deletions src/main/java/net/nova/hexxit_gear/init/HGItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ public ResourceLocation getArmorTexture(ItemStack stack, Entity entity, Equipmen
public static DeferredItem<Item> TRIBAL_WARBOOTS = ITEMS.register("tribal_warboots", () -> new ArmorItem(HGArmorMaterial.TRIBAL, ArmorItem.Type.BOOTS, new Item.Properties().durability(ArmorItem.Type.BOOTS.getDurability(29)).fireResistant()));

// Thief
public static DeferredItem<Item> THIEF_HOOD = ITEMS.register("thief_hood", () -> new ArmorItem(HGArmorMaterial.THIEF, ArmorItem.Type.HELMET, new Item.Properties().durability(ArmorItem.Type.HELMET.getDurability(29)).fireResistant()) {
@Override
public ResourceLocation getArmorTexture(ItemStack stack, Entity entity, EquipmentSlot slot, ArmorMaterial.Layer layer, boolean innerModel) {
return TribalSkullModel.TEXTURE;
}
});
public static DeferredItem<Item> THIEF_TUNIC = ITEMS.register("thief_tunic", () -> new ArmorItem(HGArmorMaterial.THIEF, ArmorItem.Type.CHESTPLATE, new Item.Properties().durability(ArmorItem.Type.CHESTPLATE.getDurability(29)).fireResistant()));
public static DeferredItem<Item> THIEF_TROUSERS = ITEMS.register("thief_trousers", () -> new ArmorItem(HGArmorMaterial.THIEF, ArmorItem.Type.LEGGINGS, new Item.Properties().durability(ArmorItem.Type.LEGGINGS.getDurability(29)).fireResistant()));
public static DeferredItem<Item> THIEF_TURNSHOES = ITEMS.register("thief_turnshoes", () -> new ArmorItem(HGArmorMaterial.THIEF, ArmorItem.Type.BOOTS, new Item.Properties().durability(ArmorItem.Type.BOOTS.getDurability(29)).fireResistant()));

// Sage
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f9d8ac4

Please sign in to comment.