Skip to content

Commit

Permalink
Add livingmetal shears
Browse files Browse the repository at this point in the history
  • Loading branch information
IcarussOne committed Jun 10, 2024
1 parent 55c2fdb commit eeeafe0
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class HSItemTooltipEvent
private static final ResourceLocation SOUL_ALTAR = new ResourceLocation(HarkenScythe.MOD_ID, "soul_altar");
private static final ResourceLocation BLUNT_HARKEN_BLADE = new ResourceLocation(HarkenScythe.MOD_ID, "blunt_harken_blade");
private static final ResourceLocation HARKEN_ATHAME = new ResourceLocation(HarkenScythe.MOD_ID, "harken_athame");
private static final ResourceLocation LIVINGMETAL_SHEARS = new ResourceLocation(HarkenScythe.MOD_ID, "livingmetal_shears");
private static final ResourceLocation SOUL_CAKE = new ResourceLocation(HarkenScythe.MOD_ID, "soul_cake");
private static final ResourceLocation SOUL_COOKIE = new ResourceLocation(HarkenScythe.MOD_ID, "soul_cookie");

Expand All @@ -38,6 +39,10 @@ else if (ForgeRegistries.ITEMS.getKey(item).equals(BLUNT_HARKEN_BLADE))
{
event.getToolTip().add(1, I18n.format("tooltip.harkenscythe.blunt_blade"));
}
else if (ForgeRegistries.ITEMS.getKey(item).equals(LIVINGMETAL_SHEARS))
{
event.getToolTip().add(1, I18n.format("tooltip.harkenscythe.shears"));
}
else if (ForgeRegistries.ITEMS.getKey(item).equals(SOUL_CAKE))
{
event.getToolTip().add(1, I18n.format("tooltip.harkenscythe.soul_cake"));
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/mod/emt/harkenscythe/init/HSItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import mod.emt.harkenscythe.items.tools.HSHoe;
import mod.emt.harkenscythe.items.tools.HSPickaxe;
import mod.emt.harkenscythe.items.tools.HSScythe;
import mod.emt.harkenscythe.items.tools.HSShears;
import mod.emt.harkenscythe.items.tools.HSShovel;
import mod.emt.harkenscythe.items.tools.HSSword;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
Expand All @@ -30,6 +31,7 @@
import net.minecraft.item.Item;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.item.ItemArmor.ArmorMaterial;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.event.ModelRegistryEvent;
Expand Down Expand Up @@ -137,6 +139,8 @@ public class HSItems
public static HSAxe livingmetal_axe;
@GameRegistry.ObjectHolder("livingmetal_hoe")
public static HSHoe livingmetal_hoe;
@GameRegistry.ObjectHolder("livingmetal_shears")
public static HSShears livingmetal_shears;
@GameRegistry.ObjectHolder("livingmetal_helmet")
public static HSArmor livingmetal_helmet;
@GameRegistry.ObjectHolder("livingmetal_chestplate")
Expand Down Expand Up @@ -215,6 +219,7 @@ public static void onRegisterItemsEvent(@Nonnull final RegistryEvent.Register<It
HSRegistry.setup(new HSPickaxe(TOOL_LIVINGMETAL, EnumRarity.UNCOMMON), "livingmetal_pickaxe").setCreativeTab(HarkenScythe.TAB),
HSRegistry.setup(new HSAxe(TOOL_LIVINGMETAL, 8.0F, -3.0F, EnumRarity.UNCOMMON), "livingmetal_axe").setCreativeTab(HarkenScythe.TAB),
HSRegistry.setup(new HSHoe(TOOL_LIVINGMETAL, EnumRarity.UNCOMMON), "livingmetal_hoe").setCreativeTab(HarkenScythe.TAB),
HSRegistry.setup(new HSShears(481, EnumRarity.UNCOMMON, Ingredient.fromStacks(new ItemStack(livingmetal_ingot))), "livingmetal_shears").setCreativeTab(HarkenScythe.TAB),
HSRegistry.setup(new HSArmor(ARMOR_LIVINGMETAL, 4, EntityEquipmentSlot.HEAD, EnumRarity.UNCOMMON), "livingmetal_helmet").setCreativeTab(HarkenScythe.TAB),
HSRegistry.setup(new HSArmor(ARMOR_LIVINGMETAL, 4, EntityEquipmentSlot.CHEST, EnumRarity.UNCOMMON), "livingmetal_chestplate").setCreativeTab(HarkenScythe.TAB),
HSRegistry.setup(new HSArmor(ARMOR_LIVINGMETAL, 4, EntityEquipmentSlot.LEGS, EnumRarity.UNCOMMON), "livingmetal_leggings").setCreativeTab(HarkenScythe.TAB),
Expand Down
50 changes: 50 additions & 0 deletions src/main/java/mod/emt/harkenscythe/items/tools/HSShears.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package mod.emt.harkenscythe.items.tools;

import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemShears;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.Ingredient;

public class HSShears extends ItemShears
{
private final EnumRarity rarity;
public Ingredient repairMaterial;

public HSShears(int durability, EnumRarity rarity, Ingredient repairMaterial)
{
this.maxStackSize = 1;
this.rarity = rarity;
this.repairMaterial = repairMaterial;
this.setMaxDamage(durability);
}

// Hardcoded blocks...
@Override
public float getDestroySpeed(ItemStack stack, IBlockState state)
{
Material material = state.getMaterial();

if (material != Material.WEB && material != Material.LEAVES)
{
return material == Material.CLOTH ? 5.0F : super.getDestroySpeed(stack, state);
}
else
{
return 15.0F;
}
}

@Override
public EnumRarity getRarity(ItemStack stack)
{
return rarity;
}

@Override
public boolean getIsRepairable(ItemStack toRepair, ItemStack repair)
{
return repairMaterial.test(repair) || super.getIsRepairable(toRepair, repair);
}
}
2 changes: 2 additions & 0 deletions src/main/resources/assets/harkenscythe/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ item.harkenscythe.livingmetal_ingot.name=Livingmetal Ingot
item.harkenscythe.livingmetal_leggings.name=Livingmetal Leggings
item.harkenscythe.livingmetal_pickaxe.name=Livingmetal Pickaxe
item.harkenscythe.livingmetal_scythe.name=Livingmetal Scythe
item.harkenscythe.livingmetal_shears.name=Livingmetal Shears
item.harkenscythe.livingmetal_shovel.name=Livingmetal Shovel
item.harkenscythe.livingmetal_sword.name=Livingmetal Sword
item.harkenscythe.shadow_book.name=Book of Shadows
Expand All @@ -74,5 +75,6 @@ message.harkenscythe.hs_reap=%s was reaped
tooltip.harkenscythe.altar=Requires a Harken Athame for rituals
tooltip.harkenscythe.athame=A Blunt Harken Blade could develop magical abilities if it comes into contact with blood or souls...
tooltip.harkenscythe.blunt_blade=It could develop magical abilities if it comes into contact with blood or souls...
tooltip.harkenscythe.shears=Effective on any types of cloth, leaves, and web
tooltip.harkenscythe.soul_cake=Gives Regeneration (0:06) when a slice is eaten and will drop itself when no slice is eaten
tooltip.harkenscythe.soul_cookie=Gives Regeneration (0:04) when eaten
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "harkenscythe:items/livingmetal_shears"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"type": "forge:ore_shaped",
"pattern": [
" M",
"M "
],
"key": {
"M": {
"item": "harkenscythe:livingmetal_ingot"
}
},
"result": {
"item": "harkenscythe:livingmetal_shears"
}
}
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 eeeafe0

Please sign in to comment.