Compare commits

...

2 Commits
1.19 ... 1.20.5

Author SHA1 Message Date
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
16 changed files with 32 additions and 66 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.20.5
yarn_mappings=1.20.5+build.1
loader_version=0.16.9
# Mod Properties
mod_version = 1.0.2-1.19
mod_version = 1.0.2-1.20.5
maven_group = me.daviddgtnt
archives_base_name = stringtools
# Dependencies
fabric_version=0.76.1+1.19.3
fabric_version=0.97.8+1.20.5

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,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);

View File

@ -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<Block> getInverseTag() {
return BlockTags.INCORRECT_FOR_WOODEN_TOOL;
}
@Override

View File

@ -14,6 +14,6 @@
}
},
"result": {
"item": "stringtools:string_axe"
"id": "stringtools:string_axe"
}
}

View File

@ -14,6 +14,6 @@
}
},
"result": {
"item": "stringtools:string_axe"
"id": "stringtools:string_axe"
}
}

View File

@ -14,6 +14,6 @@
}
},
"result": {
"item": "stringtools:string_hoe"
"id": "stringtools:string_hoe"
}
}

View File

@ -14,6 +14,6 @@
}
},
"result": {
"item": "stringtools:string_hoe"
"id": "stringtools:string_hoe"
}
}

View File

@ -14,6 +14,6 @@
}
},
"result": {
"item": "stringtools:string_pickaxe"
"id": "stringtools:string_pickaxe"
}
}

View File

@ -14,6 +14,6 @@
}
},
"result": {
"item": "stringtools:string_shovel"
"id": "stringtools:string_shovel"
}
}

View File

@ -10,7 +10,7 @@
}
},
"result": {
"item": "stringtools:string_stick",
"id": "stringtools:string_stick",
"count": 4
}
}

View File

@ -14,6 +14,6 @@
}
},
"result": {
"item": "stringtools:string_sword"
"id": "stringtools:string_sword"
}
}

View File

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