From 42e7a2af081ba73b7ed8a9d437286a95c3e6f7b9 Mon Sep 17 00:00:00 2001 From: DavidDGTNT Date: Mon, 30 Dec 2024 11:17:10 -0600 Subject: [PATCH] Update to 1.20.5 --- build.gradle | 7 +++--- gradle.properties | 8 +++---- .../daviddgtnt/stringtools/CustomAxeItem.java | 10 -------- .../daviddgtnt/stringtools/CustomHoeItem.java | 10 -------- .../stringtools/CustomPickaxeItem.java | 10 -------- .../java/me/daviddgtnt/stringtools/Main.java | 24 +++++++------------ .../stringtools/StringToolMaterial.java | 7 ++++-- .../data/stringtools/recipes/string_axe.json | 2 +- .../recipes/string_axe_reverse.json | 2 +- .../data/stringtools/recipes/string_hoe.json | 2 +- .../recipes/string_hoe_reversed.json | 2 +- .../stringtools/recipes/string_pickaxe.json | 2 +- .../stringtools/recipes/string_shovel.json | 2 +- .../stringtools/recipes/string_stick.json | 2 +- .../stringtools/recipes/string_sword.json | 2 +- src/main/resources/fabric.mod.json | 6 ++--- 16 files changed, 32 insertions(+), 66 deletions(-) delete mode 100644 src/main/java/me/daviddgtnt/stringtools/CustomAxeItem.java delete mode 100644 src/main/java/me/daviddgtnt/stringtools/CustomHoeItem.java delete mode 100644 src/main/java/me/daviddgtnt/stringtools/CustomPickaxeItem.java diff --git a/build.gradle b/build.gradle index 8533d13..1cf96a8 100644 --- a/build.gradle +++ b/build.gradle @@ -3,8 +3,8 @@ plugins { id 'maven-publish' } -sourceCompatibility = JavaVersion.VERSION_17 -targetCompatibility = JavaVersion.VERSION_17 +sourceCompatibility = JavaVersion.VERSION_21 +targetCompatibility = JavaVersion.VERSION_21 archivesBaseName = project.archives_base_name version = project.mod_version @@ -43,7 +43,8 @@ processResources { tasks.withType(JavaCompile).configureEach { // Minecraft 1.18 (1.18-pre2) upwards uses Java 17. - it.options.release = 17 + // Minecraft 1.20.5 upwards uses Java 21. + it.options.release = 21 } java { diff --git a/gradle.properties b/gradle.properties index e6930db..94f8465 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,14 +4,14 @@ org.gradle.parallel=true # Fabric Properties # check these on https://fabricmc.net/develop - minecraft_version=1.20 - yarn_mappings=1.20+build.1 + minecraft_version=1.20.5 + yarn_mappings=1.20.5+build.1 loader_version=0.16.9 # Mod Properties - mod_version = 1.0.2-1.20 + mod_version = 1.0.2-1.20.5 maven_group = me.daviddgtnt archives_base_name = stringtools # Dependencies - fabric_version=0.83.0+1.20 + fabric_version=0.97.8+1.20.5 diff --git a/src/main/java/me/daviddgtnt/stringtools/CustomAxeItem.java b/src/main/java/me/daviddgtnt/stringtools/CustomAxeItem.java deleted file mode 100644 index 40ba420..0000000 --- a/src/main/java/me/daviddgtnt/stringtools/CustomAxeItem.java +++ /dev/null @@ -1,10 +0,0 @@ -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 deleted file mode 100644 index 63a34d8..0000000 --- a/src/main/java/me/daviddgtnt/stringtools/CustomHoeItem.java +++ /dev/null @@ -1,10 +0,0 @@ -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 deleted file mode 100644 index 80c5af3..0000000 --- a/src/main/java/me/daviddgtnt/stringtools/CustomPickaxeItem.java +++ /dev/null @@ -1,10 +0,0 @@ -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 index 031bc86..ba131b3 100644 --- a/src/main/java/me/daviddgtnt/stringtools/Main.java +++ b/src/main/java/me/daviddgtnt/stringtools/Main.java @@ -1,25 +1,19 @@ 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.item.*; 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()); + public static final Item STRING_STICK = new Item(new Item.Settings()); + public static final ToolItem STRING_SWORD = new SwordItem(StringToolMaterial.INSTANCE, new Item.Settings().attributeModifiers(SwordItem.createAttributeModifiers(StringToolMaterial.INSTANCE, 4, 1.6F))); + public static final ToolItem STRING_PICKAXE = new PickaxeItem(StringToolMaterial.INSTANCE, new Item.Settings().attributeModifiers(PickaxeItem.createAttributeModifiers(StringToolMaterial.INSTANCE, 2.0F, 2.4F))); + public static final ToolItem STRING_AXE = new AxeItem(StringToolMaterial.INSTANCE, new Item.Settings().attributeModifiers(AxeItem.createAttributeModifiers(StringToolMaterial.INSTANCE, 7.0F, 0.8F))); + public static final ToolItem STRING_SHOVEL = new ShovelItem(StringToolMaterial.INSTANCE, new Item.Settings().attributeModifiers(ShovelItem.createAttributeModifiers(StringToolMaterial.INSTANCE, 2.5F, 1.0F))); + public static final ToolItem STRING_HOE = new HoeItem(StringToolMaterial.INSTANCE, new Item.Settings().attributeModifiers(HoeItem.createAttributeModifiers(StringToolMaterial.INSTANCE, 1.0F, 1.0F))); @Override public void onInitialize() { @@ -30,9 +24,7 @@ public class Main implements ModInitializer { 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.INGREDIENTS).register(content -> content.addBefore(Items.STICK, STRING_STICK)); ItemGroupEvents.modifyEntriesEvent(ItemGroups.TOOLS).register(content -> { content.addBefore(Items.WOODEN_SHOVEL, STRING_HOE); diff --git a/src/main/java/me/daviddgtnt/stringtools/StringToolMaterial.java b/src/main/java/me/daviddgtnt/stringtools/StringToolMaterial.java index 9b80497..b195ee4 100644 --- a/src/main/java/me/daviddgtnt/stringtools/StringToolMaterial.java +++ b/src/main/java/me/daviddgtnt/stringtools/StringToolMaterial.java @@ -1,8 +1,11 @@ package me.daviddgtnt.stringtools; +import net.minecraft.block.Block; import net.minecraft.item.Items; import net.minecraft.item.ToolMaterial; import net.minecraft.recipe.Ingredient; +import net.minecraft.registry.tag.BlockTags; +import net.minecraft.registry.tag.TagKey; public class StringToolMaterial implements ToolMaterial { public static final StringToolMaterial INSTANCE = new StringToolMaterial(); @@ -23,8 +26,8 @@ public class StringToolMaterial implements ToolMaterial { } @Override - public int getMiningLevel() { - return 0; + public TagKey getInverseTag() { + return BlockTags.INCORRECT_FOR_WOODEN_TOOL; } @Override diff --git a/src/main/resources/data/stringtools/recipes/string_axe.json b/src/main/resources/data/stringtools/recipes/string_axe.json index b57c1d5..ef426ad 100644 --- a/src/main/resources/data/stringtools/recipes/string_axe.json +++ b/src/main/resources/data/stringtools/recipes/string_axe.json @@ -14,6 +14,6 @@ } }, "result": { - "item": "stringtools:string_axe" + "id": "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 index 8cb4a0a..571f495 100644 --- a/src/main/resources/data/stringtools/recipes/string_axe_reverse.json +++ b/src/main/resources/data/stringtools/recipes/string_axe_reverse.json @@ -14,6 +14,6 @@ } }, "result": { - "item": "stringtools:string_axe" + "id": "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 index 6424521..42c9eeb 100644 --- a/src/main/resources/data/stringtools/recipes/string_hoe.json +++ b/src/main/resources/data/stringtools/recipes/string_hoe.json @@ -14,6 +14,6 @@ } }, "result": { - "item": "stringtools:string_hoe" + "id": "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 index 2c978d4..c53f62d 100644 --- a/src/main/resources/data/stringtools/recipes/string_hoe_reversed.json +++ b/src/main/resources/data/stringtools/recipes/string_hoe_reversed.json @@ -14,6 +14,6 @@ } }, "result": { - "item": "stringtools:string_hoe" + "id": "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 index 435603d..52e6a8e 100644 --- a/src/main/resources/data/stringtools/recipes/string_pickaxe.json +++ b/src/main/resources/data/stringtools/recipes/string_pickaxe.json @@ -14,6 +14,6 @@ } }, "result": { - "item": "stringtools:string_pickaxe" + "id": "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 index e2c323b..94726ff 100644 --- a/src/main/resources/data/stringtools/recipes/string_shovel.json +++ b/src/main/resources/data/stringtools/recipes/string_shovel.json @@ -14,6 +14,6 @@ } }, "result": { - "item": "stringtools:string_shovel" + "id": "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 index f22730f..41ab6ce 100644 --- a/src/main/resources/data/stringtools/recipes/string_stick.json +++ b/src/main/resources/data/stringtools/recipes/string_stick.json @@ -10,7 +10,7 @@ } }, "result": { - "item": "stringtools:string_stick", + "id": "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 index 2a0290d..3c825b0 100644 --- a/src/main/resources/data/stringtools/recipes/string_sword.json +++ b/src/main/resources/data/stringtools/recipes/string_sword.json @@ -14,6 +14,6 @@ } }, "result": { - "item": "stringtools:string_sword" + "id": "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 019145c..98b2ae6 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -1,7 +1,7 @@ { "schemaVersion": 1, "id": "stringtools", - "version": "1.0.2-1.20", + "version": "1.0.2-1.20.5", "name": "String Tools", "description": "Single use tools made out of string!", @@ -26,7 +26,7 @@ "depends": { "fabricloader": ">=0.16.9", "fabric-api": "*", - "minecraft": "~1.20", - "java": ">=17" + "minecraft": "~1.20.5", + "java": ">=21" } }