1
0
mirror of https://github.com/TechnoVisionDev/Forge-Modding-Tutorial-1.16 synced 2024-10-27 20:34:04 +00:00

Move some code around

This commit is contained in:
TechnoVisionDev 2020-07-09 13:57:08 -07:00
parent 0b67d50874
commit 04d8ae1a7b
2 changed files with 16 additions and 11 deletions

View File

@ -19,18 +19,18 @@ public enum ModArmorMaterial implements IArmorMaterial {
private static final int[] MAX_DAMAGE_ARRAY = new int[] { 11, 16, 15, 13 }; private static final int[] MAX_DAMAGE_ARRAY = new int[] { 11, 16, 15, 13 };
private final String name; private final String name;
private final int maxDamageFactor; //Durability - Iron=15, Diamond=33, Gold=7, Leather=5 private final int maxDamageFactor;
private final int[] damageReductionAmountArray; //Armor Bar Protection, 1 = 1/2 armor bar private final int[] damageReductionAmountArray;
private final int enchantability; private final int enchantability;
private final SoundEvent soundEvent; private final SoundEvent soundEvent;
private final float toughness; //Increases Protection - 0.0F = Disabled private final float toughness;
private final Supplier<Ingredient> repairMaterial; private final Supplier<Ingredient> repairMaterial;
ModArmorMaterial(String name, int maxDamageFactor, int[] damageReductionAmount, int enchantability, ModArmorMaterial(String name, int maxDamageFactor, int[] damageReductionAmountArray, int enchantability,
SoundEvent soundEvent, float toughness, Supplier<Ingredient> repairMaterial) { SoundEvent soundEvent, float toughness, Supplier<Ingredient> repairMaterial) {
this.name = name; this.name = name;
this.maxDamageFactor = maxDamageFactor; this.maxDamageFactor = maxDamageFactor;
this.damageReductionAmountArray = damageReductionAmount; this.damageReductionAmountArray = damageReductionAmountArray;
this.enchantability = enchantability; this.enchantability = enchantability;
this.soundEvent = soundEvent; this.soundEvent = soundEvent;
this.toughness = toughness; this.toughness = toughness;

View File

@ -28,11 +28,16 @@ public class RegistryHandler {
public static final RegistryObject<Item> RUBY = ITEMS.register("ruby", ItemBase::new); public static final RegistryObject<Item> RUBY = ITEMS.register("ruby", ItemBase::new);
// Tools // Tools
public static final RegistryObject<SwordItem> RUBY_SWORD = ITEMS.register("ruby_sword", () -> new SwordItem(ModItemTier.RUBY, 2, -2.4F, new Item.Properties().group(Tutorial.TAB))); public static final RegistryObject<SwordItem> RUBY_SWORD = ITEMS.register("ruby_sword", () ->
public static final RegistryObject<PickaxeItem> RUBY_PICKAXE = ITEMS.register("ruby_pickaxe", () -> new PickaxeItem(ModItemTier.RUBY, 0, -2.8F, new Item.Properties().group(Tutorial.TAB))); new SwordItem(ModItemTier.RUBY, 2, -2.4F, new Item.Properties().group(Tutorial.TAB)));
public static final RegistryObject<ShovelItem> RUBY_SHOVEL = ITEMS.register("ruby_shovel", () -> new ShovelItem(ModItemTier.RUBY, 0.5F, -3.0F, new Item.Properties().group(Tutorial.TAB))); public static final RegistryObject<PickaxeItem> RUBY_PICKAXE = ITEMS.register("ruby_pickaxe", () ->
public static final RegistryObject<AxeItem> RUBY_AXE = ITEMS.register("ruby_axe", () -> new AxeItem(ModItemTier.RUBY, 5, -3.1F, new Item.Properties().group(Tutorial.TAB))); new PickaxeItem(ModItemTier.RUBY, 0, -2.8F, new Item.Properties().group(Tutorial.TAB)));
public static final RegistryObject<HoeItem> RUBY_HOE = ITEMS.register("ruby_hoe", () -> new HoeItem(ModItemTier.RUBY,-1.0F, new Item.Properties().group(Tutorial.TAB))); public static final RegistryObject<ShovelItem> RUBY_SHOVEL = ITEMS.register("ruby_shovel", () ->
new ShovelItem(ModItemTier.RUBY, 0.5F, -3.0F, new Item.Properties().group(Tutorial.TAB)));
public static final RegistryObject<AxeItem> RUBY_AXE = ITEMS.register("ruby_axe", () ->
new AxeItem(ModItemTier.RUBY, 5, -3.1F, new Item.Properties().group(Tutorial.TAB)));
public static final RegistryObject<HoeItem> RUBY_HOE = ITEMS.register("ruby_hoe", () ->
new HoeItem(ModItemTier.RUBY,-1.0F, new Item.Properties().group(Tutorial.TAB)));
// Armor // Armor
public static final RegistryObject<ArmorItem> RUBY_HELMET = ITEMS.register("ruby_helmet", () -> public static final RegistryObject<ArmorItem> RUBY_HELMET = ITEMS.register("ruby_helmet", () ->