Compare commits

...

4 Commits
1.19 ... 1.21.2

Author SHA1 Message Date
DavidDGTNT 28e9f7f8cd Update to 1.21.2 2024-12-30 14:50:04 -06:00
DavidDGTNT 62ce1dff3f Update to 1.21 2024-12-30 11:49:24 -06:00
DavidDGTNT 42e7a2af08 Update to 1.20.5 2024-12-30 11:17:10 -06:00
DavidDGTNT bf210d7398 Update to 1.20 2024-12-29 21:34:49 -06:00
24 changed files with 147 additions and 236 deletions

View File

@ -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 {

View File

@ -4,14 +4,14 @@ org.gradle.parallel=true
# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.19.3
yarn_mappings=1.19.3+build.5
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.19
mod_version = 1.0.2-1.21.2
maven_group = me.daviddgtnt
archives_base_name = stringtools
# Dependencies
fabric_version=0.76.1+1.19.3
fabric_version=0.106.1+1.21.2

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -1,39 +1,33 @@
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.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 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().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() {
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);
Registry.register(Registries.ITEM, Identifier.of("stringtools", "string_stick"), STRING_STICK);
Registry.register(Registries.ITEM, Identifier.of("stringtools", "string_sword"), STRING_SWORD);
Registry.register(Registries.ITEM, Identifier.of("stringtools", "string_pickaxe"), STRING_PICKAXE);
Registry.register(Registries.ITEM, Identifier.of("stringtools", "string_axe"), STRING_AXE);
Registry.register(Registries.ITEM, Identifier.of("stringtools", "string_shovel"), STRING_SHOVEL);
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.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,41 +1,11 @@
package me.daviddgtnt.stringtools;
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 int getMiningLevel() {
return 0;
}
@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

@ -0,0 +1,15 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"SS",
"TS",
"T "
],
"key": {
"S": "minecraft:string",
"T": "stringtools:string_stick"
},
"result": {
"id": "stringtools:string_axe"
}
}

View File

@ -0,0 +1,15 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"SS",
"ST",
" T"
],
"key": {
"S": "minecraft:string",
"T": "stringtools:string_stick"
},
"result": {
"id": "stringtools:string_axe"
}
}

View File

@ -0,0 +1,15 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"SS",
" T",
" T"
],
"key": {
"S": "minecraft:string",
"T": "stringtools:string_stick"
},
"result": {
"id": "stringtools:string_hoe"
}
}

View File

@ -0,0 +1,15 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"SS",
"T ",
"T "
],
"key": {
"S": "minecraft:string",
"T": "stringtools:string_stick"
},
"result": {
"id": "stringtools:string_hoe"
}
}

View File

@ -0,0 +1,15 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"SSS",
" T ",
" T "
],
"key": {
"S": "minecraft:string",
"T": "stringtools:string_stick"
},
"result": {
"id": "stringtools:string_pickaxe"
}
}

View File

@ -0,0 +1,15 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"S",
"T",
"T"
],
"key": {
"S": "minecraft:string",
"T": "stringtools:string_stick"
},
"result": {
"id": "stringtools:string_shovel"
}
}

View File

@ -5,12 +5,10 @@
"S"
],
"key": {
"S": {
"item": "minecraft:string"
}
"S": "minecraft:string"
},
"result": {
"item": "stringtools:string_stick",
"id": "stringtools:string_stick",
"count": 4
}
}

View File

@ -0,0 +1,15 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"S",
"S",
"T"
],
"key": {
"S": "minecraft:string",
"T": "stringtools:string_stick"
},
"result": {
"id": "stringtools:string_sword"
}
}

View File

@ -1,19 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"SS",
"TS",
"T "
],
"key": {
"S": {
"item": "minecraft:string"
},
"T": {
"item": "stringtools:string_stick"
}
},
"result": {
"item": "stringtools:string_axe"
}
}

View File

@ -1,19 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"SS",
"ST",
" T"
],
"key": {
"S": {
"item": "minecraft:string"
},
"T": {
"item": "stringtools:string_stick"
}
},
"result": {
"item": "stringtools:string_axe"
}
}

View File

@ -1,19 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"SS",
" T",
" T"
],
"key": {
"S": {
"item": "minecraft:string"
},
"T": {
"item": "stringtools:string_stick"
}
},
"result": {
"item": "stringtools:string_hoe"
}
}

View File

@ -1,19 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"SS",
"T ",
"T "
],
"key": {
"S": {
"item": "minecraft:string"
},
"T": {
"item": "stringtools:string_stick"
}
},
"result": {
"item": "stringtools:string_hoe"
}
}

View File

@ -1,19 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"SSS",
" T ",
" T "
],
"key": {
"S": {
"item": "minecraft:string"
},
"T": {
"item": "stringtools:string_stick"
}
},
"result": {
"item": "stringtools:string_pickaxe"
}
}

View File

@ -1,19 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"S",
"T",
"T"
],
"key": {
"S": {
"item": "minecraft:string"
},
"T": {
"item": "stringtools:string_stick"
}
},
"result": {
"item": "stringtools:string_shovel"
}
}

View File

@ -1,19 +0,0 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"S",
"S",
"T"
],
"key": {
"S": {
"item": "minecraft:string"
},
"T": {
"item": "stringtools:string_stick"
}
},
"result": {
"item": "stringtools:string_sword"
}
}

View File

@ -1,7 +1,7 @@
{
"schemaVersion": 1,
"id": "stringtools",
"version": "1.0.2-1.19",
"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.19.3",
"java": ">=17"
"minecraft": "~1.21.2",
"java": ">=21"
}
}