Nouma zer
Member
Hello ! I searched a bit about adding custom recipes for a while and I don't understand why I can't add mine, take a look :
0 errors in the console and it still doesn't work.
I hope that you'll help me, thanks !
Java:
package me.nouma.ncraft;
import cn.nukkit.inventory.ShapedRecipe;
import cn.nukkit.item.Item;
import cn.nukkit.plugin.PluginBase;
import java.util.ArrayList;
import java.util.HashMap;
public class Main extends PluginBase {
@Override
public void onEnable() {
Item gapple = new Item(Item.GOLDEN_APPLE_ENCHANTED);
String[] shape = {"GGG", "GAG", "GGG"};
HashMap<Character, Item> identifiers = new HashMap<>();
identifiers.put('G', new Item(Item.GOLD_BLOCK));
identifiers.put('A', new Item(Item.APPLE));
ArrayList<Item> items = new ArrayList<>();
items.add(gapple);
ShapedRecipe recipe = new ShapedRecipe(gapple, shape, identifiers, items);
getServer().addRecipe(recipe);
}
}
I hope that you'll help me, thanks !