53 lines
2.0 KiB
Java
Executable File
53 lines
2.0 KiB
Java
Executable File
//GPT'd
|
|
package de.hessj.environmentex;
|
|
|
|
import org.bukkit.Material;
|
|
import org.bukkit.NamespacedKey;
|
|
import org.bukkit.event.EventHandler;
|
|
import org.bukkit.event.Listener;
|
|
import org.bukkit.event.server.ServerLoadEvent;
|
|
import org.bukkit.inventory.ItemStack;
|
|
import org.bukkit.inventory.ShapedRecipe;
|
|
import org.bukkit.inventory.ShapelessRecipe;
|
|
import org.bukkit.inventory.StonecuttingRecipe;
|
|
|
|
public class CustomRecipes implements Listener {
|
|
|
|
@EventHandler
|
|
public void onEnable(ServerLoadEvent e) {
|
|
StonecuttingRecipe scrStoneToCobble = new StonecuttingRecipe(
|
|
new NamespacedKey(App.main, "R3S_SCR_STONE"),
|
|
new ItemStack(Material.COBBLESTONE),
|
|
Material.STONE);
|
|
registerRecipe(scrStoneToCobble);
|
|
|
|
ShapelessRecipe srGlowberryToGlowpowder = new ShapelessRecipe(
|
|
new NamespacedKey(App.main, "R3S_SLR_GLOWBERRY"),
|
|
new ItemStack(Material.GLOWSTONE_DUST));
|
|
srGlowberryToGlowpowder.addIngredient(Material.GLOW_BERRIES);
|
|
registerRecipe(srGlowberryToGlowpowder);
|
|
|
|
ShapedRecipe srSoulsoil = new ShapedRecipe(
|
|
new NamespacedKey(App.main, "R3S_SR_SOULSOIL"),
|
|
new ItemStack(Material.SOUL_SOIL));
|
|
srSoulsoil.shape("DS ", "SD ", " ");
|
|
srSoulsoil.setIngredient('S', Material.SOUL_SAND);
|
|
srSoulsoil.setIngredient('D', Material.DIRT);
|
|
registerRecipe(srSoulsoil);
|
|
}
|
|
|
|
private void registerRecipe(ShapedRecipe recipe) {
|
|
App.main.getServer().addRecipe(recipe);
|
|
App.main.recipeKeys.add(recipe.getKey());
|
|
}
|
|
|
|
private void registerRecipe(ShapelessRecipe recipe) {
|
|
App.main.getServer().addRecipe(recipe);
|
|
App.main.recipeKeys.add(recipe.getKey());
|
|
}
|
|
|
|
private void registerRecipe(StonecuttingRecipe recipe) {
|
|
App.main.getServer().addRecipe(recipe);
|
|
App.main.recipeKeys.add(recipe.getKey());
|
|
}
|
|
} |