package net.earthcomputer.vimapi.test;

import net.earthcomputer.vimapi.ItemStack;
import net.earthcomputer.vimapi.LifecycleEventType;
import net.earthcomputer.vimapi.LifecycleHandler;
import net.earthcomputer.vimapi.Registry;
import net.earthcomputer.vimapi.VimMod;

@VimMod(id = "example", version = "1.0")
public class ExampleMod {

	@LifecycleHandler(LifecycleEventType.PREINIT)
	public void preinit() {
		Registry.addShapedRecipe(new ItemStack("minecraft:diamond", 0, 64), "cg", "gc", 'c',
				new ItemStack("minecraft:dirt", 2), 'g', "minecraft:gravel");
		Registry.addShapedRecipe(new ItemStack("minecraft:diamond_sword"), "#", "#", "|", '#', "minecraft:stone", '|',
				"minecraft:stick");
		Registry.addShapelessRecipe(new ItemStack("minecraft:cobblestone", 0, 4), "minecraft:stone", "minecraft:stone",
				"minecraft:stone", "minecraft:stone");
	}

}

@@ -259,16 +259,110 @@
 .VimMod;
+%0Aimport net.earthcomputer.vimapi.nbt.NBTCompound;%0Aimport net.earthcomputer.vimapi.nbt.NBTList;
 %0A%0A@VimMo
@@ -942,14 +942,915 @@
 tone%22);%0A
+%09%09Registry.addShapedRecipe(new ItemStack(%22minecraft:diamond%22, 0, 2), %22lll%22, %22l l%22, %22lll%22, 'l', %22minecraft:log%22);%0A%09%09Registry.addShapedRecipe(new ItemStack(%22minecraft:diamond%22, 0, 2), %22lll%22, %22l l%22, %22lll%22, 'l', %22minecraft:log2%22);%0A%09%09NBTCompound nbt = new NBTCompound();%0A%09%09NBTList ench = new NBTList();%0A%09%09nbt.set(%22ench%22, ench);%0A%09%09NBTCompound enchantment = new NBTCompound();%0A%09%09enchantment.setInt(%22id%22, 34); // unbreaking%0A%09%09enchantment.setInt(%22lvl%22, 2);%0A%09%09ench.add(enchantment);%0A%09%09enchantment = new NBTCompound();%0A%09%09enchantment.setInt(%22id%22, 35); // fortune%0A%09%09enchantment.setInt(%22lvl%22, 2);%0A%09%09ench.add(enchantment);%0A%09%09enchantment = new NBTCompound();%0A%09%09enchantment.setInt(%22id%22, 16); // sharpness%0A%09%09enchantment.setInt(%22lvl%22, 2);%0A%09%09ench.add(enchantment);%0A%09%09Registry.addShapedRecipe(new ItemStack(%22minecraft:diamond_sword%22, 0, 1, nbt), %22ddd%22, %22ddd%22, %22sss%22, 'd',%0A%09%09%09%09%22minecraft:diamond%22, 's', %22minecraft:stick%22);%0A
 %09%7D%0A%0A%7D%0A

Test for NBT interface