diff --git a/gradle.properties b/gradle.properties index 4f48cd6..c7fdf1f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,8 +10,8 @@ org.gradle.parallel=true # Mod Properties mod_version = 1.0.0 - maven_group = com.example - archives_base_name = fabric-example-mod + maven_group = me.daviddgtnt + archives_base_name = stringtools # Dependencies fabric_version=0.68.1+1.19.3 diff --git a/src/main/java/me/daviddgtnt/stringtools/CustomAxeItem.java b/src/main/java/me/daviddgtnt/stringtools/CustomAxeItem.java new file mode 100644 index 0000000..40ba420 --- /dev/null +++ b/src/main/java/me/daviddgtnt/stringtools/CustomAxeItem.java @@ -0,0 +1,10 @@ +package me.daviddgtnt.stringtools; + +import net.minecraft.item.AxeItem; +import net.minecraft.item.ToolMaterial; + +public class CustomAxeItem extends AxeItem { + public CustomAxeItem(ToolMaterial material, float attackDamage, float attackSpeed, Settings settings) { + super(material, attackDamage, attackSpeed, settings); + } +} diff --git a/src/main/java/me/daviddgtnt/stringtools/CustomHoeItem.java b/src/main/java/me/daviddgtnt/stringtools/CustomHoeItem.java new file mode 100644 index 0000000..63a34d8 --- /dev/null +++ b/src/main/java/me/daviddgtnt/stringtools/CustomHoeItem.java @@ -0,0 +1,10 @@ +package me.daviddgtnt.stringtools; + +import net.minecraft.item.HoeItem; +import net.minecraft.item.ToolMaterial; + +public class CustomHoeItem extends HoeItem { + public CustomHoeItem(ToolMaterial material, int attackDamage, float attackSpeed, Settings settings) { + super(material, attackDamage, attackSpeed, settings); + } +} diff --git a/src/main/java/me/daviddgtnt/stringtools/CustomPickaxeItem.java b/src/main/java/me/daviddgtnt/stringtools/CustomPickaxeItem.java new file mode 100644 index 0000000..80c5af3 --- /dev/null +++ b/src/main/java/me/daviddgtnt/stringtools/CustomPickaxeItem.java @@ -0,0 +1,10 @@ +package me.daviddgtnt.stringtools; + +import net.minecraft.item.PickaxeItem; +import net.minecraft.item.ToolMaterial; + +public class CustomPickaxeItem extends PickaxeItem { + public CustomPickaxeItem(ToolMaterial material, int attackDamage, float attackSpeed, Settings settings) { + super(material, attackDamage, attackSpeed, settings); + } +} diff --git a/src/main/java/me/daviddgtnt/stringtools/Main.java b/src/main/java/me/daviddgtnt/stringtools/Main.java new file mode 100644 index 0000000..031bc86 --- /dev/null +++ b/src/main/java/me/daviddgtnt/stringtools/Main.java @@ -0,0 +1,49 @@ +package me.daviddgtnt.stringtools; + +import net.fabricmc.api.ModInitializer; +import net.fabricmc.fabric.api.item.v1.FabricItemSettings; +import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents; +import net.minecraft.item.Item; +import net.minecraft.item.ItemGroups; +import net.minecraft.item.Items; +import net.minecraft.item.ShovelItem; +import net.minecraft.item.SwordItem; +import net.minecraft.item.ToolItem; +import net.minecraft.registry.Registries; +import net.minecraft.registry.Registry; +import net.minecraft.util.Identifier; + +public class Main implements ModInitializer { + public static final Item STRING_STICK = new Item(new FabricItemSettings()); + public static final ToolItem STRING_SWORD = new SwordItem(StringToolMaterial.INSTANCE, 4, 1.6F, new Item.Settings()); + public static final ToolItem STRING_PICKAXE = new CustomPickaxeItem(StringToolMaterial.INSTANCE, 2, 2.4F, new Item.Settings()); + public static final ToolItem STRING_AXE = new CustomAxeItem(StringToolMaterial.INSTANCE, 7.0F, 0.8F, new Item.Settings()); + public static final ToolItem STRING_SHOVEL = new ShovelItem(StringToolMaterial.INSTANCE, 2.5F, 1F, new Item.Settings()); + public static final ToolItem STRING_HOE = new CustomHoeItem(StringToolMaterial.INSTANCE, 1, 1.0F, new Item.Settings()); + + @Override + public void onInitialize() { + Registry.register(Registries.ITEM, new Identifier("stringtools", "string_stick"), STRING_STICK); + Registry.register(Registries.ITEM, new Identifier("stringtools", "string_sword"), STRING_SWORD); + Registry.register(Registries.ITEM, new Identifier("stringtools", "string_pickaxe"), STRING_PICKAXE); + Registry.register(Registries.ITEM, new Identifier("stringtools", "string_axe"), STRING_AXE); + Registry.register(Registries.ITEM, new Identifier("stringtools", "string_shovel"), STRING_SHOVEL); + Registry.register(Registries.ITEM, new Identifier("stringtools", "string_hoe"), STRING_HOE); + + ItemGroupEvents.modifyEntriesEvent(ItemGroups.INGREDIENTS).register(content -> { + content.addBefore(Items.STICK, STRING_STICK); + }); + + ItemGroupEvents.modifyEntriesEvent(ItemGroups.TOOLS).register(content -> { + content.addBefore(Items.WOODEN_SHOVEL, STRING_HOE); + content.addBefore(STRING_HOE, STRING_AXE); + content.addBefore(STRING_AXE, STRING_PICKAXE); + content.addBefore(STRING_PICKAXE, STRING_SHOVEL); + }); + + ItemGroupEvents.modifyEntriesEvent(ItemGroups.COMBAT).register(content -> { + content.addBefore(Items.WOODEN_SWORD, STRING_SWORD); + content.addBefore(Items.WOODEN_AXE, STRING_AXE); + }); + } +} diff --git a/src/main/java/me/daviddgtnt/stringtools/StringToolMaterial.java b/src/main/java/me/daviddgtnt/stringtools/StringToolMaterial.java new file mode 100644 index 0000000..9b80497 --- /dev/null +++ b/src/main/java/me/daviddgtnt/stringtools/StringToolMaterial.java @@ -0,0 +1,41 @@ +package me.daviddgtnt.stringtools; + +import net.minecraft.item.Items; +import net.minecraft.item.ToolMaterial; +import net.minecraft.recipe.Ingredient; + +public class StringToolMaterial implements ToolMaterial { + public static final StringToolMaterial INSTANCE = new StringToolMaterial(); + + @Override + public int getDurability() { + return 1; + } + + @Override + public float getMiningSpeedMultiplier() { + return 2.0F; + } + + @Override + public float getAttackDamage() { + return 0.0F; + } + + @Override + public int getMiningLevel() { + return 0; + } + + @Override + public int getEnchantability() { + return 15; + } + + @Override + public Ingredient getRepairIngredient() { + return Ingredient.ofItems(Items.STRING); + } + + +} diff --git a/src/main/java/net/fabricmc/example/ExampleMod.java b/src/main/java/net/fabricmc/example/ExampleMod.java deleted file mode 100644 index a964189..0000000 --- a/src/main/java/net/fabricmc/example/ExampleMod.java +++ /dev/null @@ -1,21 +0,0 @@ -package net.fabricmc.example; - -import net.fabricmc.api.ModInitializer; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class ExampleMod implements ModInitializer { - // This logger is used to write text to the console and the log file. - // It is considered best practice to use your mod id as the logger's name. - // That way, it's clear which mod wrote info, warnings, and errors. - public static final Logger LOGGER = LoggerFactory.getLogger("modid"); - - @Override - public void onInitialize() { - // This code runs as soon as Minecraft is in a mod-load-ready state. - // However, some things (like resources) may still be uninitialized. - // Proceed with mild caution. - - LOGGER.info("Hello Fabric world!"); - } -} diff --git a/src/main/java/net/fabricmc/example/mixin/ExampleMixin.java b/src/main/java/net/fabricmc/example/mixin/ExampleMixin.java deleted file mode 100644 index 356cb38..0000000 --- a/src/main/java/net/fabricmc/example/mixin/ExampleMixin.java +++ /dev/null @@ -1,16 +0,0 @@ -package net.fabricmc.example.mixin; - -import net.fabricmc.example.ExampleMod; -import net.minecraft.client.gui.screen.TitleScreen; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -@Mixin(TitleScreen.class) -public class ExampleMixin { - @Inject(at = @At("HEAD"), method = "init()V") - private void init(CallbackInfo info) { - ExampleMod.LOGGER.info("This line is printed by an example mod mixin!"); - } -} diff --git a/src/main/resources/assets/modid/icon.png b/src/main/resources/assets/stringtools/icon.png similarity index 100% rename from src/main/resources/assets/modid/icon.png rename to src/main/resources/assets/stringtools/icon.png diff --git a/src/main/resources/assets/stringtools/lang/en_us.json b/src/main/resources/assets/stringtools/lang/en_us.json new file mode 100644 index 0000000..6b29b35 --- /dev/null +++ b/src/main/resources/assets/stringtools/lang/en_us.json @@ -0,0 +1,8 @@ +{ + "item.stringtools.string_sword": "String Sword", + "item.stringtools.string_pickaxe": "String Pickaxe", + "item.stringtools.string_axe": "String Axe", + "item.stringtools.string_shovel": "String Shovel", + "item.stringtools.string_hoe": "String Hoe", + "item.stringtools.string_stick": "Stick of String" +} \ No newline at end of file diff --git a/src/main/resources/assets/stringtools/models/item/string_axe.json b/src/main/resources/assets/stringtools/models/item/string_axe.json new file mode 100644 index 0000000..1e74849 --- /dev/null +++ b/src/main/resources/assets/stringtools/models/item/string_axe.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "stringtools:item/string_axe" + } +} diff --git a/src/main/resources/assets/stringtools/models/item/string_hoe.json b/src/main/resources/assets/stringtools/models/item/string_hoe.json new file mode 100644 index 0000000..e572942 --- /dev/null +++ b/src/main/resources/assets/stringtools/models/item/string_hoe.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "stringtools:item/string_hoe" + } +} diff --git a/src/main/resources/assets/stringtools/models/item/string_pickaxe.json b/src/main/resources/assets/stringtools/models/item/string_pickaxe.json new file mode 100644 index 0000000..e21f4f1 --- /dev/null +++ b/src/main/resources/assets/stringtools/models/item/string_pickaxe.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "stringtools:item/string_pickaxe" + } +} diff --git a/src/main/resources/assets/stringtools/models/item/string_shovel.json b/src/main/resources/assets/stringtools/models/item/string_shovel.json new file mode 100644 index 0000000..d04f00c --- /dev/null +++ b/src/main/resources/assets/stringtools/models/item/string_shovel.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "stringtools:item/string_shovel" + } +} diff --git a/src/main/resources/assets/stringtools/models/item/string_stick.json b/src/main/resources/assets/stringtools/models/item/string_stick.json new file mode 100644 index 0000000..6a816d8 --- /dev/null +++ b/src/main/resources/assets/stringtools/models/item/string_stick.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "stringtools:item/string_stick" + } +} diff --git a/src/main/resources/assets/stringtools/models/item/string_sword.json b/src/main/resources/assets/stringtools/models/item/string_sword.json new file mode 100644 index 0000000..c55337d --- /dev/null +++ b/src/main/resources/assets/stringtools/models/item/string_sword.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "stringtools:item/string_sword" + } +} diff --git a/src/main/resources/assets/stringtools/textures/item/string_axe.png b/src/main/resources/assets/stringtools/textures/item/string_axe.png new file mode 100644 index 0000000..75bf37d Binary files /dev/null and b/src/main/resources/assets/stringtools/textures/item/string_axe.png differ diff --git a/src/main/resources/assets/stringtools/textures/item/string_hoe.png b/src/main/resources/assets/stringtools/textures/item/string_hoe.png new file mode 100644 index 0000000..9df1f73 Binary files /dev/null and b/src/main/resources/assets/stringtools/textures/item/string_hoe.png differ diff --git a/src/main/resources/assets/stringtools/textures/item/string_pickaxe.png b/src/main/resources/assets/stringtools/textures/item/string_pickaxe.png new file mode 100644 index 0000000..29385d1 Binary files /dev/null and b/src/main/resources/assets/stringtools/textures/item/string_pickaxe.png differ diff --git a/src/main/resources/assets/stringtools/textures/item/string_shovel.png b/src/main/resources/assets/stringtools/textures/item/string_shovel.png new file mode 100644 index 0000000..51e365a Binary files /dev/null and b/src/main/resources/assets/stringtools/textures/item/string_shovel.png differ diff --git a/src/main/resources/assets/stringtools/textures/item/string_stick.png b/src/main/resources/assets/stringtools/textures/item/string_stick.png new file mode 100644 index 0000000..6c1966a Binary files /dev/null and b/src/main/resources/assets/stringtools/textures/item/string_stick.png differ diff --git a/src/main/resources/assets/stringtools/textures/item/string_sword.png b/src/main/resources/assets/stringtools/textures/item/string_sword.png new file mode 100644 index 0000000..acd698f Binary files /dev/null and b/src/main/resources/assets/stringtools/textures/item/string_sword.png differ diff --git a/src/main/resources/data/stringtools/recipes/string_axe.json b/src/main/resources/data/stringtools/recipes/string_axe.json new file mode 100644 index 0000000..b57c1d5 --- /dev/null +++ b/src/main/resources/data/stringtools/recipes/string_axe.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "SS", + "TS", + "T " + ], + "key": { + "S": { + "item": "minecraft:string" + }, + "T": { + "item": "stringtools:string_stick" + } + }, + "result": { + "item": "stringtools:string_axe" + } +} \ No newline at end of file diff --git a/src/main/resources/data/stringtools/recipes/string_axe_reverse.json b/src/main/resources/data/stringtools/recipes/string_axe_reverse.json new file mode 100644 index 0000000..8cb4a0a --- /dev/null +++ b/src/main/resources/data/stringtools/recipes/string_axe_reverse.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "SS", + "ST", + " T" + ], + "key": { + "S": { + "item": "minecraft:string" + }, + "T": { + "item": "stringtools:string_stick" + } + }, + "result": { + "item": "stringtools:string_axe" + } +} \ No newline at end of file diff --git a/src/main/resources/data/stringtools/recipes/string_hoe.json b/src/main/resources/data/stringtools/recipes/string_hoe.json new file mode 100644 index 0000000..6424521 --- /dev/null +++ b/src/main/resources/data/stringtools/recipes/string_hoe.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "SS", + " T", + " T" + ], + "key": { + "S": { + "item": "minecraft:string" + }, + "T": { + "item": "stringtools:string_stick" + } + }, + "result": { + "item": "stringtools:string_hoe" + } +} \ No newline at end of file diff --git a/src/main/resources/data/stringtools/recipes/string_hoe_reversed.json b/src/main/resources/data/stringtools/recipes/string_hoe_reversed.json new file mode 100644 index 0000000..2c978d4 --- /dev/null +++ b/src/main/resources/data/stringtools/recipes/string_hoe_reversed.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "SS", + "T ", + "T " + ], + "key": { + "S": { + "item": "minecraft:string" + }, + "T": { + "item": "stringtools:string_stick" + } + }, + "result": { + "item": "stringtools:string_hoe" + } +} \ No newline at end of file diff --git a/src/main/resources/data/stringtools/recipes/string_pickaxe.json b/src/main/resources/data/stringtools/recipes/string_pickaxe.json new file mode 100644 index 0000000..435603d --- /dev/null +++ b/src/main/resources/data/stringtools/recipes/string_pickaxe.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "SSS", + " T ", + " T " + ], + "key": { + "S": { + "item": "minecraft:string" + }, + "T": { + "item": "stringtools:string_stick" + } + }, + "result": { + "item": "stringtools:string_pickaxe" + } +} \ No newline at end of file diff --git a/src/main/resources/data/stringtools/recipes/string_shovel.json b/src/main/resources/data/stringtools/recipes/string_shovel.json new file mode 100644 index 0000000..e2c323b --- /dev/null +++ b/src/main/resources/data/stringtools/recipes/string_shovel.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "S", + "T", + "T" + ], + "key": { + "S": { + "item": "minecraft:string" + }, + "T": { + "item": "stringtools:string_stick" + } + }, + "result": { + "item": "stringtools:string_shovel" + } +} \ No newline at end of file diff --git a/src/main/resources/data/stringtools/recipes/string_stick.json b/src/main/resources/data/stringtools/recipes/string_stick.json new file mode 100644 index 0000000..f22730f --- /dev/null +++ b/src/main/resources/data/stringtools/recipes/string_stick.json @@ -0,0 +1,16 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "S", + "S" + ], + "key": { + "S": { + "item": "minecraft:string" + } + }, + "result": { + "item": "stringtools:string_stick", + "count": 4 + } +} \ No newline at end of file diff --git a/src/main/resources/data/stringtools/recipes/string_sword.json b/src/main/resources/data/stringtools/recipes/string_sword.json new file mode 100644 index 0000000..2a0290d --- /dev/null +++ b/src/main/resources/data/stringtools/recipes/string_sword.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "S", + "S", + "T" + ], + "key": { + "S": { + "item": "minecraft:string" + }, + "T": { + "item": "stringtools:string_stick" + } + }, + "result": { + "item": "stringtools:string_sword" + } +} \ No newline at end of file diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 2ca73ad..a3b13ba 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -1,38 +1,32 @@ { "schemaVersion": 1, - "id": "modid", - "version": "${version}", + "id": "stringtools", + "version": "1.0.0", - "name": "Example Mod", - "description": "This is an example description! Tell everyone what your mod is about!", + "name": "String Tools", + "description": "Single use tools made out of string!", "authors": [ - "Me!" + "DavidDGTNT" ], "contact": { - "homepage": "https://fabricmc.net/", - "sources": "https://github.com/FabricMC/fabric-example-mod" + "homepage": "https://daviddgtnt.github.io/", + "sources": "https://github.com/daviddgtnt/stringtools" }, - "license": "CC0-1.0", - "icon": "assets/modid/icon.png", + "license": "GPL-3.0", + "icon": "assets/stringtools/icon.png", "environment": "*", "entrypoints": { "main": [ - "net.fabricmc.example.ExampleMod" + "me.daviddgtnt.stringtools.Main" ] }, - "mixins": [ - "modid.mixins.json" - ], "depends": { "fabricloader": ">=0.14.11", "fabric-api": "*", "minecraft": "~1.19.3", "java": ">=17" - }, - "suggests": { - "another-mod": "*" } } diff --git a/src/main/resources/modid.mixins.json b/src/main/resources/modid.mixins.json deleted file mode 100644 index 7c42cb4..0000000 --- a/src/main/resources/modid.mixins.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "required": true, - "minVersion": "0.8", - "package": "net.fabricmc.example.mixin", - "compatibilityLevel": "JAVA_17", - "mixins": [ - ], - "client": [ - "ExampleMixin" - ], - "injectors": { - "defaultRequire": 1 - } -}