Skip to content

Commit

Permalink
add item class
Browse files Browse the repository at this point in the history
  • Loading branch information
randomusert committed Jul 19, 2024
1 parent 35a6e2c commit a09141a
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 10 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# custom crafting fabric
custom crafting fabric is a mod for crafting recipes without craft tweaker

to build the mod you need java 17 jdk installed

# building

to build run `gradlew runclient`
15 changes: 5 additions & 10 deletions src/main/java/com/tinteeam/custom_crafting/Customcrafting.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,16 @@
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Customcrafting 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("custom-crafting");
public static final Item BLANK_DIAMOND = new Item(new FabricItemSettings());



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

Registry.register(Registry.ITEM, new Identifier("custom_crafting:blank_diamond"), BLANK_DIAMOND);
blank_diamond.initialize();
}
}
21 changes: 21 additions & 0 deletions src/main/java/com/tinteeam/custom_crafting/blank_diamond.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.tinteeam.custom_crafting;

import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import net.minecraft.item.Item;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;

public class blank_diamond {
public static final Item BLANK_DIAMOND = register(new Item(new FabricItemSettings()), "blank_diamond");

public static Item register(Item instance, String path) {
return Registry.register(Registry.ITEM, new Identifier("custom_crafting", "blank_diamond"), instance);
}


public static void initialize() {
}



}

0 comments on commit a09141a

Please sign in to comment.