Update to 1.21.2

1.21.2 1.0.2-1.21.2
DavidDGTNT 2024-12-30 14:50:04 -06:00
parent 62ce1dff3f
commit 28e9f7f8cd
13 changed files with 40 additions and 95 deletions

View File

@ -4,14 +4,14 @@ org.gradle.parallel=true
# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.21
yarn_mappings=1.21+build.9
minecraft_version=1.21.2
yarn_mappings=1.21.2+build.1
loader_version=0.16.9
# Mod Properties
mod_version = 1.0.2-1.21
mod_version = 1.0.2-1.21.2
maven_group = me.daviddgtnt
archives_base_name = stringtools
# Dependencies
fabric_version=0.102.0+1.21
fabric_version=0.106.1+1.21.2

View File

@ -5,15 +5,17 @@ import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
import net.minecraft.item.*;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.util.Identifier;
public class Main implements ModInitializer {
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)));
public static final Item STRING_STICK = new Item(new Item.Settings().registryKey(RegistryKey.of(RegistryKeys.ITEM, Identifier.of("stringtools","string_stick" ))));
public static final SwordItem STRING_SWORD = new SwordItem(StringToolMaterial.INSTANCE, 4, 1.6F, new Item.Settings().registryKey(RegistryKey.of(RegistryKeys.ITEM, Identifier.of("stringtools", "string_sword"))));
public static final MiningToolItem STRING_PICKAXE = new PickaxeItem(StringToolMaterial.INSTANCE, 2.0F, 2.4F, new Item.Settings().registryKey(RegistryKey.of(RegistryKeys.ITEM, Identifier.of("stringtools", "string_pickaxe"))));
public static final MiningToolItem STRING_AXE = new AxeItem(StringToolMaterial.INSTANCE, 7.0F, 0.8F, new Item.Settings().registryKey(RegistryKey.of(RegistryKeys.ITEM, Identifier.of("stringtools", "string_axe"))));
public static final MiningToolItem STRING_SHOVEL = new ShovelItem(StringToolMaterial.INSTANCE, 2.5F, 1.0F, new Item.Settings().registryKey(RegistryKey.of(RegistryKeys.ITEM, Identifier.of("stringtools", "string_shovel"))));
public static final MiningToolItem STRING_HOE = new HoeItem(StringToolMaterial.INSTANCE, 1.0F, 1.0F, new Item.Settings().registryKey(RegistryKey.of(RegistryKeys.ITEM, Identifier.of("stringtools", "string_hoe"))));
@Override
public void onInitialize() {
@ -25,7 +27,7 @@ public class Main implements ModInitializer {
Registry.register(Registries.ITEM, Identifier.of("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);

View File

@ -1,44 +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.RegistryKeys;
import net.minecraft.registry.tag.BlockTags;
import net.minecraft.registry.tag.TagKey;
import net.minecraft.util.Identifier;
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 TagKey<Block> getInverseTag() {
return BlockTags.INCORRECT_FOR_WOODEN_TOOL;
}
@Override
public int getEnchantability() {
return 15;
}
@Override
public Ingredient getRepairIngredient() {
return Ingredient.ofItems(Items.STRING);
}
public class StringToolMaterial {
public static final ToolMaterial INSTANCE = new ToolMaterial(BlockTags.INCORRECT_FOR_WOODEN_TOOL, 1, 2.0F, 0.0F, 15, TagKey.of(RegistryKeys.ITEM, Identifier.of("stringtools", "string")));
}

View File

@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"minecraft:string"
]
}

View File

@ -6,12 +6,8 @@
"T "
],
"key": {
"S": {
"item": "minecraft:string"
},
"T": {
"item": "stringtools:string_stick"
}
"S": "minecraft:string",
"T": "stringtools:string_stick"
},
"result": {
"id": "stringtools:string_axe"

View File

@ -6,12 +6,8 @@
" T"
],
"key": {
"S": {
"item": "minecraft:string"
},
"T": {
"item": "stringtools:string_stick"
}
"S": "minecraft:string",
"T": "stringtools:string_stick"
},
"result": {
"id": "stringtools:string_axe"

View File

@ -6,12 +6,8 @@
" T"
],
"key": {
"S": {
"item": "minecraft:string"
},
"T": {
"item": "stringtools:string_stick"
}
"S": "minecraft:string",
"T": "stringtools:string_stick"
},
"result": {
"id": "stringtools:string_hoe"

View File

@ -6,12 +6,8 @@
"T "
],
"key": {
"S": {
"item": "minecraft:string"
},
"T": {
"item": "stringtools:string_stick"
}
"S": "minecraft:string",
"T": "stringtools:string_stick"
},
"result": {
"id": "stringtools:string_hoe"

View File

@ -6,12 +6,8 @@
" T "
],
"key": {
"S": {
"item": "minecraft:string"
},
"T": {
"item": "stringtools:string_stick"
}
"S": "minecraft:string",
"T": "stringtools:string_stick"
},
"result": {
"id": "stringtools:string_pickaxe"

View File

@ -6,12 +6,8 @@
"T"
],
"key": {
"S": {
"item": "minecraft:string"
},
"T": {
"item": "stringtools:string_stick"
}
"S": "minecraft:string",
"T": "stringtools:string_stick"
},
"result": {
"id": "stringtools:string_shovel"

View File

@ -5,9 +5,7 @@
"S"
],
"key": {
"S": {
"item": "minecraft:string"
}
"S": "minecraft:string"
},
"result": {
"id": "stringtools:string_stick",

View File

@ -6,12 +6,8 @@
"T"
],
"key": {
"S": {
"item": "minecraft:string"
},
"T": {
"item": "stringtools:string_stick"
}
"S": "minecraft:string",
"T": "stringtools:string_stick"
},
"result": {
"id": "stringtools:string_sword"

View File

@ -1,7 +1,7 @@
{
"schemaVersion": 1,
"id": "stringtools",
"version": "1.0.2-1.21",
"version": "1.0.2-1.21.2",
"name": "String Tools",
"description": "Single use tools made out of string!",
@ -26,7 +26,7 @@
"depends": {
"fabricloader": ">=0.16.9",
"fabric-api": "*",
"minecraft": "~1.21",
"minecraft": "~1.21.2",
"java": ">=21"
}
}