Skip to content

Commit 6782f2d

Browse files
committed
feat: Add Shroomlight crafting
1 parent eddadc3 commit 6782f2d

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package de.kiridevs.ksmpplugin.recipes.crafting;
2+
3+
import org.bukkit.Bukkit;
4+
import org.bukkit.Material;
5+
import org.bukkit.NamespacedKey;
6+
import org.bukkit.configuration.ConfigurationSection;
7+
import org.bukkit.inventory.ItemStack;
8+
import org.bukkit.inventory.ShapedRecipe;
9+
import org.bukkit.inventory.RecipeChoice.MaterialChoice;
10+
11+
import de.kiridevs.ksmpplugin.main.KiriSmpPlugin;
12+
13+
public class ShroomlightRecipe {
14+
private final KiriSmpPlugin plugin;
15+
16+
private static final MaterialChoice SHROOM_BLOCKS = new MaterialChoice(
17+
Material.BROWN_MUSHROOM_BLOCK,
18+
Material.RED_MUSHROOM_BLOCK
19+
);
20+
21+
public ShroomlightRecipe(KiriSmpPlugin plugin) {
22+
this.plugin = plugin;
23+
}
24+
25+
public void register(ConfigurationSection config) {
26+
if (!config.getBoolean("shroomlight")) return;
27+
28+
NamespacedKey key = new NamespacedKey(this.plugin, "shroomlight");
29+
ItemStack result = new ItemStack(Material.SHROOMLIGHT);
30+
31+
ShapedRecipe recipe = new ShapedRecipe(key, result)
32+
.shape(" g", "gsg", " g")
33+
.setIngredient('g', Material.GLOWSTONE_DUST)
34+
.setIngredient('s', ShroomlightRecipe.SHROOM_BLOCKS);
35+
36+
this.plugin.log.info("recipes: ShroomlightRecipe: Registering Custom Recipe");
37+
Bukkit.addRecipe(recipe);
38+
}
39+
}

0 commit comments

Comments
 (0)