Skip to content

Commit

Permalink
Add rose gold armor
Browse files Browse the repository at this point in the history
  • Loading branch information
xYundy committed Apr 14, 2024
1 parent b764737 commit fecc3e6
Show file tree
Hide file tree
Showing 21 changed files with 184 additions and 14 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ yarn_mappings=1.20.1+build.10
loader_version=0.15.9

# Mod Properties
mod_version=0.6.2
mod_version=0.7.0
maven_group=pl.xyundy.squaredadditions
archives_base_name=squaredadditions

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
// 1.20.1 2024-04-05T08:43:00.272929 Squared Additions/Model Definitions
// 1.20.1 2024-04-14T22:08:45.106714 Squared Additions/Model Definitions
3ceb6fe4e90e966a3f55f5738ca042b18f9a0ca1 assets/squaredadditions/models/block/rose_gold_block.json
6f15bf8607ada3d987a355d2f2a351969840e7e1 assets/squaredadditions/models/item/emerald_sword.json
50f29b18486c5745cb73b05014da722f4b03ba4f assets/squaredadditions/models/item/rose_gold_helmet.json
f6d93aff2c2a7ee3e0f25897e8bd9c986ae407d5 assets/squaredadditions/blockstates/rose_gold_block.json
cbae0d76c7081cc2a6373ced0f6186dc4551aa9d assets/squaredadditions/models/item/emerald_axe.json
176ad04c6ba42342adc0e6c5fd107be0e63c65b6 assets/squaredadditions/models/item/emerald_hoe.json
12047fd9df8844630b95d8484150f8da8291f3eb assets/squaredadditions/models/item/rose_gold_hoe.json
1dfb1fd2cf649a277202c40ac31e4976fa410b6c assets/squaredadditions/models/item/rose_gold_leggings.json
7e938224de995d5a7b45865c9a3f8181e1c60371 assets/squaredadditions/models/item/rose_gold_boots.json
5dc59b79a3e713f07045de3613f4ed4b3e29befc assets/squaredadditions/models/item/copper_sword.json
0aa7b4259ef0cf273586e6aa78649b2887b01a87 assets/squaredadditions/models/item/rose_gold_ingot.json
12047fd9df8844630b95d8484150f8da8291f3eb assets/squaredadditions/models/item/rose_gold_hoe.json
c6e40631f77833c121192098a1fe019f0572a914 assets/squaredadditions/models/item/rose_gold_axe.json
853303f1702ea6f952ad21034610a267e3cd5e1b assets/squaredadditions/models/item/rose_gold_sword.json
d78948e974a2e61bfaa7452b3087855095fda779 assets/squaredadditions/models/item/rose_gold_shovel.json
f561fe51b5655850cc8156c04655627423215045 assets/squaredadditions/models/item/rose_gold_chestplate.json
71776dfec5b5f01ce4a9d3b3e000c3bf53bd5bf5 assets/squaredadditions/models/item/copper_shovel.json
39afaac6b756f9390a49ed7cc14c1988f5027523 assets/squaredadditions/models/item/rose_gold_block.json
d12673ccac5079afad74fa93feb5535be7cbcb26 assets/squaredadditions/models/item/emerald_shovel.json
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "squaredadditions:item/rose_gold_boots"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "squaredadditions:item/rose_gold_chestplate"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "squaredadditions:item/rose_gold_helmet"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "squaredadditions:item/rose_gold_leggings"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,11 @@ public void generateItemModels(ItemModelGenerator itemModelGenerator) {
itemModelGenerator.register(ModItems.ROSE_GOLD_HOE, Models.HANDHELD);

itemModelGenerator.register(ModItems.ROSE_GOLD_INGOT, Models.GENERATED);

itemModelGenerator.register(ModItems.ROSE_GOLD_HELMET, Models.GENERATED);
itemModelGenerator.register(ModItems.ROSE_GOLD_CHESTPLATE, Models.GENERATED);
itemModelGenerator.register(ModItems.ROSE_GOLD_LEGGINGS, Models.GENERATED);
itemModelGenerator.register(ModItems.ROSE_GOLD_BOOTS, Models.GENERATED);

}
}
Original file line number Diff line number Diff line change
@@ -1,51 +1,97 @@
package pl.xyundy.squaredadditions.item;

import java.util.EnumMap;
import java.util.function.Supplier;

import net.minecraft.item.ArmorItem;
import net.minecraft.item.ArmorMaterial;
import net.minecraft.item.ArmorMaterials;
import net.minecraft.recipe.Ingredient;
import net.minecraft.sound.SoundEvent;
import net.minecraft.sound.SoundEvents;
import net.minecraft.util.Lazy;
import net.minecraft.util.StringIdentifiable;
import net.minecraft.util.Util;
import pl.xyundy.squaredadditions.SquaredAdditions;

public enum ModArmorMaterial implements ArmorMaterial {
;
ROSE_GOLD("rose_gold", 7, Util.make(new EnumMap(ArmorItem.Type.class), map -> {
map.put(ArmorItem.Type.BOOTS, 2);
map.put(ArmorItem.Type.LEGGINGS, 4);
map.put(ArmorItem.Type.CHESTPLATE, 6);
map.put(ArmorItem.Type.HELMET, 3);
}), 25, SoundEvents.ITEM_ARMOR_EQUIP_GOLD, 0.0f, 0.0f, () -> Ingredient.ofItems(ModItems.ROSE_GOLD_INGOT));

public static final StringIdentifiable.Codec<ArmorMaterials> CODEC;
private static final EnumMap<ArmorItem.Type, Integer> BASE_DURABILITY;
private final String name;
private final int durabilityMultiplier;
private final EnumMap<ArmorItem.Type, Integer> protectionAmounts;
private final int enchantability;
private final SoundEvent equipSound;
private final float toughness;
private final float knockbackResistance;
private final Lazy<Ingredient> repairIngredientSupplier;

private ModArmorMaterial(String name, int durabilityMultiplier, EnumMap<ArmorItem.Type, Integer> protectionAmounts, int enchantability, SoundEvent equipSound, float toughness, float knockbackResistance, Supplier<Ingredient> repairIngredientSupplier) {
this.name = name;
this.durabilityMultiplier = durabilityMultiplier;
this.protectionAmounts = protectionAmounts;
this.enchantability = enchantability;
this.equipSound = equipSound;
this.toughness = toughness;
this.knockbackResistance = knockbackResistance;
this.repairIngredientSupplier = new Lazy<Ingredient>(repairIngredientSupplier);
}

@Override
public int getDurability(ArmorItem.Type type) {
return 0;
return BASE_DURABILITY.get((Object)type) * this.durabilityMultiplier;
}

@Override
public int getProtection(ArmorItem.Type type) {
return 0;
return this.protectionAmounts.get((Object)type);
}

@Override
public int getEnchantability() {
return 0;
return this.enchantability;
}

@Override
public SoundEvent getEquipSound() {
return null;
return this.equipSound;
}

@Override
public Ingredient getRepairIngredient() {
return null;
return this.repairIngredientSupplier.get();
}

@Override
public String getName() {
return "";

return SquaredAdditions.MOD_ID + ":" + this.name;
}

@Override
public float getToughness() {
return 0;
return this.toughness;
}

@Override
public float getKnockbackResistance() {
return 0;
return this.knockbackResistance;
}

static {
CODEC = StringIdentifiable.createCodec(ArmorMaterials::values);
BASE_DURABILITY = Util.make(new EnumMap(ArmorItem.Type.class), map -> {
map.put(ArmorItem.Type.BOOTS, 13);
map.put(ArmorItem.Type.LEGGINGS, 15);
map.put(ArmorItem.Type.CHESTPLATE, 16);
map.put(ArmorItem.Type.HELMET, 11);
});
}
}
14 changes: 14 additions & 0 deletions src/main/java/pl/xyundy/squaredadditions/item/ModItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ public class ModItems {
public static final Item ROSE_GOLD_HOE = registerItem("rose_gold_hoe",
new HoeItem(ModToolMaterial.ROSE_GOLD_INGOT, -1, -3.0F, new FabricItemSettings()));

public static final Item ROSE_GOLD_HELMET = registerItem("rose_gold_helmet",
new ArmorItem(ModArmorMaterial.ROSE_GOLD, ArmorItem.Type.HELMET, new FabricItemSettings()));
public static final Item ROSE_GOLD_CHESTPLATE = registerItem("rose_gold_chestplate",
new ArmorItem(ModArmorMaterial.ROSE_GOLD, ArmorItem.Type.CHESTPLATE, new FabricItemSettings()));
public static final Item ROSE_GOLD_LEGGINGS = registerItem("rose_gold_leggings",
new ArmorItem(ModArmorMaterial.ROSE_GOLD, ArmorItem.Type.LEGGINGS, new FabricItemSettings()));
public static final Item ROSE_GOLD_BOOTS = registerItem("rose_gold_boots",
new ArmorItem(ModArmorMaterial.ROSE_GOLD, ArmorItem.Type.BOOTS, new FabricItemSettings()));

private static Item registerItem(String name, Item item) {
return Registry.register(Registries.ITEM, new Identifier(SquaredAdditions.MOD_ID, name), item);
}
Expand All @@ -61,6 +70,11 @@ public static void itemGroupCombat(FabricItemGroupEntries entries) {

entries.add(ROSE_GOLD_SWORD);
entries.add(ROSE_GOLD_AXE);

entries.add(ROSE_GOLD_HELMET);
entries.add(ROSE_GOLD_CHESTPLATE);
entries.add(ROSE_GOLD_LEGGINGS);
entries.add(ROSE_GOLD_BOOTS);
}
public static void itemGroupTools(FabricItemGroupEntries entries) {
entries.add(COPPER_PICKAXE);
Expand Down
6 changes: 5 additions & 1 deletion src/main/resources/assets/squaredadditions/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,9 @@
"item.squaredadditions.rose_gold_shovel": "Rose Gold Shovel",
"item.squaredadditions.rose_gold_hoe": "Rose Gold Hoe",
"item.squaredadditions.rose_gold_axe": "Rose Gold Axe",
"item.squaredadditions.rose_gold_pickaxe": "Rose Gold Pickaxe"
"item.squaredadditions.rose_gold_pickaxe": "Rose Gold Pickaxe",
"item.squaredadditions.rose_gold_helmet": "Rose Gold Helmet",
"item.squaredadditions.rose_gold_chestplate": "Rose Gold Chestplate",
"item.squaredadditions.rose_gold_leggings": "Rose Gold Leggings",
"item.squaredadditions.rose_gold_boots": "Rose Gold Boots"
}
6 changes: 5 additions & 1 deletion src/main/resources/assets/squaredadditions/lang/pl_pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,9 @@
"item.squaredadditions.rose_gold_shovel": "Różowozłota Łopata",
"item.squaredadditions.rose_gold_hoe": "Różowozłota Motyka",
"item.squaredadditions.rose_gold_axe": "Różowozłota Siekiera",
"item.squaredadditions.rose_gold_pickaxe": "Różowozłoty Kilof"
"item.squaredadditions.rose_gold_pickaxe": "Różowozłoty Kilof",
"item.squaredadditions.rose_gold_helmet": "Różowozłoty Hełm",
"item.squaredadditions.rose_gold_chestplate": "Różowozłoty Napierśnik",
"item.squaredadditions.rose_gold_leggings": "Różowozłote Nogawice",
"item.squaredadditions.rose_gold_boots": "Różowozłote Buty"
}
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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"type": "minecraft:crafting_shaped",
"category": "misc",
"pattern": [
" ",
"# #",
"# #"
],
"key": {
"#": {
"item": "squaredadditions:rose_gold_ingot"
}
},
"result": {
"item": "squaredadditions:rose_gold_boots"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"type": "minecraft:crafting_shaped",
"category": "misc",
"pattern": [
"# #",
"###",
"###"
],
"key": {
"#": {
"item": "squaredadditions:rose_gold_ingot"
}
},
"result": {
"item": "squaredadditions:rose_gold_chestplate"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"type": "minecraft:crafting_shaped",
"category": "misc",
"pattern": [
"###",
"# #",
" "
],
"key": {
"#": {
"item": "squaredadditions:rose_gold_ingot"
}
},
"result": {
"item": "squaredadditions:rose_gold_helmet"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"type": "minecraft:crafting_shaped",
"category": "misc",
"pattern": [
"###",
"# #",
"# #"
],
"key": {
"#": {
"item": "squaredadditions:rose_gold_ingot"
}
},
"result": {
"item": "squaredadditions:rose_gold_leggings"
}
}

0 comments on commit fecc3e6

Please sign in to comment.