Scout/src/main/java/pm/c7/scout/Scout.java

40 lines
1.4 KiB
Java
Raw Normal View History

2024-03-14 05:09:55 +00:00
package pm.c7.scout;
import com.unascribed.lib39.core.api.AutoRegistry;
import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup;
2024-03-14 05:09:55 +00:00
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.text.Text;
2024-03-14 05:09:55 +00:00
import net.minecraft.util.Identifier;
2024-03-14 05:09:55 +00:00
import org.quiltmc.loader.api.ModContainer;
import org.quiltmc.qsl.base.api.entrypoint.ModInitializer;
import pm.c7.scout.config.ScoutConfigHandler;
import pm.c7.scout.registry.ScoutItems;
public class Scout implements ModInitializer {
public static final AutoRegistry AUTOREGISTRY = AutoRegistry.of(ScoutUtil.MOD_ID);
public static final ItemGroup ITEM_GROUP = FabricItemGroup.builder()
.icon(() -> new ItemStack(ScoutItems.SATCHEL))
.name(Text.translatable("itemGroup.scout.itemgroup"))
.entries((context, entries) -> {
entries.addItem(ScoutItems.TANNED_LEATHER);
entries.addItem(ScoutItems.SATCHEL_STRAP);
entries.addItem(ScoutItems.SATCHEL);
entries.addItem(ScoutItems.UPGRADED_SATCHEL);
entries.addItem(ScoutItems.POUCH);
entries.addItem(ScoutItems.UPGRADED_POUCH);
})
.build();
2024-03-14 05:09:55 +00:00
@Override
public void onInitialize(ModContainer mod) {
2024-03-14 05:09:55 +00:00
new ScoutConfigHandler();
ScoutItems.init();
Registry.register(Registries.ITEM_GROUP, new Identifier(ScoutUtil.MOD_ID, "itemgroup"), ITEM_GROUP);
}
2024-03-14 05:09:55 +00:00
}