diff --git a/gradle.properties b/gradle.properties index 1c8bac2..5fb6867 100644 --- a/gradle.properties +++ b/gradle.properties @@ -26,7 +26,7 @@ mod_name=Age of the Gods # The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default. mod_license=All Rights Reserved # The mod version. See https://semver.org/ -mod_version=0.0.2 +mod_version=0.0.3 # The group ID for the mod. It is only important when publishing as an artifact to a Maven repository. # This should match the base package used for the mod sources. # See https://maven.apache.org/guides/mini/guide-naming-conventions.html diff --git a/src/main/java/net/halbear/aotg/custom/GuiScreens/ForgeWorkbenchGUIScreen.java b/src/main/java/net/halbear/aotg/custom/GuiScreens/ForgeWorkbenchGUIScreen.java index 977f22e..9787960 100644 --- a/src/main/java/net/halbear/aotg/custom/GuiScreens/ForgeWorkbenchGUIScreen.java +++ b/src/main/java/net/halbear/aotg/custom/GuiScreens/ForgeWorkbenchGUIScreen.java @@ -125,6 +125,8 @@ public class ForgeWorkbenchGUIScreen extends AbstractContainerScreen previewList = new ArrayList<>(); previewList.add(new ItemStack(ModItems.XIPHOS_SWORD.asItem())); + previewList.add(new ItemStack(ModItems.KOPIS_SWORD.asItem())); + previewList.add(new ItemStack(ModItems.ELECTRUM_COIN.asItem())); previewList.add(new ItemStack(ModItems.BRONZE_INGOT.asItem())); previewList.add(new ItemStack(ModItems.ORICHALCUM_INGOT.asItem())); previewList.add(new ItemStack(ModItems.ELECTRUM_INGOT.asItem())); diff --git a/src/main/java/net/halbear/aotg/custom/blocks/Forge/ForgeItemRecipe.java b/src/main/java/net/halbear/aotg/custom/blocks/Forge/ForgeItemRecipe.java index 16e9a8a..9f22d0b 100644 --- a/src/main/java/net/halbear/aotg/custom/blocks/Forge/ForgeItemRecipe.java +++ b/src/main/java/net/halbear/aotg/custom/blocks/Forge/ForgeItemRecipe.java @@ -16,6 +16,8 @@ public record ForgeItemRecipe(Item primaryOutcomeItem, Item[] RequiredItems, int public static final Map> ITEM_RECIPE_REVERSE_LOOKUP = new LinkedHashMap<>(); static{ FORGE_ITEM_RECIPE_MAP.put(ModItems.XIPHOS_SWORD.asItem(),new ForgeItemRecipe(ModItems.XIPHOS_SWORD.asItem(),new Item[]{ModItems.BRONZE_INGOT.asItem(), Items.STICK},new int[]{2,1})); + FORGE_ITEM_RECIPE_MAP.put(ModItems.KOPIS_SWORD.asItem(),new ForgeItemRecipe(ModItems.KOPIS_SWORD.asItem(),new Item[]{ModItems.BRONZE_INGOT.asItem(), Items.STICK},new int[]{2,1})); + FORGE_ITEM_RECIPE_MAP.put(ModItems.ELECTRUM_COIN.asItem(),new ForgeItemRecipe(ModItems.ELECTRUM_COIN.asItem(),new Item[]{ModItems.ELECTRUM_INGOT.asItem()},new int[]{1,0})); CompileReverseLookupMap(); } diff --git a/src/main/java/net/halbear/aotg/registries/ModItems.java b/src/main/java/net/halbear/aotg/registries/ModItems.java index 9728e2d..155c4ab 100644 --- a/src/main/java/net/halbear/aotg/registries/ModItems.java +++ b/src/main/java/net/halbear/aotg/registries/ModItems.java @@ -52,18 +52,29 @@ public class ModItems { public static final DeferredItem HARDENED_SLAG = RegisterItem("slag", Item::new); public static final DeferredItem RAW_ZINC = RegisterItem("raw_zinc", Item::new); public static final DeferredItem RAW_SILVER = RegisterItem("raw_silver", Item::new); + public static final DeferredItem ELECTRUM_COIN = RegisterItem("electrum_coin", Item::new); public static final DeferredItem RAW_TIN = RegisterItem("raw_tin", Item::new); public static final DeferredItem XIPHOS_SWORD = RegisterItem("xiphos", properties -> new Item(properties .tool(ModTiers.SWORD_TIER, BlockTags.SWORD_EFFICIENT, - 3.0f, + 4.6f, -2.4f, 1.0f ).durability(1900) ) ); + public static final DeferredItem KOPIS_SWORD = RegisterItem("kopis", + properties -> new Item(properties + .tool(ModTiers.SWORD_TIER, + BlockTags.SWORD_EFFICIENT, + 3.0f, + -1.5f, + 1.0f + ).durability(1800) + ) + ); private static DeferredItem RegisterItem(String Name, Function function){ DeferredItem newBlock = ITEMS.registerItem(Name, function); diff --git a/src/main/java/net/halbear/aotg/registries/ModTabs.java b/src/main/java/net/halbear/aotg/registries/ModTabs.java index 103f132..c83f0c9 100644 --- a/src/main/java/net/halbear/aotg/registries/ModTabs.java +++ b/src/main/java/net/halbear/aotg/registries/ModTabs.java @@ -39,6 +39,7 @@ public class ModTabs { output.accept(LIMESTONE_GRASS_ITEM.get()); output.accept(OLIVE_LEAVES_ITEM.get()); output.accept(OLIVE_LOG_ITEM.get()); + output.accept(OLIVE_PLANKS_ITEM.get()); output.accept(OLIVE_FENCE_GATE_ITEM.get()); output.accept(OLIVE_FENCE_ITEM.get()); output.accept(OLIVE_STAIRS_ITEM.get()); @@ -63,8 +64,9 @@ public class ModTabs { output.accept(ELECTRUM_INGOT.get()); output.accept(HEPATIZON_INGOT.get()); output.accept(ORICHALCUM_INGOT.get()); - output.accept(OLIVE_PLANKS_ITEM.get()); output.accept(HARDENED_SLAG.get()); output.accept(XIPHOS_SWORD.get()); + output.accept(KOPIS_SWORD.get()); + output.accept(ELECTRUM_COIN.get()); }).build()); } diff --git a/src/main/java/net/halbear/aotg/utility/Networking/ForgeWorkbenchGuiButtonHandler.java b/src/main/java/net/halbear/aotg/utility/Networking/ForgeWorkbenchGuiButtonHandler.java index c2f3433..01804eb 100644 --- a/src/main/java/net/halbear/aotg/utility/Networking/ForgeWorkbenchGuiButtonHandler.java +++ b/src/main/java/net/halbear/aotg/utility/Networking/ForgeWorkbenchGuiButtonHandler.java @@ -131,10 +131,13 @@ public record ForgeWorkbenchGuiButtonHandler(int buttonID, String ResultItem, in ItemStack Alloy = CraftResult[1]; ItemStack Slag = CraftResult[2]; ItemStack ResultItem = ItemStack.EMPTY; - if(Alloy.getItem() == item_recipe.RequiredItems()[0] && Alloy.getCount() >= item_recipe.RequiredItemCounts()[0] - && Secondary.getItem() == item_recipe.RequiredItems()[1] && Secondary.getCount() >= item_recipe.RequiredItemCounts()[1]){ + if(item_recipe.RequiredItems().length == 2 && Alloy.getItem() == item_recipe.RequiredItems()[0] && Alloy.getCount() >= item_recipe.RequiredItemCounts()[0] + && Secondary.getItem() == item_recipe.RequiredItems()[1] && Secondary.getCount() >= item_recipe.RequiredItemCounts()[1] || + item_recipe.RequiredItems().length == 1 && Alloy.getItem() == item_recipe.RequiredItems()[0] && Alloy.getCount() >= item_recipe.RequiredItemCounts()[0]){ Alloy.setCount(Alloy.getCount() - item_recipe.RequiredItemCounts()[0]); - Secondary.setCount(Secondary.getCount() - item_recipe.RequiredItemCounts()[1]); + if(item_recipe.RequiredItems().length == 2) { + Secondary.setCount(Secondary.getCount() - item_recipe.RequiredItemCounts()[1]); + } ResultItem = new ItemStack(item_recipe.primaryOutcomeItem(), 1); } forgeWorkbenchBlockEntity.setItem(2,ResultItem); diff --git a/src/main/resources/assets/ageofthegods/Items/electrum_coin.json b/src/main/resources/assets/ageofthegods/Items/electrum_coin.json new file mode 100644 index 0000000..e06c8de --- /dev/null +++ b/src/main/resources/assets/ageofthegods/Items/electrum_coin.json @@ -0,0 +1,6 @@ +{ + "model": { + "type": "minecraft:model", + "model": "ageofthegods:item/electrum_coin" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ageofthegods/Items/kopis.json b/src/main/resources/assets/ageofthegods/Items/kopis.json new file mode 100644 index 0000000..fef4dd3 --- /dev/null +++ b/src/main/resources/assets/ageofthegods/Items/kopis.json @@ -0,0 +1,6 @@ +{ + "model": { + "type": "minecraft:model", + "model": "ageofthegods:item/kopis/kopis_sword" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ageofthegods/lang/en_us.json b/src/main/resources/assets/ageofthegods/lang/en_us.json index 93b23ca..3baabcf 100644 --- a/src/main/resources/assets/ageofthegods/lang/en_us.json +++ b/src/main/resources/assets/ageofthegods/lang/en_us.json @@ -27,6 +27,7 @@ "gui.ageofthegods.forge_workbench.title": "Forge", "item.ageofthegods.xiphos": "Xiphos", + "item.ageofthegods.kopis": "Kopis", "item.ageofthegods.zinc_ingot": "Zinc Ingot", "item.ageofthegods.raw_zinc": "Raw Zinc", "item.ageofthegods.raw_tin": "Raw Tin", @@ -35,6 +36,7 @@ "item.ageofthegods.silver_ingot": "Silver Ingot", "item.ageofthegods.bronze_ingot": "Bronze Ingot", "item.ageofthegods.electrum_ingot": "Electrum Ingot", + "item.ageofthegods.electrum_coin": "Electrum Coin", "item.ageofthegods.hepatizon_ingot": "Hepatizon Ingot", "item.ageofthegods.orichalcum_ingot": "Orichalcum Ingot", "item.ageofthegods.fluid_indicator_debug_item": "Molten Alloy Mixture: ", diff --git a/src/main/resources/assets/ageofthegods/models/item/electrum_coin.json b/src/main/resources/assets/ageofthegods/models/item/electrum_coin.json new file mode 100644 index 0000000..20bb82a --- /dev/null +++ b/src/main/resources/assets/ageofthegods/models/item/electrum_coin.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "ageofthegods:item/electrum_coin" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ageofthegods/models/item/kopis/kopis_sword.json b/src/main/resources/assets/ageofthegods/models/item/kopis/kopis_sword.json new file mode 100644 index 0000000..d81b69e --- /dev/null +++ b/src/main/resources/assets/ageofthegods/models/item/kopis/kopis_sword.json @@ -0,0 +1,130 @@ +{ + "format_version": "1.21.11", + "credit": "Made with Blockbench", + "texture_size": [64, 64], + "textures": { + "0": "ageofthegods:item/kopis_sword", + "particle": "ageofthegods:item/kopis_sword" + }, + "elements": [ + { + "from": [5.5, -4, 7.5], + "to": [10.5, 5, 8.5], + "rotation": {"angle": 0, "axis": "y", "origin": [7.5, 0, 6.5]}, + "faces": { + "north": {"uv": [5, 0, 6.25, 2.25], "texture": "#0"}, + "east": {"uv": [6.5, 4.5, 6.75, 6.75], "texture": "#0"}, + "south": {"uv": [5, 2.5, 6.25, 4.75], "texture": "#0"}, + "west": {"uv": [7, 4.5, 7.25, 6.75], "texture": "#0"}, + "up": {"uv": [2.75, 7.5, 1.5, 7.25], "texture": "#0"}, + "down": {"uv": [4.25, 7.25, 3, 7.5], "texture": "#0"} + } + }, + { + "from": [5.5, -4, 8.5], + "to": [10.5, 5, 7.5], + "rotation": {"angle": 0, "axis": "y", "origin": [7.5, 0, 7.5]}, + "faces": { + "north": {"uv": [5, 0, 6.25, 2.25], "texture": "#0"}, + "east": {"uv": [6.5, 4.5, 6.75, 6.75], "texture": "#0"}, + "south": {"uv": [5, 2.5, 6.25, 4.75], "texture": "#0"}, + "west": {"uv": [7, 4.5, 7.25, 6.75], "texture": "#0"}, + "up": {"uv": [2.75, 7.5, 1.5, 7.25], "texture": "#0"}, + "down": {"uv": [4.25, 7.25, 3, 7.5], "texture": "#0"} + } + }, + { + "from": [5.4, -4.1, 7.4], + "to": [10.6, 5.1, 8.6], + "rotation": {"angle": 0, "axis": "y", "origin": [7.5, 0, 6.5]}, + "faces": { + "north": {"uv": [5, 5, 6.25, 7.25], "texture": "#0"}, + "east": {"uv": [6.5, 7, 6.75, 9.25], "texture": "#0"}, + "south": {"uv": [0, 6.5, 1.25, 8.75], "texture": "#0"}, + "west": {"uv": [7, 7, 7.25, 9.25], "texture": "#0"}, + "up": {"uv": [5.75, 7.75, 4.5, 7.5], "texture": "#0"}, + "down": {"uv": [8.75, 4.5, 7.5, 4.75], "texture": "#0"} + } + }, + { + "from": [4.5, 6, 8], + "to": [13.5, 31, 8], + "rotation": {"angle": 0, "axis": "y", "origin": [6.5, 6, 7]}, + "faces": { + "north": {"uv": [4.75, 0, 2.5, 6.25], "texture": "#0"}, + "east": {"uv": [6, 7.5, 6, 13.75], "texture": "#0"}, + "south": {"uv": [2.5, 0, 4.75, 6.25], "texture": "#0"}, + "west": {"uv": [6.25, 7.5, 6.25, 13.75], "texture": "#0"}, + "up": {"uv": [3.75, 7.75, 1.5, 7.75], "texture": "#0"}, + "down": {"uv": [3.75, 8, 1.5, 8], "texture": "#0"} + } + }, + { + "from": [5, 5, 7.25], + "to": [11, 7, 8.75], + "rotation": {"angle": 0, "axis": "y", "origin": [7, 5, 7]}, + "faces": { + "north": {"uv": [6.5, 0, 8, 0.5], "texture": "#0"}, + "east": {"uv": [7.5, 5, 8, 5.5], "texture": "#0"}, + "south": {"uv": [6.5, 0.75, 8, 1.25], "texture": "#0"}, + "west": {"uv": [7.5, 5.75, 8, 6.25], "texture": "#0"}, + "up": {"uv": [3, 7, 1.5, 6.5], "texture": "#0"}, + "down": {"uv": [8, 1.5, 6.5, 2], "texture": "#0"} + } + }, + { + "from": [4.75, 4.75, 7], + "to": [11.25, 7.25, 9], + "rotation": {"angle": 0, "axis": "y", "origin": [7, 5, 7]}, + "faces": { + "north": {"uv": [6.5, 2.25, 8, 2.75], "texture": "#0"}, + "east": {"uv": [7.5, 6.5, 8, 7], "texture": "#0"}, + "south": {"uv": [6.5, 3, 8, 3.5], "texture": "#0"}, + "west": {"uv": [7.5, 7.25, 8, 7.75], "texture": "#0"}, + "up": {"uv": [4.75, 7, 3.25, 6.5], "texture": "#0"}, + "down": {"uv": [8, 3.75, 6.5, 4.25], "texture": "#0"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [0, 90, 0], + "translation": [0, 4.5, 0.75] + }, + "thirdperson_lefthand": { + "rotation": [0, -90, 0], + "translation": [0, 4.25, 1.75] + }, + "firstperson_righthand": { + "rotation": [0, 90, 22], + "translation": [0, 3, 0], + "scale": [0.5, 0.5, 0.5] + }, + "firstperson_lefthand": { + "rotation": [0, -90, -22], + "translation": [0, 3.5, 0], + "scale": [0.5, 0.5, 0.5] + }, + "ground": { + "scale": [0.25, 0.25, 0.25] + }, + "gui": { + "rotation": [0, 0, -45], + "translation": [-2.5, -2.5, 0], + "scale": [0.6, 0.6, 0.6] + }, + "head": { + "rotation": [-90, 0, 0], + "translation": [0, 7, 0] + }, + "fixed": { + "rotation": [0, 0, 45], + "translation": [2.75, -2.75, 0], + "scale": [0.7, 0.7, 0.7] + }, + "on_shelf": { + "rotation": [0, 0, -180], + "scale": [0.85, 0.85, 0.85] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ageofthegods/textures/item/electrum_coin.png b/src/main/resources/assets/ageofthegods/textures/item/electrum_coin.png new file mode 100644 index 0000000..ca8be88 Binary files /dev/null and b/src/main/resources/assets/ageofthegods/textures/item/electrum_coin.png differ diff --git a/src/main/resources/assets/ageofthegods/textures/item/kopis_sword.png b/src/main/resources/assets/ageofthegods/textures/item/kopis_sword.png new file mode 100644 index 0000000..b53d6ab Binary files /dev/null and b/src/main/resources/assets/ageofthegods/textures/item/kopis_sword.png differ diff --git a/src/main/resources/data/ageofthegods/recipe/electrum_coin.json b/src/main/resources/data/ageofthegods/recipe/electrum_coin.json new file mode 100644 index 0000000..7a6d228 --- /dev/null +++ b/src/main/resources/data/ageofthegods/recipe/electrum_coin.json @@ -0,0 +1,11 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "equipment", + "ingredients": [ + "ageofthegods:electrum_ingot" + ], + "result": { + "id": "ageofthegods:electrum_coin", + "count": 1 + } +} \ No newline at end of file