From 8c0fbfb2956f816d643cc8603b584e4de1801a97 Mon Sep 17 00:00:00 2001 From: TheBusyBiscuit Date: Fri, 30 Apr 2021 11:22:18 +0200 Subject: [PATCH] More refactoring --- .../items/armor/FarmerShoes.java | 3 ++ .../items/armor/HazmatArmorPiece.java | 3 ++ .../items/armor/SlimefunArmorPiece.java | 6 +++- .../items/armor/StomperBoots.java | 7 ++-- .../items/backpacks/Cooler.java | 3 ++ .../items/backpacks/EnderBackpack.java | 3 ++ .../items/backpacks/RestoredBackpack.java | 7 +++- .../items/backpacks/SoulboundBackpack.java | 3 ++ .../items/magical/runes/ElementalRune.java | 35 +++++++++++++++++++ .../items/misc/SyntheticEmerald.java | 3 ++ .../items/tools/ExplosivePickaxe.java | 3 ++ .../items/tools/ExplosiveShovel.java | 3 ++ .../items/tools/HerculesPickaxe.java | 6 +++- .../items/tools/PickaxeOfContainment.java | 2 ++ .../items/tools/PortableDustbin.java | 3 ++ .../setup/SlimefunItemSetup.java | 19 +++++----- 16 files changed, 96 insertions(+), 13 deletions(-) create mode 100644 src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/runes/ElementalRune.java diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/armor/FarmerShoes.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/armor/FarmerShoes.java index a51a9180f..9da6ba7a0 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/armor/FarmerShoes.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/armor/FarmerShoes.java @@ -1,5 +1,7 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.armor; +import javax.annotation.ParametersAreNonnullByDefault; + import org.bukkit.block.data.type.Farmland; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -18,6 +20,7 @@ import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; */ public class FarmerShoes extends SlimefunItem { + @ParametersAreNonnullByDefault public FarmerShoes(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { super(category, item, recipeType, recipe); } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/armor/HazmatArmorPiece.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/armor/HazmatArmorPiece.java index f50860c3b..93376a8ae 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/armor/HazmatArmorPiece.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/armor/HazmatArmorPiece.java @@ -1,5 +1,7 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.armor; +import javax.annotation.ParametersAreNonnullByDefault; + import org.bukkit.NamespacedKey; import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffect; @@ -26,6 +28,7 @@ public class HazmatArmorPiece extends SlimefunArmorPiece implements ProtectiveAr private final NamespacedKey namespacedKey; private final ProtectionType[] types; + @ParametersAreNonnullByDefault public HazmatArmorPiece(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, PotionEffect[] effects) { super(category, item, recipeType, recipe, effects); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/armor/SlimefunArmorPiece.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/armor/SlimefunArmorPiece.java index 47473bab7..d69787452 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/armor/SlimefunArmorPiece.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/armor/SlimefunArmorPiece.java @@ -1,5 +1,8 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.armor; +import javax.annotation.Nullable; +import javax.annotation.ParametersAreNonnullByDefault; + import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffect; @@ -13,7 +16,8 @@ public class SlimefunArmorPiece extends SlimefunItem { private final PotionEffect[] effects; - public SlimefunArmorPiece(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, PotionEffect[] effects) { + @ParametersAreNonnullByDefault + public SlimefunArmorPiece(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, @Nullable PotionEffect[] effects) { super(category, item, recipeType, recipe); this.effects = effects == null ? new PotionEffect[0] : effects; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/armor/StomperBoots.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/armor/StomperBoots.java index 3888d6506..5f1707e77 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/armor/StomperBoots.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/armor/StomperBoots.java @@ -1,6 +1,7 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.armor; import javax.annotation.Nonnull; +import javax.annotation.ParametersAreNonnullByDefault; import org.bukkit.Bukkit; import org.bukkit.Effect; @@ -33,6 +34,7 @@ import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; */ public class StomperBoots extends SlimefunItem { + @ParametersAreNonnullByDefault public StomperBoots(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { super(category, item, recipeType, recipe); } @@ -43,7 +45,7 @@ public class StomperBoots extends SlimefunItem { * @param fallDamageEvent * The {@link EntityDamageEvent} in which the {@link Player} has taken fall damage */ - public void stomp(EntityDamageEvent fallDamageEvent) { + public void stomp(@Nonnull EntityDamageEvent fallDamageEvent) { Player player = (Player) fallDamageEvent.getEntity(); player.getWorld().playSound(player.getLocation(), Sound.ENTITY_ZOMBIE_BREAK_WOODEN_DOOR, 1F, 2F); player.setVelocity(new Vector(0, 0.7, 0)); @@ -81,7 +83,8 @@ public class StomperBoots extends SlimefunItem { * * @return A {@link Vector} to determine the velocity for our {@link Entity} */ - private Vector getShockwave(@Nonnull Location origin, @Nonnull Location target) { + @Nonnull + protected Vector getShockwave(@Nonnull Location origin, @Nonnull Location target) { // As the distance approaches zero we might slip into a "division by zero" when normalizing if (origin.distanceSquared(target) < 0.05) { return new Vector(0, 1, 0); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/backpacks/Cooler.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/backpacks/Cooler.java index 40db894fe..9a0ab83de 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/backpacks/Cooler.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/backpacks/Cooler.java @@ -1,5 +1,7 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.backpacks; +import javax.annotation.ParametersAreNonnullByDefault; + import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -23,6 +25,7 @@ import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; */ public class Cooler extends SlimefunBackpack { + @ParametersAreNonnullByDefault public Cooler(int size, Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { super(size, category, item, recipeType, recipe); } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/backpacks/EnderBackpack.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/backpacks/EnderBackpack.java index 70784f870..47823c8ff 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/backpacks/EnderBackpack.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/backpacks/EnderBackpack.java @@ -1,5 +1,7 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.backpacks; +import javax.annotation.ParametersAreNonnullByDefault; + import org.bukkit.Sound; import org.bukkit.block.EnderChest; import org.bukkit.entity.Player; @@ -22,6 +24,7 @@ import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; */ public class EnderBackpack extends SimpleSlimefunItem implements NotPlaceable { + @ParametersAreNonnullByDefault public EnderBackpack(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { super(category, item, recipeType, recipe); } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/backpacks/RestoredBackpack.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/backpacks/RestoredBackpack.java index 68adae478..59af368bc 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/backpacks/RestoredBackpack.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/backpacks/RestoredBackpack.java @@ -5,6 +5,9 @@ import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; +import javax.annotation.Nonnull; +import javax.annotation.ParametersAreNonnullByDefault; + import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; @@ -17,6 +20,7 @@ import org.bukkit.inventory.ItemStack; * * @author Sfiguz7 * + * @see SlimefunBackpack * @see PlayerBackpack */ public class RestoredBackpack extends SlimefunBackpack { @@ -27,7 +31,8 @@ public class RestoredBackpack extends SlimefunBackpack { * @param category * the category to bind this {@link SlimefunBackpack} to */ - public RestoredBackpack(Category category) { + @ParametersAreNonnullByDefault + public RestoredBackpack(@Nonnull Category category) { super(54, category, SlimefunItems.RESTORED_BACKPACK, RecipeType.NULL, new ItemStack[9]); this.hidden = true; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/backpacks/SoulboundBackpack.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/backpacks/SoulboundBackpack.java index 362c146ee..6913830b4 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/backpacks/SoulboundBackpack.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/backpacks/SoulboundBackpack.java @@ -1,5 +1,7 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.backpacks; +import javax.annotation.ParametersAreNonnullByDefault; + import org.bukkit.inventory.ItemStack; import io.github.thebusybiscuit.slimefun4.core.attributes.Soulbound; @@ -15,6 +17,7 @@ import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; */ public class SoulboundBackpack extends SlimefunBackpack implements Soulbound { + @ParametersAreNonnullByDefault public SoulboundBackpack(int size, Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { super(size, category, item, recipeType, recipe); } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/runes/ElementalRune.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/runes/ElementalRune.java new file mode 100644 index 000000000..4b06a7de2 --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/runes/ElementalRune.java @@ -0,0 +1,35 @@ +package io.github.thebusybiscuit.slimefun4.implementation.items.magical.runes; + +import javax.annotation.Nullable; +import javax.annotation.ParametersAreNonnullByDefault; + +import org.bukkit.inventory.ItemStack; + +import io.github.thebusybiscuit.slimefun4.implementation.items.altar.AncientAltar; +import me.mrCookieSlime.Slimefun.Lists.RecipeType; +import me.mrCookieSlime.Slimefun.Objects.Category; +import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; +import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; + +/** + * An {@link ElementalRune} is a very simple and basic crafting component + * used to craft various magical gadgets. + *

+ * These runes are crafted using an {@link AncientAltar}. + * + * @author TheBusyBiscuit + * + */ +public class ElementalRune extends SlimefunItem { + + @ParametersAreNonnullByDefault + public ElementalRune(Category category, SlimefunItemStack item, ItemStack[] recipe) { + this(category, item, recipe, null); + } + + @ParametersAreNonnullByDefault + public ElementalRune(Category category, SlimefunItemStack item, ItemStack[] recipe, @Nullable ItemStack recipeResult) { + super(category, item, RecipeType.ANCIENT_ALTAR, recipe, recipeResult); + } + +} diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/misc/SyntheticEmerald.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/misc/SyntheticEmerald.java index a8fa1fb2b..8b305a078 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/misc/SyntheticEmerald.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/misc/SyntheticEmerald.java @@ -1,5 +1,7 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.misc; +import javax.annotation.ParametersAreNonnullByDefault; + import org.bukkit.entity.Villager; import org.bukkit.inventory.ItemStack; @@ -20,6 +22,7 @@ import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; */ public class SyntheticEmerald extends SlimefunItem { + @ParametersAreNonnullByDefault public SyntheticEmerald(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { super(category, item, recipeType, recipe); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosivePickaxe.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosivePickaxe.java index b019499e7..c93077f03 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosivePickaxe.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosivePickaxe.java @@ -1,5 +1,7 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.tools; +import javax.annotation.ParametersAreNonnullByDefault; + import org.bukkit.block.Block; import org.bukkit.inventory.ItemStack; @@ -19,6 +21,7 @@ import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; */ public class ExplosivePickaxe extends ExplosiveTool { + @ParametersAreNonnullByDefault public ExplosivePickaxe(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { super(category, item, recipeType, recipe); } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosiveShovel.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosiveShovel.java index 1d0680fb1..05aea8d5e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosiveShovel.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosiveShovel.java @@ -1,5 +1,7 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.tools; +import javax.annotation.ParametersAreNonnullByDefault; + import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -23,6 +25,7 @@ import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; */ public class ExplosiveShovel extends ExplosiveTool { + @ParametersAreNonnullByDefault public ExplosiveShovel(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { super(category, item, recipeType, recipe); } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/HerculesPickaxe.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/HerculesPickaxe.java index f60e49333..3ef33e21c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/HerculesPickaxe.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/HerculesPickaxe.java @@ -1,5 +1,7 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.tools; +import javax.annotation.ParametersAreNonnullByDefault; + import org.bukkit.Material; import org.bukkit.inventory.ItemStack; @@ -7,12 +9,14 @@ import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.slimefun4.core.handlers.ToolUseHandler; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; +import io.github.thebusybiscuit.slimefun4.utils.tags.SlimefunTag; import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; public class HerculesPickaxe extends SimpleSlimefunItem { + @ParametersAreNonnullByDefault public HerculesPickaxe(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { super(category, item, recipeType, recipe); } @@ -20,7 +24,7 @@ public class HerculesPickaxe extends SimpleSlimefunItem { @Override public ToolUseHandler getItemHandler() { return (e, tool, fortune, drops) -> { - if (e.getBlock().getType().toString().endsWith("_ORE")) { + if (SlimefunTag.ORES.isTagged(e.getBlock().getType())) { if (e.getBlock().getType() == Material.IRON_ORE) { drops.add(new CustomItem(SlimefunItems.IRON_DUST, 2)); } else if (e.getBlock().getType() == Material.GOLD_ORE) { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/PickaxeOfContainment.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/PickaxeOfContainment.java index 7086c7897..8bca53ecc 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/PickaxeOfContainment.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/PickaxeOfContainment.java @@ -1,6 +1,7 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.tools; import javax.annotation.Nonnull; +import javax.annotation.ParametersAreNonnullByDefault; import org.bukkit.Material; import org.bukkit.block.Block; @@ -34,6 +35,7 @@ import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; */ public class PickaxeOfContainment extends SimpleSlimefunItem { + @ParametersAreNonnullByDefault public PickaxeOfContainment(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { super(category, item, recipeType, recipe); } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/PortableDustbin.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/PortableDustbin.java index 9d785b3bf..c01d11362 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/PortableDustbin.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/PortableDustbin.java @@ -1,5 +1,7 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.tools; +import javax.annotation.ParametersAreNonnullByDefault; + import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Sound; @@ -15,6 +17,7 @@ import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; public class PortableDustbin extends SimpleSlimefunItem implements NotPlaceable { + @ParametersAreNonnullByDefault public PortableDustbin(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { super(category, item, recipeType, recipe); } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java index 3a6fcfd87..5a80cb96f 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.List; import javax.annotation.Nonnull; +import javax.annotation.ParametersAreNonnullByDefault; import org.bukkit.Material; import org.bukkit.NamespacedKey; @@ -141,6 +142,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.items.magical.MagicEyeO import io.github.thebusybiscuit.slimefun4.implementation.items.magical.MagicalZombiePills; import io.github.thebusybiscuit.slimefun4.implementation.items.magical.SoulboundItem; import io.github.thebusybiscuit.slimefun4.implementation.items.magical.TelepositionScroll; +import io.github.thebusybiscuit.slimefun4.implementation.items.magical.runes.ElementalRune; import io.github.thebusybiscuit.slimefun4.implementation.items.magical.runes.EnchantmentRune; import io.github.thebusybiscuit.slimefun4.implementation.items.magical.runes.SoulboundRune; import io.github.thebusybiscuit.slimefun4.implementation.items.magical.runes.VillagerRune; @@ -1952,41 +1954,41 @@ public final class SlimefunItemSetup { new ItemStack[] {null, SlimefunItems.GPS_TRANSMITTER_3, null, new ItemStack(Material.DIAMOND_SWORD), SlimefunItems.PROGRAMMABLE_ANDROID_3, new ItemStack(Material.DIAMOND_SWORD), null, SlimefunItems.ELECTRIC_MOTOR, null}) .register(plugin); - new SlimefunItem(categories.magicalResources, SlimefunItems.BLANK_RUNE, RecipeType.ANCIENT_ALTAR, + new ElementalRune(categories.magicalResources, SlimefunItems.BLANK_RUNE, new ItemStack[] {new ItemStack(Material.STONE), SlimefunItems.MAGIC_LUMP_1, new ItemStack(Material.STONE), SlimefunItems.MAGIC_LUMP_1, new ItemStack(Material.OBSIDIAN), SlimefunItems.MAGIC_LUMP_1, new ItemStack(Material.STONE), SlimefunItems.MAGIC_LUMP_1, new ItemStack(Material.STONE)}) .register(plugin); - new SlimefunItem(categories.magicalResources, SlimefunItems.AIR_RUNE, RecipeType.ANCIENT_ALTAR, + new ElementalRune(categories.magicalResources, SlimefunItems.AIR_RUNE, new ItemStack[] {new ItemStack(Material.FEATHER), SlimefunItems.MAGIC_LUMP_1, new ItemStack(Material.FEATHER), new ItemStack(Material.GHAST_TEAR), SlimefunItems.BLANK_RUNE, new ItemStack(Material.GHAST_TEAR), new ItemStack(Material.FEATHER), SlimefunItems.MAGIC_LUMP_1, new ItemStack(Material.FEATHER)}, new SlimefunItemStack(SlimefunItems.AIR_RUNE, 4)) .register(plugin); - new SlimefunItem(categories.magicalResources, SlimefunItems.EARTH_RUNE, RecipeType.ANCIENT_ALTAR, + new ElementalRune(categories.magicalResources, SlimefunItems.EARTH_RUNE, new ItemStack[] {new ItemStack(Material.DIRT), SlimefunItems.MAGIC_LUMP_1, new ItemStack(Material.STONE), new ItemStack(Material.OBSIDIAN), SlimefunItems.BLANK_RUNE, new ItemStack(Material.OBSIDIAN), new ItemStack(Material.STONE), SlimefunItems.MAGIC_LUMP_1, new ItemStack(Material.DIRT)}, new SlimefunItemStack(SlimefunItems.EARTH_RUNE, 4)) .register(plugin); - new SlimefunItem(categories.magicalResources, SlimefunItems.FIRE_RUNE, RecipeType.ANCIENT_ALTAR, + new ElementalRune(categories.magicalResources, SlimefunItems.FIRE_RUNE, new ItemStack[] {new ItemStack(Material.FIRE_CHARGE), SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.FIRE_CHARGE), new ItemStack(Material.BLAZE_POWDER), SlimefunItems.EARTH_RUNE, new ItemStack(Material.FLINT_AND_STEEL), new ItemStack(Material.FIRE_CHARGE), SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.FIRE_CHARGE)}, new SlimefunItemStack(SlimefunItems.FIRE_RUNE, 4)) .register(plugin); - new SlimefunItem(categories.magicalResources, SlimefunItems.WATER_RUNE, RecipeType.ANCIENT_ALTAR, + new ElementalRune(categories.magicalResources, SlimefunItems.WATER_RUNE, new ItemStack[] {new ItemStack(Material.SALMON), SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.WATER_BUCKET), new ItemStack(Material.SAND), SlimefunItems.BLANK_RUNE, new ItemStack(Material.SAND), new ItemStack(Material.WATER_BUCKET), SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.COD)}, new SlimefunItemStack(SlimefunItems.WATER_RUNE, 4)) .register(plugin); - new SlimefunItem(categories.magicalResources, SlimefunItems.ENDER_RUNE, RecipeType.ANCIENT_ALTAR, + new ElementalRune(categories.magicalResources, SlimefunItems.ENDER_RUNE, new ItemStack[] {new ItemStack(Material.ENDER_PEARL), SlimefunItems.ENDER_LUMP_3, new ItemStack(Material.ENDER_PEARL), new ItemStack(Material.ENDER_EYE), SlimefunItems.BLANK_RUNE, new ItemStack(Material.ENDER_EYE), new ItemStack(Material.ENDER_PEARL), SlimefunItems.ENDER_LUMP_3, new ItemStack(Material.ENDER_PEARL)}, new SlimefunItemStack(SlimefunItems.ENDER_RUNE, 6)) .register(plugin); - new SlimefunItem(categories.magicalResources, SlimefunItems.LIGHTNING_RUNE, RecipeType.ANCIENT_ALTAR, + new ElementalRune(categories.magicalResources, SlimefunItems.LIGHTNING_RUNE, new ItemStack[] {new ItemStack(Material.IRON_INGOT), SlimefunItems.MAGIC_LUMP_3, new ItemStack(Material.IRON_INGOT), SlimefunItems.AIR_RUNE, new ItemStack(Material.PHANTOM_MEMBRANE), SlimefunItems.WATER_RUNE, new ItemStack(Material.IRON_INGOT), SlimefunItems.MAGIC_LUMP_3, new ItemStack(Material.IRON_INGOT)}, new SlimefunItemStack(SlimefunItems.LIGHTNING_RUNE, 4)) .register(plugin); - new SlimefunItem(categories.magicalResources, SlimefunItems.RAINBOW_RUNE, RecipeType.ANCIENT_ALTAR, + new ElementalRune(categories.magicalResources, SlimefunItems.RAINBOW_RUNE, new ItemStack[] {new ItemStack(Material.RED_DYE), SlimefunItems.MAGIC_LUMP_3, new ItemStack(Material.CYAN_DYE), new ItemStack(Material.WHITE_WOOL), SlimefunItems.ENDER_RUNE, new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.YELLOW_DYE), SlimefunItems.ENDER_LUMP_3, new ItemStack(Material.MAGENTA_DYE)}) .register(plugin); @@ -2621,6 +2623,7 @@ public final class SlimefunItemSetup { // @formatter:on } + @ParametersAreNonnullByDefault private static void registerArmorSet(Category category, ItemStack baseComponent, ItemStack[] items, String idSyntax, boolean vanilla, PotionEffect[][] effects, SlimefunAddon addon) { String[] components = new String[] { "_HELMET", "_CHESTPLATE", "_LEGGINGS", "_BOOTS" }; List recipes = new ArrayList<>();