Advertisement
SforzandoCF

tools or sum

Dec 3rd, 2024 (edited)
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 11.36 KB | None | 0 0
  1. // Fabric 1.21.3
  2. package com.sforzando.sforzandostools;
  3.  
  4. public class SforzandosToolsMod implements ModInitializer {
  5.     public void onInitialize () {
  6.         Items.register();
  7.     }
  8. }
  9.  
  10. package com.sforzando.sforzandostools.item;
  11.  
  12. public class Items {
  13.     public static class_1792 STEEL_INGOT = register("steel_ingot", new class_1792(new class_1793()));
  14.     public static class_1792 INFERNAL_GOLD = register("infernal_gold", new class_1792(new class_1793()));
  15.     public static class_1792 SPIRITED_GOLD = register("spirited_gold", new class_1792(new class_1793()));
  16.     public static class_1792 SPIRIT_DUST = register("spirit_dust", new class_1792(new class_1793()));
  17.     public static class_1792 SPIRIT_CHUNK = register("spirit_chunk", new class_1792(new class_1793()));
  18.     public static class_1792 DESCENDED_UPGRADE_TEMPLATE = register("descended_upgraded_template", createDescendedUpgradeTemplate());
  19.     public static class_1792 INFERNAL_SWORD = register("infernal_sword", new FireSwordItem(ToolTiers.INFERNAL, 3, -2.4F, new class_1793()));
  20.     public static class_1792 INFERNAL_PICKAXE = register("infernal_pickaxe", new FirePickaxeItem(ToolTiers.INFERNAL, 1, -2.8F, new class_1793()));
  21.     public static class_1792 INFERNAL_AXE = register("infernal_axe", new FireAxeItem(ToolTiers.INFERNAL, 6.0F, -3.2F, new class_1793()));
  22.     public static class_1792 INFERNAL_SHOVEL = register("infernal_shovel", new FireShovelItem(ToolTiers.INFERNAL, 1.5F, -3.0F, new class_1793()));
  23.     public static class_1792 INFERNAL_HOE = register("infernal_hoe", new FireHoeItem(ToolTiers.INFERNAL, 0, -3.0F, new class_1793()));
  24.     public static class_1792 COPPER_SWORD = register("copper_sword", new class_1829(ToolTiers.COPPER, 3, -2.4F, new class_1793()));
  25.     public static class_1792 COPPER_PICKAXE = register("copper_pickaxe", new class_1810(ToolTiers.COPPER, 1, -2.8F, new class_1793()));
  26.     public static class_1792 COPPER_AXE = register("copper_axe", new class_1743(ToolTiers.COPPER, 6.0F, -3.2F, new class_1793()));
  27.     public static class_1792 COPPER_SHOVEL = register("copper_shovel", new class_1821(ToolTiers.COPPER, 1.5F, -3.0F, new class_1793()));
  28.     public static class_1792 COPPER_HOE = register("copper_hoe", new class_1794(ToolTiers.COPPER, 0, -3.0F, new class_1793()));
  29.     public static class_1792 EMERALD_SWORD = register("emerald_sword", new class_1829(ToolTiers.EMERALD, 3, -2.4F, new class_1793()));
  30.     public static class_1792 EMERALD_PICKAXE = register("emerald_pickaxe", new class_1810(ToolTiers.EMERALD, 1, -2.8F, new class_1793()));
  31.     public static class_1792 EMERALD_AXE = register("emerald_axe", new class_1743(ToolTiers.EMERALD, 6.0F, -3.2F, new class_1793()));
  32.     public static class_1792 EMERALD_SHOVEL = register("emerald_shovel", new class_1821(ToolTiers.EMERALD, 1.5F, -3.0F, new class_1793()));
  33.     public static class_1792 EMERALD_HOE = register("emerald_hoe", new class_1794(ToolTiers.EMERALD, 0, -3.0F, new class_1793()));
  34.     public static class_1792 DESCENDED_SWORD = register("descended_sword", new class_1829(ToolTiers.DESCENDED, 3, -2.4F, new class_1793()));
  35.     public static class_1792 DESCENDED_PICKAXE = register("descended_pickaxe", new class_1810(ToolTiers.DESCENDED, 1, -2.8F, new class_1793()));
  36.     public static class_1792 DESCENDED_AXE = register("descended_axe", new class_1743(ToolTiers.DESCENDED, 6.0F, -3.2F, new class_1793()));
  37.     public static class_1792 DESCENDED_SHOVEL = register("descended_shovel", new class_1821(ToolTiers.DESCENDED, 1.5F, -3.0F, new class_1793()));
  38.     public static class_1792 DESCENDED_HOE = register("descended_hoe", new class_1794(ToolTiers.DESCENDED, 0, -3.0F, new class_1793()));
  39.     public static class_1792 SPIRIT_BOUND_SWORD = register("spirit_bound_sword", new SpiritBoundSwordItem(ToolTiers.SPIRIT_BOUND, 3, -2.4F, new class_1793()));
  40.     public static class_1792 SPIRIT_BOUND_PICKAXE = register("spirit_bound_pickaxe", new SpiritBoundPickaxeItem(ToolTiers.SPIRIT_BOUND, 1, -2.8F, new class_1793()));
  41.     public static class_1792 SPIRIT_BOUND_AXE = register("spirit_bound_axe", new SpiritBoundAxeItem(ToolTiers.SPIRIT_BOUND, 6.0F, -3.2F, new class_1793()));
  42.     public static class_1792 SPIRIT_BOUND_SHOVEL = register("spirit_bound_shovel", new SpiritBoundShovelItem(ToolTiers.SPIRIT_BOUND, 1.5F, -3.0F, new class_1793()));
  43.     public static class_1792 SPIRIT_BOUND_HOE = register("spirit_bound_hoe", new SpiritBoundHoeItem(ToolTiers.SPIRIT_BOUND, 0, -3.0F, new class_1793()));
  44.     public static class_1792 STEEL_SWORD = register("steel_sword", new class_1829(ToolTiers.STEEL, 3, -2.4F, new class_1793()));
  45.     public static class_1792 STEEL_PICKAXE = register("steel_pickaxe", new class_1810(ToolTiers.STEEL, 1, -2.8F, new class_1793()));
  46.     public static class_1792 STEEL_AXE = register("steel_axe", new class_1743(ToolTiers.STEEL, 6.0F, -3.2F, new class_1793()));
  47.     public static class_1792 STEEL_SHOVEL = register("steel_shovel", new class_1821(ToolTiers.STEEL, 1.5F, -3.0F, new class_1793()));
  48.     public static class_1792 STEEL_HOE = register("steel_hoe", new class_1794(ToolTiers.STEEL, 0, -3.0F, new class_1793()));
  49.     public static class_1792 ABYSSAL_SWORD = register("abyssal_sword", new AbyssalSwordItem(ToolTiers.ABYSSAL, 3, -2.4F, new class_1793()));
  50.     public static class_1792 ABYSSAL_PICKAXE = register("abyssal_pickaxe", new AbyssalPickaxeItem(ToolTiers.ABYSSAL, 1, -2.8F, 0, new class_1793()));
  51.     public static class_1792 ABYSSAL_AXE = register("abyssal_axe", new AbyssalAxeItem(ToolTiers.ABYSSAL, 6.0F, -3.2F, 0, new class_1793()));
  52.     public static class_1792 ABYSSAL_SHOVEL = register("abyssal_shovel", new AbyssalShovelItem(ToolTiers.ABYSSAL, 1.5F, -3.0F, 0, new class_1793()));
  53.     public static class_1792 ABYSSAL_HOE = register("abyssal_hoe", new AbyssalHoeItem(ToolTiers.ABYSSAL, 0, -3.0F, 0, new class_1793()));
  54.    
  55.     public static class_1792 register (String name, class_1792 item) {
  56.         return class_2378.method_10230(class_7923.field_41178, class_2960.method_60655("sforzando's_tools", name), item);
  57.     }
  58.    
  59.     public static final class_2561 DESCENDED_APPLIES_TO = class_2561.method_43471("sforzando's_tools:item.descended_upgrade_template.applies_to");
  60.     public static final class_2561 DESCENDED_INGREDIENTS = class_2561.method_43471("sforzando's_tools:item.descended_upgrade_template.ingredients");
  61.     public static final class_2561 DESCENDED_BASE_DESCRIPTION = class_2561.method_43471("sforzando's_tools:item.descended_upgrade_template.base_description");
  62.     public static final class_2561 DESCENDED_ADDITIONS_DESCRIPTION = class_2561.method_43471("sforzando's_tools:item.descended_upgrade_template.additions_description");
  63.    
  64.     private static class_8052 createDescendedUpgradeTemplate () {
  65.         return new class_8052(DESCENDED_APPLIES_TO, DESCENDED_INGREDIENTS, DESCENDED_BASE_DESCRIPTION, DESCENDED_ADDITIONS_DESCRIPTION, List.<class_2960>of(class_2960.method_60655("sforzando's_tools", "empty_slot_nether_star")), List.<class_2960>of(class_2960.method_60656("empty_slot_sword"), class_2960.method_60656("empty_slot_pickaxe"), class_2960.method_60656("empty_slot_axe"), class_2960.method_60656("empty_slot_shovel"), class_2960.method_60656("empty_slot_hoe")), new class_1793());
  66.     }
  67. }
  68.  
  69. public class SpiritBoundSwordItem extends EffectApplierSwordItem implements PlayerDeathAction {
  70.     public SpiritBoundSwordItem (class_9886 tier, float damage, float speed, class_1793 settings) {
  71.         super (new class_1293(class_1294.field_5920, 100), tier, damage, speed, settings);
  72.         PlayerDeathAction.Registry.add(this);
  73.     }
  74.    
  75.     public void onPlayerDeath (PlayerDeathAction.PlayerState oldPlayer, class_1657 player, int slot) {
  76.         class_1799 stack = oldPlayer.inventory.method_5441(slot);
  77.         player.method_31548().method_7398(stack);
  78.     }
  79. }
  80.  
  81. public class SpiritBoundPickaxeItem extends EffectApplierPickaxeItem implements PlayerDeathAction {
  82.     public SpiritBoundPickaxeItem (class_9886 tier, float damage, float speed, class_1793 settings) {
  83.         super (new class_1293(class_1294.field_5920, 100), tier, damage, speed, settings);
  84.         PlayerDeathAction.Registry.add(this);
  85.     }
  86.    
  87.     public void onPlayerDeath (PlayerDeathAction.PlayerState oldPlayer, class_1657 player, int slot) {
  88.         class_1799 stack = oldPlayer.inventory.method_5441(slot);
  89.         player.method_31548().method_7398(stack);
  90.     }
  91. }
  92.  
  93. public class SpiritBoundAxeItem extends EffectApplierAxeItem implements PlayerDeathAction {
  94.     public SpiritBoundAxeItem (class_9886 tier, float damage, float speed, class_1793 settings) {
  95.         super (new class_1293(class_1294.field_5920, 100), tier, damage, speed, settings);
  96.         PlayerDeathAction.Registry.add(this);
  97.     }
  98.    
  99.     public void onPlayerDeath (PlayerDeathAction.PlayerState oldPlayer, class_1657 player, int slot) {
  100.         class_1799 stack = oldPlayer.inventory.method_5441(slot);
  101.         player.method_31548().method_7398(stack);
  102.     }
  103. }
  104.  
  105. public class SpiritBoundShovelItem extends EffectApplierShovelItem implements PlayerDeathAction {
  106.     public SpiritBoundShovelItem (class_9886 tier, float damage, float speed, class_1793 settings) {
  107.         super (new class_1293(class_1294.field_5920, 100), tier, damage, speed, settings);
  108.         PlayerDeathAction.Registry.add(this);
  109.     }
  110.    
  111.     public void onPlayerDeath (PlayerDeathAction.PlayerState oldPlayer, class_1657 player, int slot) {
  112.         class_1799 stack = oldPlayer.inventory.method_5441(slot);
  113.         player.method_31548().method_7398(stack);
  114.     }
  115. }
  116.  
  117. public class SpiritBoundHoeItem extends EffectApplierHoeItem implements PlayerDeathAction {
  118.     public SpiritBoundHoeItem (class_9886 tier, float damage, float speed, class_1793 settings) {
  119.         super (new class_1293(class_1294.field_5920, 100), tier, damage, speed, settings);
  120.         PlayerDeathAction.Registry.add(this);
  121.     }
  122.    
  123.     public void onPlayerDeath (PlayerDeathAction.PlayerState oldPlayer, class_1657 player, int slot) {
  124.         class_1799 stack = oldPlayer.inventory.method_5441(slot);
  125.         player.method_31548().method_7398(stack);
  126.     }
  127. }
  128.  
  129. public class AbyssalSwordItem extends class_1829 {
  130.     public AbyssalSwordItem (class_9886 tier, float damage, float speed, class_1793 settings) {
  131.         super (tier, damage, speed, settings);
  132.     }
  133.    
  134.     public boolean method_7873 (class_1799 stack, class_1309 target, class_1309 attacker) {
  135.         if (!super.method_7873(stack, target, attacker)) return false;
  136.         if (target.method_5864().method_20210(Items.ABYSSAL_ATTACKS_INEFFECTIVE_ON)) return false;
  137.        
  138.         if (attacker.method_5816() || target.method_5864().method_20210(Items.ABYSSAL_ATTACKS_EFFECTIVE_ON))
  139.             target.method_5643(class_1282.field_5846, 13.0F);
  140.        
  141.         return true;
  142.     }
  143. }
  144.  
  145. public class AbyssalPickaxeItem extends class_1829 {
  146.     public AbyssalPickaxeItem (class_9886 tier, float damage, float speed, class_1793 settings) {
  147.         super (tier, damage, speed, settings);
  148.     }
  149.    
  150.     public boolean method_7873 (class_1799 stack, class_1309 target, class_1309 attacker) {
  151.         if (!super.method_7873(stack, target, attacker)) return false;
  152.         if (target.method_5864().method_20210(Items.ABYSSAL_ATTACKS_INEFFECTIVE_ON)) return false;
  153.        
  154.         if (attacker.method_5816() || target.method_5864().method_20210(Items.ABYSSAL_ATTACKS_EFFECTIVE_ON))
  155.             target.method_5643(class_1282.field_5846, 13.0F);
  156.        
  157.         return true;
  158.     }
  159. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement