Update Feb 2nd 2023

This commit is contained in:
Paul Reilly
2023-03-05 22:35:52 -06:00
parent 0195469165
commit 839990554e
21 changed files with 377 additions and 325 deletions

View File

@ -1,61 +0,0 @@
package io.github.paldiu;
import org.bukkit.Material;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.CraftItemEvent;
import org.bukkit.event.inventory.PrepareItemCraftEvent;
import org.bukkit.inventory.CraftingInventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.Recipe;
import org.bukkit.plugin.Plugin;
public class CraftingListener implements Listener {
public CraftingListener(Plugin instance) {
instance.getServer().getPluginManager().registerEvents(this, instance);
}
@EventHandler
public void preCraftEvent(PrepareItemCraftEvent e) {
final Recipe recipe = e.getRecipe();
if (recipe == null) { return; }
final ItemStack result = recipe.getResult();
final CraftingInventory inv = e.getInventory();
if (e.isRepair()) { return; }
if (result.getType().equals(Material.NETHER_WART)) {
result.setAmount(9);
inv.setResult(result);
}
if (result.getType().equals(Material.CRYING_OBSIDIAN)) {
result.setAmount(2);
inv.setResult(result);
}
if (result.getType().equals(Material.BEDROCK)) {
result.setAmount(4);
inv.setResult(result);
}
}
@EventHandler
public void craftEvent(CraftItemEvent e) {
final ItemStack result = e.getRecipe().getResult();
final CraftingInventory inv = e.getInventory();
if (result.getType().equals(Material.NETHER_WART)) {
result.setAmount(9);
inv.setResult(result);
}
if (result.getType().equals(Material.CRYING_OBSIDIAN)) {
result.setAmount(2);
inv.setResult(result);
}
if (result.getType().equals(Material.BEDROCK)) {
result.setAmount(4);
inv.setResult(result);
}
}
}

View File

@ -1,13 +1,17 @@
package io.github.paldiu;
import io.github.paldiu.config.ItemMetaSupplier;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.inventory.ShapelessRecipe;
import org.bukkit.inventory.meta.ItemMeta;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import java.util.function.Supplier;
public class CraftingUtils {
private final Uncraftables plugin;
@ -26,8 +30,34 @@ public class CraftingUtils {
return new ShapedRecipe(newKey(key), is);
}
public final @NotNull ShapedRecipe shaped(Material result, int amount, String key) {
ItemStack is = new ItemStack(result);
is.setAmount(amount);
return new ShapedRecipe(newKey(key), is);
}
public final @NotNull ShapedRecipe shaped(Material result, int amount, String key, ItemMetaSupplier customData) {
ItemStack is = new ItemStack(result);
is.setAmount(amount);
is.setItemMeta(customData.getFrom(is));
return new ShapedRecipe(newKey(key), is);
}
public final @NotNull ShapelessRecipe shapeless(Material result, String key) {
ItemStack is = new ItemStack(result);
return new ShapelessRecipe(newKey(key), is);
}
public final @NotNull ShapelessRecipe shapeless(Material result, int amount, String key) {
ItemStack is = new ItemStack(result);
is.setAmount(amount);
return new ShapelessRecipe(newKey(key), is);
}
public final @NotNull ShapelessRecipe shapeless(Material result, int amount, String key, ItemMetaSupplier customData) {
ItemStack is = new ItemStack(result);
is.setAmount(amount);
is.setItemMeta(customData.getFrom(is));
return new ShapelessRecipe(newKey(key), is);
}
}

View File

@ -26,7 +26,6 @@ public class Uncraftables extends JavaPlugin {
Bukkit.getLogger().info("[Uncraftables] Successfully enabled bStats metrics!");
register();
new CraftingListener(this);
Bukkit.getLogger().info("[Uncraftables] successfully loaded all recipes.");
new ReloadCMD(this);
@ -51,6 +50,7 @@ public class Uncraftables extends JavaPlugin {
new NameTagRecipe(this);
new NetherStarRecipe(this);
new NetherWartRecipe(this);
new PhantomMembraneRecipe(this);
new SaddleRecipe(this);
new SpawnerRecipe(this);
new TotemRecipe(this);

View File

@ -76,4 +76,16 @@ public class ConfigValues {
public boolean tridentEnabled() {
return plugin.getYamlWrapper().getBoolean("trident");
}
public boolean membraneEnabled() {
return plugin.getYamlWrapper().getBoolean("membrane");
}
public boolean cobWebEnabled() {
return plugin.getYamlWrapper().getBoolean("cobweb");
}
public boolean witherSkullEnabled() {
return plugin.getYamlWrapper().getBoolean("wither_skull");
}
}

View File

@ -0,0 +1,9 @@
package io.github.paldiu.config;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
@FunctionalInterface
public interface ItemMetaSupplier {
ItemMeta getFrom(ItemStack itemStack);
}

View File

@ -2,6 +2,7 @@ package io.github.paldiu.recipes;
import io.github.paldiu.Uncraftables;
import org.bukkit.Material;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.inventory.ShapelessRecipe;
public class BedrockRecipe extends Craftable {
@ -10,15 +11,11 @@ public class BedrockRecipe extends Craftable {
if (!getConfigValues().bedrockEnabled()) return;
ShapelessRecipe recipe = getUtil().shapeless(Material.BEDROCK, "bedrock_recipe");
recipe.addIngredient(2, Material.OBSIDIAN);
recipe.addIngredient(2, Material.STONE);
recipe.addIngredient(1, Material.DIAMOND);
recipe.addIngredient(1, Material.IRON_INGOT);
recipe.addIngredient(1, Material.COAL);
recipe.addIngredient(1, Material.WATER_BUCKET);
recipe.addIngredient(1, Material.LAVA_BUCKET);
recipe.getResult().setAmount(4);
ShapedRecipe recipe = getUtil().shaped(Material.BEDROCK, 4, "bedrock_recipe");
recipe.shape("dod", "ono", "dod");
recipe.setIngredient('d', Material.DIAMOND_BLOCK);
recipe.setIngredient('o', Material.OBSIDIAN);
recipe.setIngredient('n', Material.NETHERITE_BLOCK);
getPlugin().getServer().addRecipe(recipe);
}
}

View File

@ -0,0 +1,17 @@
package io.github.paldiu.recipes;
import io.github.paldiu.Uncraftables;
import org.bukkit.Material;
import org.bukkit.inventory.ShapelessRecipe;
public class CobWebRecipe extends Craftable {
public CobWebRecipe(Uncraftables plugin) {
super(plugin);
if (!getConfigValues().cobWebEnabled()) return;
ShapelessRecipe cobweb = getUtil().shapeless(Material.COBWEB, 2, "cobweb_recipe");
cobweb.addIngredient(9, Material.STRING);
getPlugin().getServer().addRecipe(cobweb);
}
}

View File

@ -2,6 +2,7 @@ package io.github.paldiu.recipes;
import io.github.paldiu.Uncraftables;
import org.bukkit.Material;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.inventory.ShapelessRecipe;
public class CryingObsidianRecipe extends Craftable {
@ -10,10 +11,11 @@ public class CryingObsidianRecipe extends Craftable {
if (!getConfigValues().cryingObsidianEnabled()) return;
ShapelessRecipe recipe = getUtil().shapeless(Material.CRYING_OBSIDIAN, "crying_obsidian_recipe");
recipe.addIngredient(1, Material.OBSIDIAN);
recipe.addIngredient(4, Material.GHAST_TEAR);
recipe.getResult().setAmount(2);
ShapedRecipe recipe = getUtil().shaped(Material.CRYING_OBSIDIAN, 2, "crying_obsidian_recipe");
recipe.shape("aga", "gog", "aga");
recipe.setIngredient('a', Material.AIR);
recipe.setIngredient('o', Material.OBSIDIAN);
recipe.setIngredient('g', Material.GHAST_TEAR);
getPlugin().getServer().addRecipe(recipe);
}
}

View File

@ -13,7 +13,7 @@ public class DragonEggRecipe extends Craftable {
ShapedRecipe recipe = getUtil().shaped(Material.DRAGON_EGG, "dragon_egg_recipe");
recipe.shape("obo", "beb", "obo");
recipe.setIngredient('o', Material.OBSIDIAN);
recipe.setIngredient('o', Material.CRYING_OBSIDIAN);
recipe.setIngredient('b', Material.DRAGON_BREATH);
recipe.setIngredient('e', Material.DRAGON_HEAD);
getPlugin().getServer().addRecipe(recipe);

View File

@ -2,8 +2,12 @@ package io.github.paldiu.recipes;
import io.github.paldiu.Uncraftables;
import org.bukkit.Material;
import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.inventory.ShapelessRecipe;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.SpawnEggMeta;
public class EggRecipes extends Craftable {
public EggRecipes(Uncraftables plugin) {
@ -31,6 +35,7 @@ public class EggRecipes extends Craftable {
pandaEgg();
phantomEgg();
piglinEgg();
piglinBruteEgg();
pillagerEgg();
polarBearEgg();
ravagerEgg();
@ -79,7 +84,7 @@ public class EggRecipes extends Craftable {
private void beeEgg() {
ShapedRecipe beeEgg = getUtil().shaped(Material.BEE_SPAWN_EGG, "bee_egg_recipe");
beeEgg.shape("aha","heh","aha");
beeEgg.shape("aha", "heh", "aha");
beeEgg.setIngredient('a', Material.AIR);
beeEgg.setIngredient('h', Material.HONEYCOMB);
beeEgg.setIngredient('e', Material.EGG);
@ -88,7 +93,7 @@ public class EggRecipes extends Craftable {
private void blazeEgg() {
ShapedRecipe blazeEgg = getUtil().shaped(Material.BLAZE_SPAWN_EGG, "blaze_egg_recipe");
blazeEgg.shape("sbs","beb","sbs");
blazeEgg.shape("sbs", "beb", "sbs");
blazeEgg.setIngredient('s', Material.SOUL_SOIL);
blazeEgg.setIngredient('b', Material.BLAZE_ROD);
blazeEgg.setIngredient('e', Material.EGG);
@ -97,7 +102,7 @@ public class EggRecipes extends Craftable {
private void caveSpiderEgg() {
ShapedRecipe caveSpiderEgg = getUtil().shaped(Material.CAVE_SPIDER_SPAWN_EGG, "cave_spider_egg_recipe");
caveSpiderEgg.shape("afa","ses","afa");
caveSpiderEgg.shape("afa", "ses", "afa");
caveSpiderEgg.setIngredient('a', Material.AIR);
caveSpiderEgg.setIngredient('f', Material.FERMENTED_SPIDER_EYE);
caveSpiderEgg.setIngredient('s', Material.SPIDER_EYE);
@ -107,7 +112,7 @@ public class EggRecipes extends Craftable {
private void creeperEgg() {
ShapedRecipe creeperEgg = getUtil().shaped(Material.CREEPER_SPAWN_EGG, "creeper_egg_recipe");
creeperEgg.shape("aga","geg","aga");
creeperEgg.shape("aga", "geg", "aga");
creeperEgg.setIngredient('a', Material.AIR);
creeperEgg.setIngredient('g', Material.GUNPOWDER);
creeperEgg.setIngredient('e', Material.EGG);
@ -116,37 +121,43 @@ public class EggRecipes extends Craftable {
private void dolphinEgg() {
ShapedRecipe dolphin = getUtil().shaped(Material.DOLPHIN_SPAWN_EGG, "dolphin_egg_recipe");
dolphin.shape("aca","wew","aca");
dolphin.shape("aca", "wew", "aca");
dolphin.setIngredient('a', Material.AIR);
dolphin.setIngredient('w', Material.WATER_BUCKET);
dolphin.setIngredient('c', Material.COD);
dolphin.setIngredient('c', Material.TROPICAL_FISH);
dolphin.setIngredient('e', Material.EGG);
getPlugin().getServer().addRecipe(dolphin);
}
private void drownedEgg() {
ShapedRecipe drowned = getUtil().shaped(Material.DROWNED_SPAWN_EGG, "drowned_egg_recipe");
drowned.shape("awa","fef","awa");
drowned.shape("awa", "fef", "awa");
drowned.setIngredient('a', Material.AIR);
drowned.setIngredient('w', Material.WATER_BUCKET);
drowned.setIngredient('f', Material.FISHING_ROD);
drowned.setIngredient('f', Material.KELP);
drowned.setIngredient('e', Material.ZOMBIE_SPAWN_EGG);
getPlugin().getServer().addRecipe(drowned);
}
private void elderGuardEgg() {
ShapedRecipe eldGuard = getUtil().shaped(Material.ELDER_GUARDIAN_SPAWN_EGG, "elder_guardian_egg_recipe");
eldGuard.shape("apa","ses","apa");
eldGuard.setIngredient('a', Material.AIR);
eldGuard.shape(
"sbs",
"pep",
"sps");
eldGuard.setIngredient('s', Material.PRISMARINE_CRYSTALS);
eldGuard.setIngredient('p', Material.PRISMARINE_SHARD);
eldGuard.setIngredient('e', Material.GUARDIAN_SPAWN_EGG);
eldGuard.setIngredient('s', Material.SPONGE);
eldGuard.setIngredient('b', Material.BEACON);
getPlugin().getServer().addRecipe(eldGuard);
}
private void endermanEgg() {
ShapedRecipe enderman = getUtil().shaped(Material.ENDERMAN_SPAWN_EGG, "enderman_egg_recipe");
enderman.shape("apa","pep","apa");
enderman.shape(
"apa",
"pep",
"apa");
enderman.setIngredient('a', Material.AIR);
enderman.setIngredient('p', Material.ENDER_PEARL);
enderman.setIngredient('e', Material.EGG);
@ -155,7 +166,7 @@ public class EggRecipes extends Craftable {
private void endermiteEgg() {
ShapedRecipe endermite = getUtil().shaped(Material.ENDERMITE_SPAWN_EGG, "endermite_egg_recipe");
endermite.shape("apa","cec","apa");
endermite.shape("apa", "cec", "apa");
endermite.setIngredient('a', Material.AIR);
endermite.setIngredient('p', Material.ENDER_PEARL);
endermite.setIngredient('c', Material.CHORUS_FRUIT);
@ -165,7 +176,7 @@ public class EggRecipes extends Craftable {
private void evokerEgg() {
ShapedRecipe evoker = getUtil().shaped(Material.EVOKER_SPAWN_EGG, "evoker_egg_recipe");
evoker.shape("ata","eve","ata");
evoker.shape("ata", "eve", "ata");
evoker.setIngredient('a', Material.AIR);
evoker.setIngredient('t', Material.TOTEM_OF_UNDYING);
evoker.setIngredient('e', Material.EMERALD);
@ -175,7 +186,7 @@ public class EggRecipes extends Craftable {
private void foxEgg() {
ShapedRecipe fox = getUtil().shaped(Material.FOX_SPAWN_EGG, "fox_egg_recipe");
fox.shape("asa","ses","asa");
fox.shape("asa", "ses", "asa");
fox.setIngredient('a', Material.AIR);
fox.setIngredient('s', Material.SWEET_BERRIES);
fox.setIngredient('e', Material.EGG);
@ -184,7 +195,7 @@ public class EggRecipes extends Craftable {
private void ghastEgg() {
ShapedRecipe ghast = getUtil().shaped(Material.GHAST_SPAWN_EGG, "ghast_egg_recipe");
ghast.shape("sts","geg","sts");
ghast.shape("sts", "geg", "sts");
ghast.setIngredient('s', Material.SOUL_SOIL);
ghast.setIngredient('t', Material.GHAST_TEAR);
ghast.setIngredient('g', Material.GUNPOWDER);
@ -194,7 +205,7 @@ public class EggRecipes extends Craftable {
private void guardianEgg() {
ShapedRecipe guardian = getUtil().shaped(Material.GUARDIAN_SPAWN_EGG, "guardian_egg_recipe");
guardian.shape("apa","pep","apa");
guardian.shape("apa", "pep", "apa");
guardian.setIngredient('a', Material.AIR);
guardian.setIngredient('p', Material.PRISMARINE_SHARD);
guardian.setIngredient('e', Material.EGG);
@ -203,7 +214,7 @@ public class EggRecipes extends Craftable {
private void hoglinEgg() {
ShapedRecipe hoglin = getUtil().shaped(Material.HOGLIN_SPAWN_EGG, "hoglin_egg_recipe");
hoglin.shape("sls","pep","sls");
hoglin.shape("sls", "pep", "sls");
hoglin.setIngredient('s', Material.SOUL_SOIL);
hoglin.setIngredient('p', Material.PORKCHOP);
hoglin.setIngredient('l', Material.LEATHER);
@ -213,19 +224,19 @@ public class EggRecipes extends Craftable {
private void huskEgg() {
ShapedRecipe husk = getUtil().shaped(Material.HUSK_SPAWN_EGG, "husk_egg_recipe");
husk.shape("asa","rer","asa");
husk.shape("asa", "ses", "asa");
husk.setIngredient('a', Material.AIR);
husk.setIngredient('s', Material.SAND);
husk.setIngredient('e', Material.ZOMBIE_SPAWN_EGG);
husk.setIngredient('r', Material.ROTTEN_FLESH);
getPlugin().getServer().addRecipe(husk);
}
private void llamaEgg() {
ShapedRecipe llama = getUtil().shaped(Material.LLAMA_SPAWN_EGG, "llama_egg_recipe");
llama.shape("aca","lel","aca");
llama.shape("aca", "lel", "ana");
llama.setIngredient('a', Material.AIR);
llama.setIngredient('c', Material.WHITE_CARPET);
llama.setIngredient('n', Material.IRON_NUGGET);
llama.setIngredient('e', Material.EGG);
llama.setIngredient('l', Material.LEATHER);
getPlugin().getServer().addRecipe(llama);
@ -233,16 +244,16 @@ public class EggRecipes extends Craftable {
private void magmaCubeEgg() {
ShapedRecipe magma_cube = getUtil().shaped(Material.MAGMA_CUBE_SPAWN_EGG, "magma_cube_egg_recipe");
magma_cube.shape("scs","cec","scs");
magma_cube.shape("scs", "cec", "scs");
magma_cube.setIngredient('s', Material.SOUL_SOIL);
magma_cube.setIngredient('c', Material.MAGMA_CREAM);
magma_cube.setIngredient('e', Material.EGG);
magma_cube.setIngredient('e', Material.SLIME_SPAWN_EGG);
getPlugin().getServer().addRecipe(magma_cube);
}
private void pandaEgg() {
ShapedRecipe panda = getUtil().shaped(Material.PANDA_SPAWN_EGG, "panda_egg_recipe");
panda.shape("aba","beb","aba");
panda.shape("aba", "beb", "aba");
panda.setIngredient('a', Material.AIR);
panda.setIngredient('b', Material.BAMBOO);
panda.setIngredient('e', Material.EGG);
@ -251,7 +262,7 @@ public class EggRecipes extends Craftable {
private void phantomEgg() {
ShapedRecipe phantom = getUtil().shaped(Material.PHANTOM_SPAWN_EGG, "phantom_egg_recipe");
phantom.shape("ama","mem","ama");
phantom.shape("ama", "mem", "ama");
phantom.setIngredient('a', Material.AIR);
phantom.setIngredient('m', Material.PHANTOM_MEMBRANE);
phantom.setIngredient('e', Material.EGG);
@ -260,7 +271,7 @@ public class EggRecipes extends Craftable {
private void piglinEgg() {
ShapedRecipe piglin = getUtil().shaped(Material.PIGLIN_SPAWN_EGG, "piglin_egg_recipe");
piglin.shape("sgs","nen","sgs");
piglin.shape("sgs", "nen", "sgs");
piglin.setIngredient('s', Material.SOUL_SOIL);
piglin.setIngredient('n', Material.GOLD_NUGGET);
piglin.setIngredient('g', Material.GOLD_INGOT);
@ -268,19 +279,30 @@ public class EggRecipes extends Craftable {
getPlugin().getServer().addRecipe(piglin);
}
private void piglinBruteEgg() {
ShapedRecipe piglin_brute = getUtil().shaped(Material.PIGLIN_BRUTE_SPAWN_EGG, "piglin_brute_egg_recipe");
piglin_brute.shape("sgs", "ael", "sgs");
piglin_brute.setIngredient('s', Material.SOUL_SOIL);
piglin_brute.setIngredient('a', Material.GOLDEN_AXE);
piglin_brute.setIngredient('l', Material.LEATHER);
piglin_brute.setIngredient('g', Material.GOLD_INGOT);
piglin_brute.setIngredient('e', Material.PIGLIN_SPAWN_EGG);
}
private void pillagerEgg() {
ShapedRecipe pillager = getUtil().shaped(Material.PILLAGER_SPAWN_EGG, "pillager_egg_recipe");
pillager.shape("aca","*e*","aca");
pillager.shape("aca", "wew", "ada");
pillager.setIngredient('a', Material.AIR);
pillager.setIngredient('c', Material.CROSSBOW);
pillager.setIngredient('*', Material.ARROW);
pillager.setIngredient('d', Material.EMERALD);
pillager.setIngredient('w', Material.ARROW);
pillager.setIngredient('e', Material.VILLAGER_SPAWN_EGG);
getPlugin().getServer().addRecipe(pillager);
}
private void polarBearEgg() {
ShapedRecipe polar_bear = getUtil().shaped(Material.POLAR_BEAR_SPAWN_EGG, "polar_bear_egg_recipe");
polar_bear.shape("aca","ses","aca");
polar_bear.shape("aca", "ses", "aca");
polar_bear.setIngredient('a', Material.AIR);
polar_bear.setIngredient('c', Material.COD);
polar_bear.setIngredient('e', Material.EGG);
@ -290,26 +312,27 @@ public class EggRecipes extends Craftable {
private void ravagerEgg() {
ShapedRecipe ravager = getUtil().shaped(Material.RAVAGER_SPAWN_EGG, "ravager_egg_recipe");
ravager.shape("asa","ses","asa");
ravager.shape("asa", "ded", "ada");
ravager.setIngredient('a', Material.AIR);
ravager.setIngredient('s', Material.SADDLE);
ravager.setIngredient('d', Material.EMERALD);
ravager.setIngredient('e', Material.HOGLIN_SPAWN_EGG);
getPlugin().getServer().addRecipe(ravager);
}
private void shulkerEgg() {
ShapedRecipe shulker = getUtil().shaped(Material.SHULKER_SPAWN_EGG, "shulker_egg_recipe");
shulker.shape("scs","beb","scs");
shulker.shape("scs", "beb", "scs");
shulker.setIngredient('s', Material.END_STONE);
shulker.setIngredient('c', Material.CHORUS_FRUIT);
shulker.setIngredient('b', Material.SHULKER_SHELL);
shulker.setIngredient('b', Material.CHORUS_FRUIT);
shulker.setIngredient('c', Material.SHULKER_SHELL);
shulker.setIngredient('e', Material.EGG);
getPlugin().getServer().addRecipe(shulker);
}
private void silverfishEgg() {
ShapedRecipe silverfish = getUtil().shaped(Material.SILVERFISH_SPAWN_EGG, "silverfish_egg_recipe");
silverfish.shape("asa","cec","asa");
silverfish.shape("asa", "cec", "asa");
silverfish.setIngredient('a', Material.AIR);
silverfish.setIngredient('s', Material.STONE_BRICKS);
silverfish.setIngredient('c', Material.CHISELED_STONE_BRICKS);
@ -319,16 +342,18 @@ public class EggRecipes extends Craftable {
private void skeletonEgg() {
ShapedRecipe skeleton = getUtil().shaped(Material.SKELETON_SPAWN_EGG, "skeleton_egg_recipe");
skeleton.shape("aba","beb","aba");
skeleton.shape("asa", "bex", "aba");
skeleton.setIngredient('a', Material.AIR);
skeleton.setIngredient('b', Material.BONE);
skeleton.setIngredient('x', Material.BOW);
skeleton.setIngredient('s', Material.SKELETON_SKULL);
skeleton.setIngredient('e', Material.EGG);
getPlugin().getServer().addRecipe(skeleton);
}
private void slimeEgg() {
ShapedRecipe slime = getUtil().shaped(Material.SLIME_SPAWN_EGG, "slime_egg_recipe");
slime.shape("asa","ses","asa");
slime.shape("asa", "ses", "asa");
slime.setIngredient('a', Material.AIR);
slime.setIngredient('s', Material.SLIME_BALL);
slime.setIngredient('e', Material.EGG);
@ -337,7 +362,7 @@ public class EggRecipes extends Craftable {
private void spiderEgg() {
ShapedRecipe spider = getUtil().shaped(Material.SPIDER_SPAWN_EGG, "spider_egg_recipe");
spider.shape("aia","ses","aia");
spider.shape("aia", "ses", "aia");
spider.setIngredient('a', Material.AIR);
spider.setIngredient('i', Material.SPIDER_EYE);
spider.setIngredient('s', Material.STRING);
@ -347,17 +372,17 @@ public class EggRecipes extends Craftable {
private void strayEgg() {
ShapedRecipe stray = getUtil().shaped(Material.STRAY_SPAWN_EGG, "stray_egg_recipe");
stray.shape("asa","iei","asa");
stray.shape("asa", "iei", "asa");
stray.setIngredient('a', Material.AIR);
stray.setIngredient('s', Material.SNOWBALL);
stray.setIngredient('s', Material.BLUE_ICE);
stray.setIngredient('e', Material.SKELETON_SPAWN_EGG);
stray.setIngredient('i', Material.ICE);
stray.setIngredient('i', Material.PACKED_ICE);
getPlugin().getServer().addRecipe(stray);
}
private void striderEgg() {
ShapedRecipe strider = getUtil().shaped(Material.STRIDER_SPAWN_EGG, "strider_egg_recipe");
strider.shape("sls","lel","sls");
strider.shape("sls", "lel", "sls");
strider.setIngredient('s', Material.SOUL_SOIL);
strider.setIngredient('l', Material.LAVA_BUCKET);
strider.setIngredient('e', Material.EGG);
@ -366,7 +391,7 @@ public class EggRecipes extends Craftable {
private void vexEgg() {
ShapedRecipe vex = getUtil().shaped(Material.VEX_SPAWN_EGG, "vex_egg_recipe");
vex.shape("afa","fef","afa");
vex.shape("afa", "fef", "afa");
vex.setIngredient('a', Material.AIR);
vex.setIngredient('f', Material.FEATHER);
vex.setIngredient('e', Material.EVOKER_SPAWN_EGG);
@ -375,7 +400,7 @@ public class EggRecipes extends Craftable {
private void vindicatorEgg() {
ShapedRecipe vindicator = getUtil().shaped(Material.VINDICATOR_SPAWN_EGG, "vindicator_egg_recipe");
vindicator.shape("axa","*e*","axa");
vindicator.shape("a*a", "*ex", "a*a");
vindicator.setIngredient('a', Material.AIR);
vindicator.setIngredient('x', Material.IRON_AXE);
vindicator.setIngredient('e', Material.PILLAGER_SPAWN_EGG);
@ -385,17 +410,17 @@ public class EggRecipes extends Craftable {
private void witchEgg() {
ShapedRecipe witch = getUtil().shaped(Material.WITCH_SPAWN_EGG, "witch_egg_recipe");
witch.shape("apa","ses","apa");
witch.shape("asa", "pep", "asa");
witch.setIngredient('a', Material.AIR);
witch.setIngredient('p', Material.SPLASH_POTION);
witch.setIngredient('s', Material.STICK);
witch.setIngredient('s', Material.VINE);
witch.setIngredient('e', Material.EGG);
getPlugin().getServer().addRecipe(witch);
}
private void witherSkeletonEgg() {
ShapedRecipe wither_skeleton = getUtil().shaped(Material.WITHER_SKELETON_SPAWN_EGG, "wither_skeleton_egg_recipe");
wither_skeleton.shape("scs","cec","scs");
wither_skeleton.shape("scs", "cec", "scs");
wither_skeleton.setIngredient('s', Material.SOUL_SOIL);
wither_skeleton.setIngredient('c', Material.COAL);
wither_skeleton.setIngredient('e', Material.SKELETON_SPAWN_EGG);
@ -404,7 +429,7 @@ public class EggRecipes extends Craftable {
private void wolfEgg() {
ShapedRecipe wolf = getUtil().shaped(Material.WOLF_SPAWN_EGG, "wolf_egg_recipe");
wolf.shape("aba","nen","aba");
wolf.shape("aba", "nen", "aba");
wolf.setIngredient('a', Material.AIR);
wolf.setIngredient('b', Material.BONE);
wolf.setIngredient('n', Material.NAME_TAG);
@ -414,7 +439,7 @@ public class EggRecipes extends Craftable {
private void zoglinEgg() {
ShapedRecipe zoglin = getUtil().shaped(Material.ZOGLIN_SPAWN_EGG, "zoglin_egg_recipe");
zoglin.shape("srs","rer","srs");
zoglin.shape("srs", "rer", "srs");
zoglin.setIngredient('s', Material.SOUL_SOIL);
zoglin.setIngredient('r', Material.ROTTEN_FLESH);
zoglin.setIngredient('e', Material.HOGLIN_SPAWN_EGG);
@ -423,7 +448,7 @@ public class EggRecipes extends Craftable {
private void zombieEgg() {
ShapedRecipe zombie = getUtil().shaped(Material.ZOMBIE_SPAWN_EGG, "zombie_egg_recipe");
zombie.shape("ara","rer","ara");
zombie.shape("ara", "rer", "ara");
zombie.setIngredient('a', Material.AIR);
zombie.setIngredient('r', Material.ROTTEN_FLESH);
zombie.setIngredient('e', Material.EGG);
@ -432,7 +457,7 @@ public class EggRecipes extends Craftable {
private void zombieVillagerEgg() {
ShapedRecipe zombie_villager = getUtil().shaped(Material.ZOMBIE_VILLAGER_SPAWN_EGG, "z_villager_egg_recipe");
zombie_villager.shape("ara","rer","ara");
zombie_villager.shape("ara", "rer", "ara");
zombie_villager.setIngredient('a', Material.AIR);
zombie_villager.setIngredient('r', Material.ROTTEN_FLESH);
zombie_villager.setIngredient('e', Material.VILLAGER_SPAWN_EGG);
@ -441,7 +466,7 @@ public class EggRecipes extends Craftable {
private void zPiglinEgg() {
ShapedRecipe zombie_piglin = getUtil().shaped(Material.ZOMBIFIED_PIGLIN_SPAWN_EGG, "z_piglin_egg_recipe");
zombie_piglin.shape("srs","rer","srs");
zombie_piglin.shape("srs", "rer", "srs");
zombie_piglin.setIngredient('s', Material.SOUL_SOIL);
zombie_piglin.setIngredient('r', Material.ROTTEN_FLESH);
zombie_piglin.setIngredient('e', Material.PIGLIN_SPAWN_EGG);
@ -452,7 +477,7 @@ public class EggRecipes extends Craftable {
private void batEgg() {
ShapedRecipe bat = getUtil().shaped(Material.BAT_SPAWN_EGG, "bat_egg_recipe");
bat.shape("aba","fef","aba");
bat.shape("aba", "fef", "aba");
bat.setIngredient('a', Material.AIR);
bat.setIngredient('b', Material.APPLE);
bat.setIngredient('e', Material.CHICKEN_SPAWN_EGG);
@ -462,7 +487,7 @@ public class EggRecipes extends Craftable {
private void catEgg() {
ShapedRecipe cat = getUtil().shaped(Material.CAT_SPAWN_EGG, "cat_egg_recipe");
cat.shape("aca","ses","aca");
cat.shape("aca", "ses", "aca");
cat.setIngredient('a', Material.AIR);
cat.setIngredient('c', Material.COD);
cat.setIngredient('s', Material.SALMON);
@ -472,7 +497,7 @@ public class EggRecipes extends Craftable {
private void chickenEgg() {
ShapedRecipe chimken = getUtil().shaped(Material.CHICKEN_SPAWN_EGG, "chicken_egg_recipe");
chimken.shape("afa","fef","afa");
chimken.shape("afa", "fef", "afa");
chimken.setIngredient('a', Material.AIR);
chimken.setIngredient('f', Material.FEATHER);
chimken.setIngredient('e', Material.EGG);
@ -481,7 +506,7 @@ public class EggRecipes extends Craftable {
private void codEgg() {
ShapedRecipe cod = getUtil().shaped(Material.COD_SPAWN_EGG, "cod_egg_recipe");
cod.shape("aca","cec","aca");
cod.shape("aca", "cec", "aca");
cod.setIngredient('a', Material.AIR);
cod.setIngredient('c', Material.COD);
cod.setIngredient('e', Material.EGG);
@ -490,7 +515,7 @@ public class EggRecipes extends Craftable {
private void cowEgg() {
ShapedRecipe coo = getUtil().shaped(Material.COW_SPAWN_EGG, "cow_egg_recipe");
coo.shape("ala","lel","ala");
coo.shape("ala", "lel", "ala");
coo.setIngredient('a', Material.AIR);
coo.setIngredient('l', Material.LEATHER);
coo.setIngredient('e', Material.EGG);
@ -505,7 +530,7 @@ public class EggRecipes extends Craftable {
private void horseEgg() {
ShapedRecipe hoarse = getUtil().shaped(Material.HORSE_SPAWN_EGG, "horse_egg_recipe");
hoarse.shape("asa","lel","ala");
hoarse.shape("asa", "lel", "ala");
hoarse.setIngredient('a', Material.AIR);
hoarse.setIngredient('s', Material.SADDLE);
hoarse.setIngredient('e', Material.EGG);
@ -515,7 +540,7 @@ public class EggRecipes extends Craftable {
private void mooshroomEgg() {
ShapedRecipe coo_pat = getUtil().shaped(Material.MOOSHROOM_SPAWN_EGG, "mooshroom_egg_recipe");
coo_pat.shape("ara","rer","ara");
coo_pat.shape("ara", "rer", "ara");
coo_pat.setIngredient('a', Material.AIR);
coo_pat.setIngredient('r', Material.RED_MUSHROOM);
coo_pat.setIngredient('e', Material.COW_SPAWN_EGG);
@ -531,7 +556,7 @@ public class EggRecipes extends Craftable {
private void ocelotEgg() {
ShapedRecipe ocky_way = getUtil().shaped(Material.OCELOT_SPAWN_EGG, "ocelot_egg_recipe");
ocky_way.shape("aca","ses","aca");
ocky_way.shape("aca", "ses", "aca");
ocky_way.setIngredient('a', Material.AIR);
ocky_way.setIngredient('c', Material.COCOA_BEANS);
ocky_way.setIngredient('s', Material.SALMON);
@ -541,7 +566,7 @@ public class EggRecipes extends Craftable {
private void parrotEgg() {
ShapedRecipe garrote = getUtil().shaped(Material.PARROT_SPAWN_EGG, "parrot_egg_recipe");
garrote.shape("asa","fef","asa");
garrote.shape("asa", "fef", "asa");
garrote.setIngredient('a', Material.AIR);
garrote.setIngredient('s', Material.WHEAT_SEEDS);
garrote.setIngredient('f', Material.FEATHER);
@ -551,7 +576,7 @@ public class EggRecipes extends Craftable {
private void pigEgg() {
ShapedRecipe pidge = getUtil().shaped(Material.PIG_SPAWN_EGG, "pig_egg_recipe");
pidge.shape("aca","cec","aca");
pidge.shape("aca", "cec", "aca");
pidge.setIngredient('a', Material.AIR);
pidge.setIngredient('c', Material.PORKCHOP);
pidge.setIngredient('e', Material.EGG);
@ -560,7 +585,7 @@ public class EggRecipes extends Craftable {
private void pufferfishEgg() {
ShapedRecipe paisson = getUtil().shaped(Material.PUFFERFISH_SPAWN_EGG, "pufferfish_egg_recipe");
paisson.shape("apa","pep","apa");
paisson.shape("apa", "pep", "apa");
paisson.setIngredient('a', Material.AIR);
paisson.setIngredient('p', Material.PUFFERFISH);
paisson.setIngredient('e', Material.EGG);
@ -569,7 +594,7 @@ public class EggRecipes extends Craftable {
private void rabbitEgg() {
ShapedRecipe rebillet = getUtil().shaped(Material.RABBIT_SPAWN_EGG, "rabbit_egg_recipe");
rebillet.shape("aha","heh","afa");
rebillet.shape("aha", "heh", "afa");
rebillet.setIngredient('a', Material.AIR);
rebillet.setIngredient('h', Material.RABBIT_HIDE);
rebillet.setIngredient('e', Material.EGG);
@ -579,7 +604,7 @@ public class EggRecipes extends Craftable {
private void salmonEgg() {
ShapedRecipe slammin_salmon = getUtil().shaped(Material.SALMON_SPAWN_EGG, "salmon_egg_recipe");
slammin_salmon.shape("asa","ses","asa");
slammin_salmon.shape("asa", "ses", "asa");
slammin_salmon.setIngredient('a', Material.AIR);
slammin_salmon.setIngredient('s', Material.SALMON);
slammin_salmon.setIngredient('e', Material.EGG);
@ -588,7 +613,7 @@ public class EggRecipes extends Craftable {
private void sheepEgg() {
ShapedRecipe haggis = getUtil().shaped(Material.SHEEP_SPAWN_EGG, "sheep_egg_recipe");
haggis.shape("awa","mem","awa");
haggis.shape("awa", "mem", "awa");
haggis.setIngredient('a', Material.AIR);
haggis.setIngredient('w', Material.WHITE_WOOL);
haggis.setIngredient('m', Material.MUTTON);
@ -605,7 +630,7 @@ public class EggRecipes extends Craftable {
private void squidEgg() {
ShapedRecipe squidge = getUtil().shaped(Material.SQUID_SPAWN_EGG, "squid_egg_recipe");
squidge.shape("aia","iei","aia");
squidge.shape("aia", "iei", "aia");
squidge.setIngredient('a', Material.AIR);
squidge.setIngredient('i', Material.INK_SAC);
squidge.setIngredient('e', Material.EGG);
@ -631,7 +656,7 @@ public class EggRecipes extends Craftable {
private void turtleEgg() {
ShapedRecipe tortuga = getUtil().shaped(Material.TURTLE_SPAWN_EGG, "turtle_egg_recipe");
tortuga.shape("asa","ses","asa");
tortuga.shape("asa", "ses", "asa");
tortuga.setIngredient('a', Material.AIR);
tortuga.setIngredient('s', Material.SCUTE);
tortuga.setIngredient('e', Material.EGG);
@ -640,7 +665,7 @@ public class EggRecipes extends Craftable {
private void villagerEgg() {
ShapedRecipe moron = getUtil().shaped(Material.VILLAGER_SPAWN_EGG, "villager_egg_recipe");
moron.shape("aea","p*p","aea");
moron.shape("aea", "p*p", "aea");
moron.setIngredient('a', Material.AIR);
moron.setIngredient('e', Material.EGG);
moron.setIngredient('p', Material.POPPY);
@ -650,7 +675,7 @@ public class EggRecipes extends Craftable {
private void traderEgg() {
ShapedRecipe dinkhead = getUtil().shaped(Material.WANDERING_TRADER_SPAWN_EGG, "trader_egg_recipe");
dinkhead.shape("aea","e*e","aea");
dinkhead.shape("aea", "e*e", "aea");
dinkhead.setIngredient('a', Material.AIR);
dinkhead.setIngredient('e', Material.EMERALD);
dinkhead.setIngredient('*', Material.VILLAGER_SPAWN_EGG);

View File

@ -10,13 +10,13 @@ public class NetherStarRecipe extends Craftable {
if (!getConfigValues().netherStarEnabled()) return;
ShapedRecipe recipe = getUtil().shaped(Material.NETHER_STAR, "nether_star_recipe");
recipe.shape("nwn","sss","bqb");
recipe.setIngredient('n', Material.NETHER_WART);
recipe.setIngredient('w', Material.WITHER_SKELETON_SKULL);
recipe.setIngredient('s', Material.SOUL_SAND);
recipe.setIngredient('b', Material.BLAZE_ROD);
recipe.setIngredient('q', Material.QUARTZ);
getPlugin().getServer().addRecipe(recipe);
ShapedRecipe nether_star = getUtil().shaped(Material.NETHER_STAR, "nether_star_recipe");
nether_star.shape("nwn","sss","bqb");
nether_star.setIngredient('n', Material.NETHER_WART);
nether_star.setIngredient('w', Material.WITHER_SKELETON_SKULL);
nether_star.setIngredient('s', Material.SOUL_SAND);
nether_star.setIngredient('b', Material.BLAZE_ROD);
nether_star.setIngredient('q', Material.QUARTZ);
getPlugin().getServer().addRecipe(nether_star);
}
}

View File

@ -10,9 +10,8 @@ public class NetherWartRecipe extends Craftable {
if (!getConfigValues().netherWartEnabled()) return;
ShapelessRecipe recipe = getUtil().shapeless(Material.NETHER_WART, "netherwart_recipe");
recipe.addIngredient(1, Material.NETHER_WART_BLOCK);
recipe.getResult().setAmount(9);
getPlugin().getServer().addRecipe(recipe);
ShapelessRecipe netherwart = getUtil().shapeless(Material.NETHER_WART, 9, "netherwart_recipe");
netherwart.addIngredient(1, Material.NETHER_WART_BLOCK);
getPlugin().getServer().addRecipe(netherwart);
}
}

View File

@ -0,0 +1,20 @@
package io.github.paldiu.recipes;
import io.github.paldiu.Uncraftables;
import org.bukkit.Material;
import org.bukkit.inventory.ShapedRecipe;
public class PhantomMembraneRecipe extends Craftable{
public PhantomMembraneRecipe(Uncraftables plugin) {
super(plugin);
if (!getConfigValues().membraneEnabled()) return;
ShapedRecipe membrane = getUtil().shaped(Material.PHANTOM_MEMBRANE, "membrane_recipe");
membrane.shape("sfs", "frf", "sfs");
membrane.setIngredient('s', Material.SLIME_BALL);
membrane.setIngredient('f', Material.FEATHER);
membrane.setIngredient('r', Material.FIREWORK_STAR);
getPlugin().getServer().addRecipe(membrane);
}
}

View File

@ -0,0 +1,21 @@
package io.github.paldiu.recipes;
import io.github.paldiu.Uncraftables;
import org.bukkit.Material;
import org.bukkit.inventory.ShapedRecipe;
public class WitherSkullRecipe extends Craftable {
public WitherSkullRecipe(Uncraftables plugin) {
super(plugin);
if (!getConfigValues().witherSkullEnabled()) return;
ShapedRecipe recipe = getUtil().shaped(Material.WITHER_SKELETON_SKULL, "wither_skull_recipe");
recipe.shape("scs", "coc", "scs");
recipe.setIngredient('s', Material.SOUL_SOIL);
recipe.setIngredient('c', Material.COAL);
recipe.setIngredient('o', Material.SKELETON_SKULL);
getPlugin().getServer().addRecipe(recipe);
}
}