Initial commit

remotes/origin/1.19
dugo3number2 2023-01-07 12:05:14 -06:00
parent 9cfe28c5ea
commit b769ce9849
32 changed files with 325 additions and 69 deletions

View File

@ -10,8 +10,8 @@ org.gradle.parallel=true
# Mod Properties # Mod Properties
mod_version = 1.0.0 mod_version = 1.0.0
maven_group = com.example maven_group = me.daviddgtnt
archives_base_name = fabric-example-mod archives_base_name = stringtools
# Dependencies # Dependencies
fabric_version=0.68.1+1.19.3 fabric_version=0.68.1+1.19.3

View File

@ -0,0 +1,10 @@
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

@ -0,0 +1,10 @@
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

@ -0,0 +1,10 @@
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

@ -0,0 +1,49 @@
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.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());
@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);
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);
content.addBefore(STRING_AXE, STRING_PICKAXE);
content.addBefore(STRING_PICKAXE, STRING_SHOVEL);
});
ItemGroupEvents.modifyEntriesEvent(ItemGroups.COMBAT).register(content -> {
content.addBefore(Items.WOODEN_SWORD, STRING_SWORD);
content.addBefore(Items.WOODEN_AXE, STRING_AXE);
});
}
}

View File

@ -0,0 +1,41 @@
package me.daviddgtnt.stringtools;
import net.minecraft.item.Items;
import net.minecraft.item.ToolMaterial;
import net.minecraft.recipe.Ingredient;
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);
}
}

View File

@ -1,21 +0,0 @@
package net.fabricmc.example;
import net.fabricmc.api.ModInitializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ExampleMod implements ModInitializer {
// This logger is used to write text to the console and the log file.
// It is considered best practice to use your mod id as the logger's name.
// That way, it's clear which mod wrote info, warnings, and errors.
public static final Logger LOGGER = LoggerFactory.getLogger("modid");
@Override
public void onInitialize() {
// This code runs as soon as Minecraft is in a mod-load-ready state.
// However, some things (like resources) may still be uninitialized.
// Proceed with mild caution.
LOGGER.info("Hello Fabric world!");
}
}

View File

@ -1,16 +0,0 @@
package net.fabricmc.example.mixin;
import net.fabricmc.example.ExampleMod;
import net.minecraft.client.gui.screen.TitleScreen;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(TitleScreen.class)
public class ExampleMixin {
@Inject(at = @At("HEAD"), method = "init()V")
private void init(CallbackInfo info) {
ExampleMod.LOGGER.info("This line is printed by an example mod mixin!");
}
}

View File

Before

Width:  |  Height:  |  Size: 453 B

After

Width:  |  Height:  |  Size: 453 B

View File

@ -0,0 +1,8 @@
{
"item.stringtools.string_sword": "String Sword",
"item.stringtools.string_pickaxe": "String Pickaxe",
"item.stringtools.string_axe": "String Axe",
"item.stringtools.string_shovel": "String Shovel",
"item.stringtools.string_hoe": "String Hoe",
"item.stringtools.string_stick": "Stick of String"
}

View File

@ -0,0 +1,6 @@
{
"parent": "minecraft:item/handheld",
"textures": {
"layer0": "stringtools:item/string_axe"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "minecraft:item/handheld",
"textures": {
"layer0": "stringtools:item/string_hoe"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "minecraft:item/handheld",
"textures": {
"layer0": "stringtools:item/string_pickaxe"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "minecraft:item/handheld",
"textures": {
"layer0": "stringtools:item/string_shovel"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "minecraft:item/handheld",
"textures": {
"layer0": "stringtools:item/string_stick"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "minecraft:item/handheld",
"textures": {
"layer0": "stringtools:item/string_sword"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 B

View File

@ -0,0 +1,19 @@
{
"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

@ -0,0 +1,19 @@
{
"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

@ -0,0 +1,19 @@
{
"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

@ -0,0 +1,19 @@
{
"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

@ -0,0 +1,19 @@
{
"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

@ -0,0 +1,19 @@
{
"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

@ -0,0 +1,16 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"S",
"S"
],
"key": {
"S": {
"item": "minecraft:string"
}
},
"result": {
"item": "stringtools:string_stick",
"count": 4
}
}

View File

@ -0,0 +1,19 @@
{
"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,38 +1,32 @@
{ {
"schemaVersion": 1, "schemaVersion": 1,
"id": "modid", "id": "stringtools",
"version": "${version}", "version": "1.0.0",
"name": "Example Mod", "name": "String Tools",
"description": "This is an example description! Tell everyone what your mod is about!", "description": "Single use tools made out of string!",
"authors": [ "authors": [
"Me!" "DavidDGTNT"
], ],
"contact": { "contact": {
"homepage": "https://fabricmc.net/", "homepage": "https://daviddgtnt.github.io/",
"sources": "https://github.com/FabricMC/fabric-example-mod" "sources": "https://github.com/daviddgtnt/stringtools"
}, },
"license": "CC0-1.0", "license": "GPL-3.0",
"icon": "assets/modid/icon.png", "icon": "assets/stringtools/icon.png",
"environment": "*", "environment": "*",
"entrypoints": { "entrypoints": {
"main": [ "main": [
"net.fabricmc.example.ExampleMod" "me.daviddgtnt.stringtools.Main"
] ]
}, },
"mixins": [
"modid.mixins.json"
],
"depends": { "depends": {
"fabricloader": ">=0.14.11", "fabricloader": ">=0.14.11",
"fabric-api": "*", "fabric-api": "*",
"minecraft": "~1.19.3", "minecraft": "~1.19.3",
"java": ">=17" "java": ">=17"
},
"suggests": {
"another-mod": "*"
} }
} }

View File

@ -1,14 +0,0 @@
{
"required": true,
"minVersion": "0.8",
"package": "net.fabricmc.example.mixin",
"compatibilityLevel": "JAVA_17",
"mixins": [
],
"client": [
"ExampleMixin"
],
"injectors": {
"defaultRequire": 1
}
}