Skip to content

Commit

Permalink
Start weave armor work
Browse files Browse the repository at this point in the history
  • Loading branch information
ACGaming committed Jun 14, 2024
1 parent fe23a79 commit 8d94020
Show file tree
Hide file tree
Showing 35 changed files with 199 additions and 1 deletion.
30 changes: 29 additions & 1 deletion src/main/java/mod/emt/harkenscythe/init/HSItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import mod.emt.harkenscythe.items.HSArmor;
import mod.emt.harkenscythe.items.HSBiomassSeedGerminated;
import mod.emt.harkenscythe.items.HSCreepball;
import mod.emt.harkenscythe.items.HSDyableArmor;
import mod.emt.harkenscythe.items.HSEssenceKeeper;
import mod.emt.harkenscythe.items.HSEssenceKeeperBlood;
import mod.emt.harkenscythe.items.HSEssenceKeeperSoul;
Expand Down Expand Up @@ -160,8 +161,27 @@ public class HSItems
@GameRegistry.ObjectHolder("harken_athame")
public static HSSword harken_athame;

@GameRegistry.ObjectHolder("bloodweave_hood")
public static HSDyableArmor bloodweave_hood;
@GameRegistry.ObjectHolder("bloodweave_robe")
public static HSDyableArmor bloodweave_robe;
@GameRegistry.ObjectHolder("bloodweave_pants")
public static HSDyableArmor bloodweave_pants;
@GameRegistry.ObjectHolder("bloodweave_shoes")
public static HSDyableArmor bloodweave_shoes;
@GameRegistry.ObjectHolder("soulweave_hood")
public static HSDyableArmor soulweave_hood;
@GameRegistry.ObjectHolder("soulweave_robe")
public static HSDyableArmor soulweave_robe;
@GameRegistry.ObjectHolder("soulweave_pants")
public static HSDyableArmor soulweave_pants;
@GameRegistry.ObjectHolder("soulweave_shoes")
public static HSDyableArmor soulweave_shoes;

public static ArmorMaterial ARMOR_BIOMASS = EnumHelper.addArmorMaterial("biomass", "biomass", 14, new int[] {1, 4, 5, 2}, 17, SoundEvents.BLOCK_SLIME_PLACE, 0.5F).setRepairItem(new ItemStack(biomass));
public static ArmorMaterial ARMOR_LIVINGMETAL = EnumHelper.addArmorMaterial("livingmetal", "livingmetal", 24, new int[] {2, 5, 6, 2}, 20, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 1.0F).setRepairItem(new ItemStack(livingmetal_ingot));
public static ArmorMaterial ARMOR_BLOODWEAVE = EnumHelper.addArmorMaterial("bloodweave", "bloodweave", 15, new int[] {1, 3, 2, 1}, 15, SoundEvents.ITEM_ARMOR_EQUIP_LEATHER, 0.0F).setRepairItem(new ItemStack(Item.getItemFromBlock(HSBlocks.bloodweave_cloth)));
public static ArmorMaterial ARMOR_SOULWEAVE = EnumHelper.addArmorMaterial("soulweave", "soulweave", 15, new int[] {1, 3, 2, 1}, 15, SoundEvents.ITEM_ARMOR_EQUIP_LEATHER, 0.0F).setRepairItem(new ItemStack(Item.getItemFromBlock(HSBlocks.soulweave_cloth)));

public static ToolMaterial TOOL_BIOMASS = EnumHelper.addToolMaterial("biomass", 3, 151, 6.5F, 1.5F, 17).setRepairItem(new ItemStack(biomass));
public static ToolMaterial TOOL_LIVINGMETAL = EnumHelper.addToolMaterial("livingmetal", 3, 481, 7.5F, 2.5F, 20).setRepairItem(new ItemStack(livingmetal_ingot));
Expand Down Expand Up @@ -227,7 +247,15 @@ public static void onRegisterItemsEvent(@Nonnull final RegistryEvent.Register<It
HSRegistry.setup(new HSItemBlockSpecial(HSBlocks.soul_cake, EnumRarity.UNCOMMON), "soul_cake").setMaxStackSize(1).setCreativeTab(HarkenScythe.TAB),
HSRegistry.setup(new HSFood(3, 0.2F, false, 16, true, EnumRarity.UNCOMMON), "soul_cookie").setCreativeTab(HarkenScythe.TAB),
HSRegistry.setup(new HSItem(EnumRarity.COMMON), "blunt_harken_blade").setCreativeTab(HarkenScythe.TAB),
HSRegistry.setup(new HSSword(ToolMaterial.IRON, EnumRarity.COMMON), "harken_athame").setCreativeTab(HarkenScythe.TAB)
HSRegistry.setup(new HSSword(ToolMaterial.IRON, EnumRarity.COMMON), "harken_athame").setCreativeTab(HarkenScythe.TAB),
HSRegistry.setup(new HSDyableArmor(ARMOR_BLOODWEAVE, 4, EntityEquipmentSlot.HEAD, EnumRarity.UNCOMMON, 0x852824), "bloodweave_hood").setCreativeTab(HarkenScythe.TAB),
HSRegistry.setup(new HSDyableArmor(ARMOR_BLOODWEAVE, 4, EntityEquipmentSlot.CHEST, EnumRarity.UNCOMMON, 0x852824), "bloodweave_robe").setCreativeTab(HarkenScythe.TAB),
HSRegistry.setup(new HSDyableArmor(ARMOR_BLOODWEAVE, 4, EntityEquipmentSlot.LEGS, EnumRarity.UNCOMMON, 0x852824), "bloodweave_pants").setCreativeTab(HarkenScythe.TAB),
HSRegistry.setup(new HSDyableArmor(ARMOR_BLOODWEAVE, 4, EntityEquipmentSlot.FEET, EnumRarity.UNCOMMON, 0x852824), "bloodweave_shoes").setCreativeTab(HarkenScythe.TAB),
HSRegistry.setup(new HSDyableArmor(ARMOR_SOULWEAVE, 4, EntityEquipmentSlot.HEAD, EnumRarity.UNCOMMON, 0x5CAED7), "soulweave_hood").setCreativeTab(HarkenScythe.TAB),
HSRegistry.setup(new HSDyableArmor(ARMOR_SOULWEAVE, 4, EntityEquipmentSlot.CHEST, EnumRarity.UNCOMMON, 0x5CAED7), "soulweave_robe").setCreativeTab(HarkenScythe.TAB),
HSRegistry.setup(new HSDyableArmor(ARMOR_SOULWEAVE, 4, EntityEquipmentSlot.LEGS, EnumRarity.UNCOMMON, 0x5CAED7), "soulweave_pants").setCreativeTab(HarkenScythe.TAB),
HSRegistry.setup(new HSDyableArmor(ARMOR_SOULWEAVE, 4, EntityEquipmentSlot.FEET, EnumRarity.UNCOMMON, 0x5CAED7), "soulweave_shoes").setCreativeTab(HarkenScythe.TAB)
);

// ITEM BLOCKS
Expand Down
114 changes: 114 additions & 0 deletions src/main/java/mod/emt/harkenscythe/items/HSDyableArmor.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
package mod.emt.harkenscythe.items;

import mod.emt.harkenscythe.init.HSItems;
import net.minecraft.entity.Entity;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;

public class HSDyableArmor extends HSArmor
{
private static final String[] BLOODWEAVE_ARMOR_TEXTURES = new String[] {"harkenscythe:textures/models/armor/bloodweave_1.png", "harkenscythe:textures/models/armor/bloodweave_2.png", "harkenscythe:textures/models/armor/bloodweave_1_overlay.png", "harkenscythe:textures/models/armor/bloodweave_2_overlay.png"};
private static final String[] SOULWEAVE_ARMOR_TEXTURES = new String[] {"harkenscythe:textures/models/armor/soulweave_1.png", "harkenscythe:textures/models/armor/soulweave_2.png", "harkenscythe:textures/models/armor/soulweave_1_overlay.png", "harkenscythe:textures/models/armor/soulweave_2_overlay.png"};
private final int defaultColor;

public HSDyableArmor(ArmorMaterial materialIn, int renderIndexIn, EntityEquipmentSlot equipmentSlotIn, EnumRarity rarity, int defaultColor)
{
super(materialIn, renderIndexIn, equipmentSlotIn, rarity);
this.defaultColor = defaultColor;
}

public int getDefaultColor()
{
return defaultColor;
}

@Override
public boolean hasColor(ItemStack stack)
{
return stack.getTagCompound() != null && stack.getTagCompound().hasKey("display", 10) && stack.getTagCompound().getCompoundTag("display").hasKey("color", 3);
}

@Override
public int getColor(ItemStack stack)
{
NBTTagCompound nbttagcompound = stack.getTagCompound();

if (nbttagcompound != null)
{
NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("display");

if (nbttagcompound1.hasKey("color", 3))
{
return nbttagcompound1.getInteger("color");
}
}

return getDefaultColor();
}

@Override
public void removeColor(ItemStack stack)
{
NBTTagCompound nbttagcompound = stack.getTagCompound();

if (nbttagcompound != null)
{
NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("display");

if (nbttagcompound1.hasKey("color"))
{
nbttagcompound1.removeTag("color");
}
}
}

@Override
public void setColor(ItemStack stack, int color)
{
NBTTagCompound nbttagcompound = stack.getTagCompound();

if (nbttagcompound == null)
{
nbttagcompound = new NBTTagCompound();
stack.setTagCompound(nbttagcompound);
}

NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("display");

if (!nbttagcompound.hasKey("display", 10))
{
nbttagcompound.setTag("display", nbttagcompound1);
}

nbttagcompound1.setInteger("color", color);
}

@Override
public boolean hasOverlay(ItemStack stack)
{
return true;
}

@Override
public String getArmorTexture(ItemStack stack, Entity entity, EntityEquipmentSlot slot, String type)
{
if (stack.getItem() == HSItems.bloodweave_hood || stack.getItem() == HSItems.bloodweave_robe || stack.getItem() == HSItems.bloodweave_pants || stack.getItem() == HSItems.bloodweave_shoes)
{
if (type != null && type.equals("overlay"))
{
return slot == EntityEquipmentSlot.LEGS ? BLOODWEAVE_ARMOR_TEXTURES[3] : BLOODWEAVE_ARMOR_TEXTURES[2];
}
return slot == EntityEquipmentSlot.LEGS ? BLOODWEAVE_ARMOR_TEXTURES[1] : BLOODWEAVE_ARMOR_TEXTURES[0];
}
else
{
if (type != null && type.equals("overlay"))
{
return slot == EntityEquipmentSlot.LEGS ? SOULWEAVE_ARMOR_TEXTURES[3] : SOULWEAVE_ARMOR_TEXTURES[2];
}
return slot == EntityEquipmentSlot.LEGS ? SOULWEAVE_ARMOR_TEXTURES[1] : SOULWEAVE_ARMOR_TEXTURES[0];
}
}
}
8 changes: 8 additions & 0 deletions src/main/resources/assets/harkenscythe/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ item.harkenscythe.biomass_seed.name=Biomass Seed
item.harkenscythe.biomass_shovel.name=Biomass Shovel
item.harkenscythe.biomass_sword.name=Biomass Sword
item.harkenscythe.blood_essence.name=Bloody Essence
item.harkenscythe.bloodweave_hood.name=Bloodweave Hood
item.harkenscythe.bloodweave_pants.name=Bloodweave Pants
item.harkenscythe.bloodweave_robe.name=Bloodweave Robe
item.harkenscythe.bloodweave_shoes.name=Bloodweave Shoes
item.harkenscythe.blunt_harken_blade.name=Blunt Harken Blade
item.harkenscythe.carnage_book.name=Book of Carnage
item.harkenscythe.creepball.name=Creepball
Expand Down Expand Up @@ -64,6 +68,10 @@ item.harkenscythe.shadow_book.name=Book of Shadows
item.harkenscythe.soul_cake.name=Cake of Souls
item.harkenscythe.soul_cookie.name=Cookie of Souls
item.harkenscythe.soul_essence.name=Ghostly Essence
item.harkenscythe.soulweave_hood.name=Soulweave Hood
item.harkenscythe.soulweave_pants.name=Soulweave Pants
item.harkenscythe.soulweave_robe.name=Soulweave Robe
item.harkenscythe.soulweave_shoes.name=Soulweave Shoes
item.harkenscythe.stone_glaive.name=Stone Glaive
item.harkenscythe.stone_scythe.name=Stone Scythe
item.harkenscythe.wooden_glaive.name=Wooden Glaive
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "harkenscythe:items/bloodweave_hood"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "harkenscythe:items/bloodweave_pants"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "harkenscythe:items/bloodweave_robe"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "harkenscythe:items/bloodweave_shoes"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "harkenscythe:items/soulweave_hood"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "harkenscythe:items/soulweave_pants"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "harkenscythe:items/soulweave_robe"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "harkenscythe:items/soulweave_shoes"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 8d94020

Please sign in to comment.