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 # Fabric Properties
# check these on https://fabricmc.net/develop # check these on https://fabricmc.net/develop
minecraft_version=1.21 minecraft_version=1.21.2
yarn_mappings=1.21+build.9 yarn_mappings=1.21.2+build.1
loader_version=0.16.9 loader_version=0.16.9
# Mod Properties # Mod Properties
mod_version = 1.0.2-1.21 mod_version = 1.0.2-1.21.2
maven_group = me.daviddgtnt maven_group = me.daviddgtnt
archives_base_name = stringtools archives_base_name = stringtools
# Dependencies # 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.item.*;
import net.minecraft.registry.Registries; import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry; import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
public class Main implements ModInitializer { public class Main implements ModInitializer {
public static final Item STRING_STICK = new Item(new Item.Settings()); public static final Item STRING_STICK = new Item(new Item.Settings().registryKey(RegistryKey.of(RegistryKeys.ITEM, Identifier.of("stringtools","string_stick" ))));
public static final ToolItem STRING_SWORD = new SwordItem(StringToolMaterial.INSTANCE, new Item.Settings().attributeModifiers(SwordItem.createAttributeModifiers(StringToolMaterial.INSTANCE, 4, 1.6F))); 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 ToolItem STRING_PICKAXE = new PickaxeItem(StringToolMaterial.INSTANCE, new Item.Settings().attributeModifiers(PickaxeItem.createAttributeModifiers(StringToolMaterial.INSTANCE, 2.0F, 2.4F))); 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 ToolItem STRING_AXE = new AxeItem(StringToolMaterial.INSTANCE, new Item.Settings().attributeModifiers(AxeItem.createAttributeModifiers(StringToolMaterial.INSTANCE, 7.0F, 0.8F))); 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 ToolItem STRING_SHOVEL = new ShovelItem(StringToolMaterial.INSTANCE, new Item.Settings().attributeModifiers(ShovelItem.createAttributeModifiers(StringToolMaterial.INSTANCE, 2.5F, 1.0F))); 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 ToolItem STRING_HOE = new HoeItem(StringToolMaterial.INSTANCE, new Item.Settings().attributeModifiers(HoeItem.createAttributeModifiers(StringToolMaterial.INSTANCE, 1.0F, 1.0F))); 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 @Override
public void onInitialize() { public void onInitialize() {

View File

@ -1,44 +1,11 @@
package me.daviddgtnt.stringtools; package me.daviddgtnt.stringtools;
import net.minecraft.block.Block;
import net.minecraft.item.Items;
import net.minecraft.item.ToolMaterial; 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.BlockTags;
import net.minecraft.registry.tag.TagKey; import net.minecraft.registry.tag.TagKey;
import net.minecraft.util.Identifier;
public class StringToolMaterial implements ToolMaterial { public class StringToolMaterial {
public static final StringToolMaterial INSTANCE = new 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")));
@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);
}
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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