Basic armor #80

Closed
yakyakyakyak wants to merge 2 commits from BasicArmor into master
4 changed files with 53 additions and 2 deletions

View File

@@ -9,8 +9,8 @@ org.gradle.jvmargs=-Xmx1G
# Mod Properties # Mod Properties
mod_version = 1.0.0 mod_version = 1.0.0
maven_group = com.example maven_group = com.refsonyak.griegtech.group
archives_base_name = fabric-example-mod archives_base_name = griegtech-mod
# Dependencies # Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api

View File

@@ -0,0 +1,31 @@
package net.fabricmc.example;
import net.fabricmc.config;
public class GlitchedArmorMaterial implements ArmorMaterial {
@Override
public int getDurability(EquipmentSlot slot) {
return config.GlitchedArmor.BASE_DURABILITY[slot.getEntitySlotId()];
}
@Override
public int getProtectionAmount(EquipmentSlot slot) {
return config.GlitchedArmor.PROTECTION_VALUES[slot.getEntitySlotId()];
}
@Override
public int getEnchantability() {
return config.GlitchedArmor.ENCHANTABILITY;
}
@Override
public SoundEvent getEquipSound() {
return SoundEvents.ITEM_ARMOR_EQUIP_LEATHER;
}
@Override
public Ingredient getRepairIngredient() {
return Ingredient.ofItems(RegisterItems.);
}
}

View File

@@ -0,0 +1,7 @@
public class config {
public static class GlitchedArmor {
public static final int[] BASE_DURABILITY = new int[] {17, 19, 20, 15};
public static final int[] PROTECTION_VALUES = new int[] {5, 8, 10, 5};
public static final int ENCHANTABILITY = 50;
}
}

View File

@@ -0,0 +1,13 @@
public class RegisterItems {
public static final ArmorMaterial GlitchArmorMaterial = new CustomArmorMaterial();
public static final Item GLITCH_MATERIAL = new CustomMaterialItem(new Item.Settings().group(GriegTech.GRIEGTECH_GROUP));
// If you made a new material, this is where you would note it.
public static final Item CUSTOM_MATERIAL_HELMET = new ArmorItem(CustomArmorMaterial,
EquipmentSlot.HEAD, new Item.Settings().group(ExampleMod.EXAMPLE_MOD_GROUP));
public static final Item CUSTOM_MATERIAL_CHESTPLATE = new ArmorItem(CustomArmorMaterial,
EquipmentSlot.CHEST, new Item.Settings().group(ExampleMod.EXAMPLE_MOD_GROUP));
public static final Item CUSTOM_MATERIAL_LEGGINGS = new ArmorItem(CustomArmorMaterial,
EquipmentSlot.LEGS, new Item.Settings().group(ExampleMod.EXAMPLE_MOD_GROUP));
public static final Item CUSTOM_MATERIAL_BOOTS = new ArmorItem(CustomArmorMaterial,
EquipmentSlot.FEET, new Item.Settings().group(ExampleMod.EXAMPLE_MOD_GROUP));
}