diff --git a/.github/renovate.json b/.github/renovate.json index f45d8f110c..b42c4fba1a 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -1,5 +1,5 @@ { "extends": [ - "config:base" + "config:recommended" ] } diff --git a/.github/workflows/auto-squash.yml b/.github/workflows/auto-squash.yml index 5357b8464c..8b8ef1f434 100644 --- a/.github/workflows/auto-squash.yml +++ b/.github/workflows/auto-squash.yml @@ -22,7 +22,7 @@ jobs: steps: - name: Auto squash - uses: pascalgn/automerge-action@v0.16.2 + uses: pascalgn/automerge-action@v0.16.4 env: GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} UPDATE_RETRIES: 0 @@ -42,7 +42,7 @@ jobs: steps: - name: Auto squash - uses: pascalgn/automerge-action@v0.16.2 + uses: pascalgn/automerge-action@v0.16.4 env: GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} UPDATE_RETRIES: 0 diff --git a/.github/workflows/discord-webhook.yml b/.github/workflows/discord-webhook.yml index 18059867f0..6735d5d642 100644 --- a/.github/workflows/discord-webhook.yml +++ b/.github/workflows/discord-webhook.yml @@ -21,10 +21,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4.1.1 + uses: actions/checkout@v4.2.2 - name: Set up Java JDK 21 - uses: actions/setup-java@v4.0.0 + uses: actions/setup-java@v4.6.0 with: distribution: 'adopt' java-version: '21' diff --git a/.github/workflows/e2e-testing.yml b/.github/workflows/e2e-testing.yml index 1c77c2c25d..e6be9ca39a 100644 --- a/.github/workflows/e2e-testing.yml +++ b/.github/workflows/e2e-testing.yml @@ -37,7 +37,7 @@ jobs: uses: actions/checkout@v4 - name: Set up JDK - uses: actions/setup-java@v4.0.0 + uses: actions/setup-java@v4.6.0 with: distribution: temurin java-version: ${{ matrix.javaVersion }} diff --git a/.github/workflows/javadocs.yml b/.github/workflows/javadocs.yml index 7755d9668c..f628c2a692 100644 --- a/.github/workflows/javadocs.yml +++ b/.github/workflows/javadocs.yml @@ -19,7 +19,7 @@ jobs: uses: actions/checkout@v4 - name: Set up JDK 21 - uses: actions/setup-java@v4.0.0 + uses: actions/setup-java@v4.6.0 with: distribution: 'adopt' java-version: '21' diff --git a/.github/workflows/maven-compiler.yml b/.github/workflows/maven-compiler.yml index e61904358f..fa79dc66ca 100644 --- a/.github/workflows/maven-compiler.yml +++ b/.github/workflows/maven-compiler.yml @@ -28,7 +28,7 @@ jobs: uses: actions/checkout@v4 - name: Set up JDK 21 - uses: actions/setup-java@v4.0.0 + uses: actions/setup-java@v4.6.0 with: distribution: 'adopt' java-version: '21' diff --git a/.github/workflows/publish-build.yml b/.github/workflows/publish-build.yml index bec223fc56..31e94e16a2 100644 --- a/.github/workflows/publish-build.yml +++ b/.github/workflows/publish-build.yml @@ -5,6 +5,7 @@ on: branches: - master - stable + - experimental jobs: publish: @@ -16,7 +17,7 @@ jobs: - uses: actions/checkout@v4 - name: Set up JDK 21 - uses: actions/setup-java@v3.13.0 + uses: actions/setup-java@v4.6.0 with: distribution: 'adopt' java-version: '21' @@ -26,11 +27,32 @@ jobs: - name: Build with Maven run: mvn clean package - - name: Upload to Blob Builds - uses: WalshyDev/blob-builds/gh-action@f3da5ce7b7e2b70eb963e0c0014677b3d78c10fa + - name: Upload Dev build + uses: WalshyDev/blob-builds/gh-action@ea9ecd9266c902c6627f884e657560d0fa6b61dd + if: github.ref == 'refs/heads/master' with: project: Slimefun4 - releaseChannel: ${{ github.ref == 'refs/heads/master' && 'Dev' || 'RC' }} + releaseChannel: Dev + apiToken: ${{ secrets.BLOB_BUILDS_API_TOKEN }} + file: './target/Slimefun v4.9-UNOFFICIAL.jar' + releaseNotes: ${{ github.event.head_commit.message }} + + - name: Upload RC build + uses: WalshyDev/blob-builds/gh-action@ea9ecd9266c902c6627f884e657560d0fa6b61dd + if: github.ref == 'refs/heads/stable' + with: + project: Slimefun4 + releaseChannel: 'RC' + apiToken: ${{ secrets.BLOB_BUILDS_API_TOKEN }} + file: './target/Slimefun v4.9-UNOFFICIAL.jar' + releaseNotes: ${{ github.event.head_commit.message }} + + - name: Upload Experimental build + uses: WalshyDev/blob-builds/gh-action@ea9ecd9266c902c6627f884e657560d0fa6b61dd + if: github.ref == 'refs/heads/experimental' + with: + project: Slimefun4 + releaseChannel: 'Experimental' apiToken: ${{ secrets.BLOB_BUILDS_API_TOKEN }} file: './target/Slimefun v4.9-UNOFFICIAL.jar' releaseNotes: ${{ github.event.head_commit.message }} diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index a02a240233..28e0d47a98 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -22,7 +22,7 @@ jobs: uses: actions/checkout@v4 - name: Set up JDK 21 - uses: actions/setup-java@v4.0.0 + uses: actions/setup-java@v4.6.0 with: distribution: 'adopt' java-version: '21' diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 923db63442..2702fbb6c8 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -19,12 +19,12 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4.1.1 + uses: actions/checkout@v4.2.2 with: fetch-depth: 0 - name: Set up JDK 21 - uses: actions/setup-java@v4.0.0 + uses: actions/setup-java@v4.6.0 with: distribution: 'adopt' java-version: '21' diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000..adb7fb8632 --- /dev/null +++ b/Makefile @@ -0,0 +1,12 @@ +default: help + +.PHONY: help +help: + @echo " * gen-biomes version= - Generate biomes for the given version" + +.PHONY: gen-biomes +gen-biomes: + @echo "Generating biomes for $(version)" + @curl "https://raw.githubusercontent.com/MockBukkit/MockBukkit/refs/heads/v$(version)/src/main/resources/keyed/worldgen/biome.json" -s \ + | jq '[ .values[].key]' \ + > "src/test/resources/biomes/$(version).x.json" diff --git a/pom.xml b/pom.xml index 5bc0d0d651..65280d4459 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ jar - Slimefun is a Spigot/Paper plugin that simulates a modpack-like atmosphere by adding over 500 new items and recipes to your Minecraft Server. + Slimefun is a Paper plugin that simulates a modpack-like atmosphere by adding over 500 new items and recipes to your Minecraft Server. https://github.com/Slimefun/Slimefun4 @@ -29,8 +29,8 @@ 21 - 1.20.6 - https://hub.spigotmc.org/javadocs/spigot/ + 1.21.1 + https://hub.spigotmc.org/javadocs/spigot/ Slimefun_Slimefun4 @@ -149,7 +149,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.3.1 + 3.5.2 org.junit.jupiter:junit-jupiter @@ -161,14 +161,14 @@ org.sonarsource.scanner.maven sonar-maven-plugin - 3.10.0.2594 + 5.0.0.4389 org.jacoco jacoco-maven-plugin - 0.8.11 + 0.8.12 @@ -194,7 +194,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.5.1 + 3.6.0 @@ -238,7 +238,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.7.0 + 3.11.2 ${project.basedir} @@ -251,7 +251,7 @@ - ${spigot.javadocs} + ${paper.javadocs} @@ -337,7 +337,7 @@ org.junit junit-bom - 5.10.3 + 5.11.4 pom import @@ -354,10 +354,17 @@ + + + com.github.Slimefun.dough + dough-api + cb22e71335 + compile + - com.github.baked-libs.dough + com.github.Slimefun.dough dough-api - f8ff25187d + cb22e71335 compile @@ -367,6 +374,14 @@ compile + + + io.papermc.paper + paper-api + ${paper.version}-R0.1-SNAPSHOT + provided + + org.junit.jupiter @@ -376,20 +391,20 @@ org.mockito mockito-core - 5.10.0 + 5.15.2 test org.slf4j slf4j-simple - 2.0.9 + 2.0.16 test - com.github.MockBukkit - MockBukkit - c7cc678834 + com.github.seeseemelk + MockBukkit-v1.21 + 3.133.2 test @@ -401,19 +416,12 @@ - - - io.papermc.paper - paper-api - 1.20.6-R0.1-SNAPSHOT - test - com.sk89q.worldedit worldedit-core - 7.2.19 + 7.3.9 provided @@ -427,7 +435,7 @@ com.sk89q.worldedit worldedit-bukkit - 7.2.19 + 7.3.9 provided @@ -441,7 +449,7 @@ com.gmail.nossr50.mcMMO mcMMO - 2.1.230 + 2.2.029 provided @@ -455,7 +463,7 @@ me.clip placeholderapi - 2.11.5 + 2.11.6 provided @@ -515,12 +523,6 @@ 2.6 compile - - org.spigotmc - spigot-api - ${spigot.version}-R0.1-SNAPSHOT - provided - com.mojang authlib diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java index 4fc0160ac6..afad06e3bc 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java @@ -55,6 +55,12 @@ public enum MinecraftVersion { */ MINECRAFT_1_20_5(20, 5, "1.20.5+"), + /** + * This constant represents Minecraft (Java Edition) Version 1.21 + * ("Tricky Trials") + */ + MINECRAFT_1_21(21, 0, "1.21.x"), + /** * This constant represents an exceptional state in which we were unable * to identify the Minecraft Version we are using diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/exceptions/WrongItemStackException.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/exceptions/WrongItemStackException.java deleted file mode 100644 index ef1c9e6c46..0000000000 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/exceptions/WrongItemStackException.java +++ /dev/null @@ -1,39 +0,0 @@ -package io.github.thebusybiscuit.slimefun4.api.exceptions; - -import javax.annotation.ParametersAreNonnullByDefault; - -import org.bukkit.inventory.ItemStack; - -import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem; -import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack; -import io.github.thebusybiscuit.slimefun4.core.attributes.DamageableItem; - -/** - * A {@link WrongItemStackException} is thrown when someone tries to alter an {@link ItemStack} - * but actually wanted to alter a different one. - * - * If for example a {@link DamageableItem} accidentally damages the original {@link SlimefunItem} - * instead of the held {@link ItemStack}, this will be thrown. - * - * @author TheBusyBiscuit - * - * @see SlimefunItemStack - * @see SlimefunItem - * - */ -public class WrongItemStackException extends RuntimeException { - - private static final long serialVersionUID = 9144658137363309071L; - - /** - * This constructs a new {@link WrongItemStackException} with the given error context. - * - * @param message - * An error message to display - */ - @ParametersAreNonnullByDefault - public WrongItemStackException(String message) { - super("You probably wanted to alter a different ItemStack: " + message); - } - -} diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/geo/ResourceManager.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/geo/ResourceManager.java index ce4fea9b02..e88ec4e15e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/geo/ResourceManager.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/geo/ResourceManager.java @@ -38,9 +38,9 @@ /** * The {@link ResourceManager} is responsible for registering and managing a {@link GEOResource}. * You have to use the {@link ResourceManager} if you want to generate or consume a {@link GEOResource} too. - * + * * @author TheBusyBiscuit - * + * * @see GEOResource * @see GEOMiner * @see GEOScanner @@ -53,7 +53,7 @@ public class ResourceManager { /** * This will create a new {@link ResourceManager}. - * + * * @param plugin * Our {@link Slimefun} instance */ @@ -64,7 +64,7 @@ public ResourceManager(@Nonnull Slimefun plugin) { /** * This method registers the given {@link GEOResource}. * It may never be called directly, use {@link GEOResource#register()} instead. - * + * * @param resource * The {@link GEOResource} to register */ @@ -93,7 +93,7 @@ void register(@Nonnull GEOResource resource) { * This method returns the amount of a certain {@link GEOResource} found in a given {@link Chunk}. * The result is an {@link OptionalInt} which will be empty if this {@link GEOResource} * has not been generated at that {@link Location} yet. - * + * * @param resource * The {@link GEOResource} to query * @param world @@ -102,7 +102,7 @@ void register(@Nonnull GEOResource resource) { * The {@link Chunk} x coordinate * @param z * The {@link Chunk} z coordinate - * + * * @return An {@link OptionalInt}, either empty or containing the amount of the given {@link GEOResource} */ public @Nonnull OptionalInt getSupplies(@Nonnull GEOResource resource, @Nonnull World world, int x, int z) { @@ -121,7 +121,7 @@ void register(@Nonnull GEOResource resource) { /** * This method will set the supplies in a given {@link Chunk} to the specified value. - * + * * @param resource * The {@link GEOResource} * @param world @@ -147,7 +147,7 @@ public void setSupplies(@Nonnull GEOResource resource, @Nonnull World world, int *

* This method will invoke {@link #setSupplies(GEOResource, World, int, int, int)} and also calls a * {@link GEOResourceGenerationEvent}. - * + * * @param resource * The {@link GEOResource} to generate * @param world @@ -156,7 +156,7 @@ public void setSupplies(@Nonnull GEOResource resource, @Nonnull World world, int * The x coordinate of that {@link Chunk} * @param z * The z coordinate of that {@link Chunk} - * + * * @return The new supply value */ private int generate(@Nonnull GEOResource resource, @Nonnull World world, int x, int y, int z) { @@ -199,11 +199,11 @@ private int generate(@Nonnull GEOResource resource, @Nonnull World world, int x, /** * This method will start a geo-scan at the given {@link Block} and display the result * of that scan to the given {@link Player}. - * + * * Note that scans are always per {@link Chunk}, not per {@link Block}, the {@link Block} * parameter only determines the {@link Location} that was clicked but it will still scan * the entire {@link Chunk}. - * + * * @param p * The {@link Player} who requested these results * @param block @@ -227,7 +227,7 @@ public void scan(@Nonnull Player p, @Nonnull Block block, int page) { menu.addItem(slot, ChestMenuUtils.getBackground(), ChestMenuUtils.getEmptyClickHandler()); } - menu.addItem(4, new CustomItemStack(HeadTexture.MINECRAFT_CHUNK.getAsItemStack(), ChatColor.YELLOW + Slimefun.getLocalization().getResourceString(p, "tooltips.chunk"), "", "&8\u21E8 &7" + Slimefun.getLocalization().getResourceString(p, "tooltips.world") + ": " + block.getWorld().getName(), "&8\u21E8 &7X: " + x + " Z: " + z), ChestMenuUtils.getEmptyClickHandler()); + menu.addItem(4, CustomItemStack.create(HeadTexture.MINECRAFT_CHUNK.getAsItemStack(), ChatColor.YELLOW + Slimefun.getLocalization().getResourceString(p, "tooltips.chunk"), "", "&8\u21E8 &7" + Slimefun.getLocalization().getResourceString(p, "tooltips.world") + ": " + block.getWorld().getName(), "&8\u21E8 &7X: " + x + " Z: " + z), ChestMenuUtils.getEmptyClickHandler()); List resources = new ArrayList<>(Slimefun.getRegistry().getGEOResources().values()); resources.sort(Comparator.comparing(a -> a.getName(p).toLowerCase(Locale.ROOT))); @@ -240,7 +240,7 @@ public void scan(@Nonnull Player p, @Nonnull Block block, int page) { int supplies = optional.orElseGet(() -> generate(resource, block.getWorld(), x, block.getY(), z)); String suffix = Slimefun.getLocalization().getResourceString(p, ChatUtils.checkPlurality("tooltips.unit", supplies)); - ItemStack item = new CustomItemStack(resource.getItem(), "&f" + resource.getName(p), "&8\u21E8 &e" + supplies + ' ' + suffix); + ItemStack item = CustomItemStack.create(resource.getItem(), "&f" + resource.getName(p), "&8\u21E8 &e" + supplies + ' ' + suffix); if (supplies > 1) { item.setAmount(Math.min(supplies, item.getMaxStackSize())); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/gps/GPSNetwork.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/gps/GPSNetwork.java index 47574fb2ca..8d3a951188 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/gps/GPSNetwork.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/gps/GPSNetwork.java @@ -44,9 +44,9 @@ * The {@link GPSNetwork} is a manager class for all {@link GPSTransmitter Transmitters} and waypoints. * There can only be one instance of this class per {@link Server}. * It is also responsible for teleportation and resource management. - * + * * @author TheBusyBiscuit - * + * * @see TeleportationManager * @see ResourceManager * @@ -64,7 +64,7 @@ public class GPSNetwork { /** * This constructs a new {@link GPSNetwork}. * Note that this network is per {@link Server} and not per {@link Player}. - * + * * @param plugin * Our {@link Slimefun} instance */ @@ -74,7 +74,7 @@ public GPSNetwork(@Nonnull Slimefun plugin) { /** * This method updates the status of a {@link GPSTransmitter}. - * + * * @param l * The {@link Location} of the {@link GPSTransmitter} * @param uuid @@ -96,10 +96,10 @@ public void updateTransmitter(@Nonnull Location l, @Nonnull UUID uuid, boolean o * This method calculates the GPS complexity for the given {@link UUID}. * The complexity is determined by the Y level of each {@link GPSTransmitter} * multiplied by the multiplier of that transmitter. - * + * * @param uuid * The {@link UUID} who to calculate it for - * + * * @return The network complexity for that {@link UUID} */ public int getNetworkComplexity(@Nonnull UUID uuid) { @@ -124,10 +124,10 @@ public int getNetworkComplexity(@Nonnull UUID uuid) { /** * This method returns the amount of {@link GPSTransmitter Transmitters} for the * given {@link UUID}. - * + * * @param uuid * The {@link UUID} who these transmitters belong to - * + * * @return The amount of transmitters */ public int countTransmitters(@Nonnull UUID uuid) { @@ -138,7 +138,7 @@ public int countTransmitters(@Nonnull UUID uuid) { /** * This method opens the {@link GPSTransmitter} control panel to the given * {@link Player}. - * + * * @param p * The {@link Player} */ @@ -149,7 +149,7 @@ public void openTransmitterControlPanel(@Nonnull Player p) { menu.addItem(slot, ChestMenuUtils.getBackground(), ChestMenuUtils.getEmptyClickHandler()); } - menu.addItem(2, new CustomItemStack(SlimefunItems.GPS_TRANSMITTER, im -> { + menu.addItem(2, CustomItemStack.create(SlimefunItems.GPS_TRANSMITTER.item(), im -> { im.setDisplayName(ChatColor.GRAY + Slimefun.getLocalization().getMessage(p, "machines.GPS_CONTROL_PANEL.transmitters")); im.setLore(null); })); @@ -157,10 +157,10 @@ public void openTransmitterControlPanel(@Nonnull Player p) { menu.addMenuClickHandler(2, ChestMenuUtils.getEmptyClickHandler()); int complexity = getNetworkComplexity(p.getUniqueId()); - menu.addItem(4, new CustomItemStack(SlimefunItems.GPS_CONTROL_PANEL, "&7Network Info", "", "&8\u21E8 &7Status: " + getStatusText(p, complexity), "&8\u21E8 &7Complexity: &f" + complexity)); + menu.addItem(4, CustomItemStack.create(SlimefunItems.GPS_CONTROL_PANEL.item(), "&7Network Info", "", "&8\u21E8 &7Status: " + getStatusText(p, complexity), "&8\u21E8 &7Complexity: &f" + complexity)); menu.addMenuClickHandler(4, ChestMenuUtils.getEmptyClickHandler()); - menu.addItem(6, new CustomItemStack(HeadTexture.GLOBE_OVERWORLD.getAsItemStack(), "&7" + Slimefun.getLocalization().getMessage(p, "machines.GPS_CONTROL_PANEL.waypoints"), "", ChatColor.GRAY + "\u21E8 " + Slimefun.getLocalization().getMessage(p, "guide.tooltips.open-itemgroup"))); + menu.addItem(6, CustomItemStack.create(HeadTexture.GLOBE_OVERWORLD.getAsItemStack(), "&7" + Slimefun.getLocalization().getMessage(p, "machines.GPS_CONTROL_PANEL.waypoints"), "", ChatColor.GRAY + "\u21E8 " + Slimefun.getLocalization().getMessage(p, "guide.tooltips.open-itemgroup"))); menu.addMenuClickHandler(6, (pl, slot, item, action) -> { openWaypointControlPanel(pl); return false; @@ -177,7 +177,7 @@ public void openTransmitterControlPanel(@Nonnull Player p) { if (sfi instanceof GPSTransmitter transmitter) { int slot = inventory[index]; - menu.addItem(slot, new CustomItemStack(SlimefunItems.GPS_TRANSMITTER, "&bGPS Transmitter", "&8\u21E8 &7World: &f" + l.getWorld().getName(), "&8\u21E8 &7X: &f" + l.getX(), "&8\u21E8 &7Y: &f" + l.getY(), "&8\u21E8 &7Z: &f" + l.getZ(), "", "&8\u21E8 &7Signal Strength: &f" + transmitter.getMultiplier(l.getBlockY()), "&8\u21E8 &7Ping: &f" + NumberUtils.roundDecimalNumber(1000D / l.getY()) + "ms")); + menu.addItem(slot, CustomItemStack.create(SlimefunItems.GPS_TRANSMITTER.item(), "&bGPS Transmitter", "&8\u21E8 &7World: &f" + l.getWorld().getName(), "&8\u21E8 &7X: &f" + l.getX(), "&8\u21E8 &7Y: &f" + l.getY(), "&8\u21E8 &7Z: &f" + l.getZ(), "", "&8\u21E8 &7Signal Strength: &f" + transmitter.getMultiplier(l.getBlockY()), "&8\u21E8 &7Ping: &f" + NumberUtils.roundDecimalNumber(1000D / l.getY()) + "ms")); menu.addMenuClickHandler(slot, ChestMenuUtils.getEmptyClickHandler()); index++; @@ -192,14 +192,14 @@ public void openTransmitterControlPanel(@Nonnull Player p) { * The icon is dependent on the {@link Environment} of the waypoint's {@link World}. * However if the name of this waypoint indicates that this is actually a deathmarker * then a different texture will be used. - * + * * Otherwise it will return a globe, a nether or end sphere according to the {@link Environment}. - * + * * @param name * The name of a waypoint * @param environment * The {@link Environment} of the waypoint's {@link World} - * + * * @return An icon for this waypoint */ @ParametersAreNonnullByDefault @@ -232,17 +232,17 @@ public void openWaypointControlPanel(@Nonnull Player p) { menu.addItem(slot, ChestMenuUtils.getBackground(), ChestMenuUtils.getEmptyClickHandler()); } - menu.addItem(2, new CustomItemStack(SlimefunItems.GPS_TRANSMITTER, "&7" + Slimefun.getLocalization().getMessage(p, "machines.GPS_CONTROL_PANEL.transmitters"), "", ChatColor.GRAY + "\u21E8 " + Slimefun.getLocalization().getMessage(p, "guide.tooltips.open-itemgroup"))); + menu.addItem(2, CustomItemStack.create(SlimefunItems.GPS_TRANSMITTER.item(), "&7" + Slimefun.getLocalization().getMessage(p, "machines.GPS_CONTROL_PANEL.transmitters"), "", ChatColor.GRAY + "\u21E8 " + Slimefun.getLocalization().getMessage(p, "guide.tooltips.open-itemgroup"))); menu.addMenuClickHandler(2, (pl, slot, item, action) -> { openTransmitterControlPanel(pl); return false; }); int complexity = getNetworkComplexity(p.getUniqueId()); - menu.addItem(4, new CustomItemStack(SlimefunItems.GPS_CONTROL_PANEL, "&7Network Info", "", "&8\u21E8 &7Status: " + (complexity > 0 ? "&2&lONLINE" : "&4&lOFFLINE"), "&8\u21E8 &7Complexity: &f" + complexity)); + menu.addItem(4, CustomItemStack.create(SlimefunItems.GPS_CONTROL_PANEL.item(), "&7Network Info", "", "&8\u21E8 &7Status: " + (complexity > 0 ? "&2&lONLINE" : "&4&lOFFLINE"), "&8\u21E8 &7Complexity: &f" + complexity)); menu.addMenuClickHandler(4, ChestMenuUtils.getEmptyClickHandler()); - menu.addItem(6, new CustomItemStack(HeadTexture.GLOBE_OVERWORLD.getAsItemStack(), "&7" + Slimefun.getLocalization().getMessage(p, "machines.GPS_CONTROL_PANEL.waypoints"))); + menu.addItem(6, CustomItemStack.create(HeadTexture.GLOBE_OVERWORLD.getAsItemStack(), "&7" + Slimefun.getLocalization().getMessage(p, "machines.GPS_CONTROL_PANEL.waypoints"))); menu.addMenuClickHandler(6, ChestMenuUtils.getEmptyClickHandler()); int index = 0; @@ -254,7 +254,7 @@ public void openWaypointControlPanel(@Nonnull Player p) { int slot = inventory[index]; Location l = waypoint.getLocation(); - menu.addItem(slot, new CustomItemStack(waypoint.getIcon(), waypoint.getName().replace("player:death ", ""), "&8\u21E8 &7World: &f" + l.getWorld().getName(), "&8\u21E8 &7X: &f" + l.getX(), "&8\u21E8 &7Y: &f" + l.getY(), "&8\u21E8 &7Z: &f" + l.getZ(), "", "&8\u21E8 &cClick to delete")); + menu.addItem(slot, CustomItemStack.create(waypoint.getIcon(), waypoint.getName().replace("player:death ", ""), "&8\u21E8 &7World: &f" + l.getWorld().getName(), "&8\u21E8 &7X: &f" + l.getX(), "&8\u21E8 &7Y: &f" + l.getY(), "&8\u21E8 &7Z: &f" + l.getZ(), "", "&8\u21E8 &cClick to delete")); menu.addMenuClickHandler(slot, (pl, s, item, action) -> { profile.removeWaypoint(waypoint); SoundEffect.GPS_NETWORK_OPEN_PANEL_SOUND.playFor(p); @@ -273,7 +273,7 @@ public void openWaypointControlPanel(@Nonnull Player p) { /** * This method will prompt the given {@link Player} to enter a name for a waypoint. * After entering the name, it will be added to his waypoint list. - * + * * @param p * The {@link Player} who should get a new waypoint * @param l @@ -298,7 +298,7 @@ public void createWaypoint(@Nonnull Player p, @Nonnull Location l) { /** * This method adds a new waypoint with the given name and {@link Location} for that {@link Player}. - * + * * @param p * The {@link Player} to get the new waypoint * @param name @@ -343,10 +343,10 @@ public void addWaypoint(@Nonnull Player p, @Nonnull String name, @Nonnull Locati /** * This method returns a {@link Set} of {@link Location Locations} for all {@link GPSTransmitter Transmitters} * owned by the given {@link UUID}. - * + * * @param uuid * The {@link UUID} owning those transmitters - * + * * @return A {@link Set} with all {@link Location Locations} of transmitters for this {@link UUID} */ @Nonnull @@ -357,7 +357,7 @@ public Set getTransmitters(@Nonnull UUID uuid) { /** * This returns the {@link TeleportationManager} for this {@link GPSNetwork}. * It is responsible for all actions that relate to the {@link Teleporter}. - * + * * @return The {@link TeleportationManager} for this {@link GPSNetwork} */ @Nonnull @@ -368,7 +368,7 @@ public TeleportationManager getTeleportationManager() { /** * This returns the {@link ResourceManager} for this {@link GPSNetwork}. * Use this to access {@link GEOResource GEOResources}. - * + * * @return The {@link ResourceManager} for this {@link GPSNetwork} */ @Nonnull diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/gps/TeleportationManager.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/gps/TeleportationManager.java index 6f65962024..40035920ba 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/gps/TeleportationManager.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/gps/TeleportationManager.java @@ -34,9 +34,9 @@ /** * The {@link TeleportationManager} handles the process of teleportation for a {@link Player} * who is using a {@link Teleporter}. - * + * * @author TheBusyBiscuit - * + * * @see GPSNetwork * @see Teleporter * @@ -79,7 +79,7 @@ public void openTeleporterGUI(Player p, UUID ownerUUID, Block b, int complexity) menu.addItem(slot, ChestMenuUtils.getBackground(), ChestMenuUtils.getEmptyClickHandler()); } - menu.addItem(4, new CustomItemStack(HeadTexture.GLOBE_OVERWORLD.getAsItemStack(), ChatColor.YELLOW + Slimefun.getLocalization().getMessage(p, "machines.TELEPORTER.gui.title"))); + menu.addItem(4, CustomItemStack.create(HeadTexture.GLOBE_OVERWORLD.getAsItemStack(), ChatColor.YELLOW + Slimefun.getLocalization().getMessage(p, "machines.TELEPORTER.gui.title"))); menu.addMenuClickHandler(4, ChestMenuUtils.getEmptyClickHandler()); Location source = new Location(b.getWorld(), b.getX() + 0.5D, b.getY() + 2D, b.getZ() + 0.5D); @@ -107,7 +107,7 @@ public void openTeleporterGUI(Player p, UUID ownerUUID, Block b, int complexity) }; // @formatter:on - menu.addItem(slot, new CustomItemStack(waypoint.getIcon(), waypoint.getName().replace("player:death ", ""), lore)); + menu.addItem(slot, CustomItemStack.create(waypoint.getIcon(), waypoint.getName().replace("player:death ", ""), lore)); menu.addMenuClickHandler(slot, (pl, s, item, action) -> { pl.closeInventory(); teleport(pl.getUniqueId(), complexity, source, l, false); @@ -136,21 +136,21 @@ public void teleport(UUID uuid, int complexity, Location source, Location destin * to the destination {@link Location}, given the specified complexity. *

* The returned time will be measured in 500ms intervals. - * + * *

    *
  • A returned time of {@literal 100} will mean 50,000ms (50s) of real-life time.
  • *
  • A returned time of {@literal 10} will mean 5,000ms (5s) of real-life time.
  • *
  • A returned time of {@literal 2} will mean 1,000ms (1s) of real-life time.
  • *
  • and so on...
  • *
- * + * * @param complexity * The complexity of the {@link GPSNetwork} * @param source * The source {@link Location} * @param destination * The destination {@link Location} - * + * * @return The amount of time the teleportation will take */ public int getTeleportationTime(int complexity, @Nonnull Location source, @Nonnull Location destination) { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/ItemGroup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/ItemGroup.java index 81b8f331f6..8524c6a7e7 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/ItemGroup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/ItemGroup.java @@ -30,12 +30,12 @@ /** * Represents an item group, which structure * multiple {@link SlimefunItem} in the {@link SlimefunGuide}. - * + * * @author TheBusyBiscuit * * @see LockedItemGroup * @see SeasonalItemGroup - * + * */ public class ItemGroup implements Keyed { @@ -51,7 +51,7 @@ public class ItemGroup implements Keyed { * Constructs a new {@link ItemGroup} with the given {@link NamespacedKey} as an identifier * and the given {@link ItemStack} as its display item. * The tier is set to a default value of {@code 3}. - * + * * @param key * The {@link NamespacedKey} that is used to identify this {@link ItemGroup} * @param item @@ -65,7 +65,7 @@ public ItemGroup(NamespacedKey key, ItemStack item) { /** * Constructs a new {@link ItemGroup} with the given {@link NamespacedKey} as an identifier * and the given {@link ItemStack} as its display item. - * + * * @param key * The {@link NamespacedKey} that is used to identify this {@link ItemGroup} * @param item @@ -101,7 +101,7 @@ public ItemGroup(NamespacedKey key, ItemStack item, int tier) { *

* By default, an {@link ItemGroup} is automatically registered when * a {@link SlimefunItem} was added to it. - * + * * @param addon * The {@link SlimefunAddon} that wants to register this {@link ItemGroup} */ @@ -121,7 +121,7 @@ public void register(@Nonnull SlimefunAddon addon) { /** * This method returns whether this {@link ItemGroup} has been registered yet. * More specifically: Whether {@link #register(SlimefunAddon)} was called or not. - * + * * @return Whether this {@link ItemGroup} has been registered */ public boolean isRegistered() { @@ -131,7 +131,7 @@ public boolean isRegistered() { /** * Returns the tier of this {@link ItemGroup}. * The tier determines the position of this {@link ItemGroup} in the {@link SlimefunGuide}. - * + * * @return the tier of this {@link ItemGroup} */ public int getTier() { @@ -141,7 +141,7 @@ public int getTier() { /** * This sets the tier of this {@link ItemGroup}. * The tier determines the position of this {@link ItemGroup} in the {@link SlimefunGuide}. - * + * * @param tier * The tier for this {@link ItemGroup} */ @@ -165,7 +165,7 @@ private void sortCategoriesByTier() { /** * This returns the {@link SlimefunAddon} which has registered this {@link ItemGroup}. * Or null if it has not been registered yet. - * + * * @return The {@link SlimefunAddon} or null if unregistered */ public final @Nullable SlimefunAddon getAddon() { @@ -174,7 +174,7 @@ private void sortCategoriesByTier() { /** * Adds the given {@link SlimefunItem} to this {@link ItemGroup}. - * + * * @param item * the {@link SlimefunItem} that should be added to this {@link ItemGroup} */ @@ -195,7 +195,7 @@ public void add(@Nonnull SlimefunItem item) { /** * Removes the given {@link SlimefunItem} from this {@link ItemGroup}. - * + * * @param item * the {@link SlimefunItem} that should be removed from this {@link ItemGroup} */ @@ -207,14 +207,14 @@ public void remove(@Nonnull SlimefunItem item) { /** * This method returns a localized display item of this {@link ItemGroup} * for the specified {@link Player}. - * + * * @param p * The Player to create this {@link ItemStack} for - * + * * @return A localized display item for this {@link ItemGroup} */ public @Nonnull ItemStack getItem(@Nonnull Player p) { - return new CustomItemStack(item, meta -> { + return CustomItemStack.create(item, meta -> { String name = Slimefun.getLocalization().getItemGroupName(p, getKey()); if (name == null) { @@ -234,7 +234,7 @@ public void remove(@Nonnull SlimefunItem item) { /** * This method makes Walshy happy. * It adds a way to get the name of a {@link ItemGroup} without localization nor coloring. - * + * * @return The unlocalized name of this {@link ItemGroup} */ public @Nonnull String getUnlocalizedName() { @@ -244,10 +244,10 @@ public void remove(@Nonnull SlimefunItem item) { /** * This returns the localized display name of this {@link ItemGroup} for the given {@link Player}. * The method will fall back to {@link #getUnlocalizedName()} if no translation was found. - * + * * @param p * The {@link Player} who to translate the name for - * + * * @return The localized name of this {@link ItemGroup} */ public @Nonnull String getDisplayName(@Nonnull Player p) { @@ -262,7 +262,7 @@ public void remove(@Nonnull SlimefunItem item) { /** * Returns all instances of {@link SlimefunItem} bound to this {@link ItemGroup}. - * + * * @return the list of SlimefunItems bound to this {@link ItemGroup} */ public @Nonnull List getItems() { @@ -271,10 +271,10 @@ public void remove(@Nonnull SlimefunItem item) { /** * This method returns whether a given {@link SlimefunItem} exists in this {@link ItemGroup}. - * + * * @param item * The {@link SlimefunItem} to find - * + * * @return Whether the given {@link SlimefunItem} was found in this {@link ItemGroup} */ public boolean contains(@Nullable SlimefunItem item) { @@ -286,10 +286,10 @@ public boolean contains(@Nullable SlimefunItem item) { * by the given {@link Player}. If an {@link ItemGroup} is not accessible, * it will not show up in the {@link SlimefunGuide} nor will items from this * {@link ItemGroup} show up in the guide search. - * + * * @param p * The {@link Player} to check for - * + * * @return Whether this {@link ItemGroup} is accessible by the given {@link Player} */ public boolean isAccessible(@Nonnull Player p) { @@ -302,10 +302,10 @@ public boolean isAccessible(@Nonnull Player p) { * be visible. This includes {@link ItemGroup ItemGroups} where every {@link SlimefunItem} * is disabled. If an {@link ItemGroup} is not accessible by the {@link Player}, * see {@link #isAccessible(Player)}, this method will also return false. - * + * * @param p * The {@link Player} to check for - * + * * @return Whether this {@link ItemGroup} is visible to the given {@link Player} */ public boolean isVisible(@Nonnull Player p) { @@ -372,12 +372,12 @@ public String toString() { /** * This method checks whether this {@link ItemGroup} will be hidden for the specified * {@link Player}. - * + * * Categories are hidden if all of their items have been disabled. - * + * * @param p * The {@link Player} to check for - * + * * @return Whether this {@link ItemGroup} will be hidden to the given {@link Player} */ @Deprecated diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItem.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItem.java index ea3775037c..3d52b81245 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItem.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItem.java @@ -31,7 +31,6 @@ import io.github.thebusybiscuit.slimefun4.api.exceptions.IncompatibleItemHandlerException; import io.github.thebusybiscuit.slimefun4.api.exceptions.MissingDependencyException; import io.github.thebusybiscuit.slimefun4.api.exceptions.UnregisteredItemException; -import io.github.thebusybiscuit.slimefun4.api.exceptions.WrongItemStackException; import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType; import io.github.thebusybiscuit.slimefun4.api.researches.Research; @@ -153,7 +152,7 @@ public SlimefunItem(ItemGroup itemGroup, SlimefunItemStack item, RecipeType reci Validate.notNull(recipeType, "'recipeType' is not allowed to be null!"); this.itemGroup = itemGroup; - this.itemStackTemplate = item; + this.itemStackTemplate = item.item(); this.id = item.getItemId(); this.recipeType = recipeType; this.recipe = recipe; @@ -219,7 +218,7 @@ protected SlimefunItem(ItemGroup itemGroup, ItemStack item, String id, RecipeTyp * @return The {@link ItemStack} that this {@link SlimefunItem} represents */ public @Nonnull ItemStack getItem() { - return itemStackTemplate; + return itemStackTemplate.clone(); } /** @@ -500,11 +499,6 @@ public void register(@Nonnull SlimefunAddon addon) { this.itemHandlers.clear(); } - // Lock the SlimefunItemStack from any accidental manipulations - if (itemStackTemplate instanceof SlimefunItemStack stack && isItemStackImmutable()) { - stack.lock(); - } - postRegister(); // handle runtime-registrations / auto-loading @@ -580,20 +574,6 @@ private void loadItemHandlers() { } } - /** - * This method returns whether the original {@link SlimefunItemStack} of this - * {@link SlimefunItem} is immutable. - * - * If true is returned, then any changes to the original {@link SlimefunItemStack} - * will be rejected with a {@link WrongItemStackException}. - * This ensures integrity so developers don't accidentally damage the wrong {@link ItemStack}. - * - * @return Whether the original {@link SlimefunItemStack} is immutable. - */ - protected boolean isItemStackImmutable() { - return true; - } - /** * This method checks if the dependencies have been set up correctly. * @@ -773,11 +753,6 @@ public boolean isItem(@Nullable ItemStack item) { return false; } - // If the given item is a SlimefunitemStack, simply compare the id - if (item instanceof SlimefunItemStack stack) { - return getId().equals(stack.getItemId()); - } - if (item.hasItemMeta()) { Optional itemId = Slimefun.getItemDataService().getItemData(item); @@ -912,14 +887,6 @@ public final void addOfficialWikipage(@Nonnull String page) { * @return This item's name in {@link ItemStack} form */ public final @Nonnull String getItemName() { - if (itemStackTemplate instanceof SlimefunItemStack) { - Optional name = ((SlimefunItemStack) itemStackTemplate).getItemMetaSnapshot().getDisplayName(); - - if (name.isPresent()) { - return name.get(); - } - } - return ItemUtils.getItemName(itemStackTemplate); } @@ -1185,6 +1152,19 @@ public final int hashCode() { return Optional.ofNullable(getById(id)); } + public static @Nullable SlimefunItem getByItem(@Nullable SlimefunItemStack slimefunItemStack) { + if (slimefunItemStack == null) { + return null; + } + + var delegate = slimefunItemStack.item(); + if (delegate.getType() == Material.AIR) { + return null; + } + + return getById(slimefunItemStack.getItemId()); + } + /** * Retrieve a {@link SlimefunItem} from an {@link ItemStack}. * @@ -1197,10 +1177,6 @@ public final int hashCode() { return null; } - if (item instanceof SlimefunItemStack stack) { - return getById(stack.getItemId()); - } - Optional itemID = Slimefun.getItemDataService().getItemData(item); return itemID.map(SlimefunItem::getById).orElse(null); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItemStack.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItemStack.java index 611e85df6d..8a427b249f 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItemStack.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItemStack.java @@ -5,20 +5,34 @@ import java.util.Base64; import java.util.List; import java.util.Locale; +import java.util.Map; import java.util.Optional; +import java.util.Random; +import java.util.Set; import java.util.function.Consumer; +import java.util.function.UnaryOperator; import javax.annotation.Nonnull; import javax.annotation.Nullable; +import io.papermc.paper.inventory.ItemRarity; +import io.papermc.paper.inventory.tooltip.TooltipContext; +import io.papermc.paper.registry.set.RegistryKeySet; +import net.kyori.adventure.text.Component; +import net.kyori.adventure.text.event.HoverEvent; import org.apache.commons.lang.Validate; import org.bukkit.ChatColor; import org.bukkit.Color; import org.bukkit.Material; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemFlag; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.inventory.meta.LeatherArmorMeta; import org.bukkit.inventory.meta.PotionMeta; +import org.bukkit.material.MaterialData; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; @@ -28,7 +42,6 @@ import io.github.bakedlibs.dough.skins.PlayerSkin; import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.api.exceptions.PrematureCodeException; -import io.github.thebusybiscuit.slimefun4.api.exceptions.WrongItemStackException; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.utils.HeadTexture; import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedItemFlag; @@ -41,16 +54,16 @@ * @author Walshy * */ -public class SlimefunItemStack extends ItemStack { +public class SlimefunItemStack { + private ItemStack delegate; private String id; private ItemMetaSnapshot itemMetaSnapshot; - private boolean locked = false; private String texture = null; public SlimefunItemStack(@Nonnull String id, @Nonnull ItemStack item) { - super(item); + delegate = new ItemStack(item); Validate.notNull(id, "The Item id must never be null!"); Validate.isTrue(id.equals(id.toUpperCase(Locale.ROOT)), "Slimefun Item Ids must be uppercase! (e.g. 'MY_ITEM_ID')"); @@ -61,7 +74,7 @@ public SlimefunItemStack(@Nonnull String id, @Nonnull ItemStack item) { this.id = id; - ItemMeta meta = getItemMeta(); + ItemMeta meta = delegate.getItemMeta(); Slimefun.getItemDataService().setItemData(meta, id); Slimefun.getItemTextureService().setTexture(meta, id); @@ -72,7 +85,7 @@ public SlimefunItemStack(@Nonnull String id, @Nonnull ItemStack item) { public SlimefunItemStack(@Nonnull String id, @Nonnull ItemStack item, @Nonnull Consumer consumer) { this(id, item); - ItemMeta im = getItemMeta(); + ItemMeta im = delegate.getItemMeta(); consumer.accept(im); setItemMeta(im); } @@ -166,7 +179,7 @@ public SlimefunItemStack(@Nonnull String id, @Nonnull Color color, @Nonnull Poti } public SlimefunItemStack(@Nonnull SlimefunItemStack item, int amount) { - this(item.getItemId(), item); + this(item.getItemId(), item.item()); setAmount(amount); } @@ -239,34 +252,18 @@ public SlimefunItemStack(@Nonnull String id, @Nonnull String texture, @Nonnull C return itemMetaSnapshot; } - @Override public boolean setItemMeta(ItemMeta meta) { - validate(); itemMetaSnapshot = new ItemMetaSnapshot(meta); - return super.setItemMeta(meta); + return delegate.setItemMeta(meta); } - @Override public void setType(Material type) { - validate(); - super.setType(type); + delegate.setType(type); } - @Override public void setAmount(int amount) { - validate(); - super.setAmount(amount); - } - - private void validate() { - if (locked) { - throw new WrongItemStackException(id + " is not mutable."); - } - } - - public void lock() { - locked = true; + delegate.setAmount(amount); } public @Nonnull Optional getSkullTexture() { @@ -306,13 +303,13 @@ public void lock() { } @Override - public ItemStack clone() { - return new SlimefunItemStack(id, this); + public @Nonnull SlimefunItemStack clone() { + return new SlimefunItemStack(id, delegate.clone()); } @Override public String toString() { - return "SlimefunItemStack (" + id + (getAmount() > 1 ? (" x " + getAmount()) : "") + ')'; + return "SlimefunItemStack (" + id + (delegate.getAmount() > 1 ? (" x " + delegate.getAmount()) : "") + ')'; } /** @@ -332,4 +329,247 @@ public final int hashCode() { // We don't want people to override this, it should use the super method return super.hashCode(); } + + /** + * @return underlying ItemStack used + */ + public @Nonnull ItemStack item() { + return delegate.clone(); + } + + public Material getType() { + return this.delegate.getType(); + } + + public ItemStack withType(Material type) { + return this.delegate.withType(type); + } + + public int getAmount() { + return this.delegate.getAmount(); + } + + /** @deprecated */ + @Deprecated + public MaterialData getData() { + return this.delegate.getData(); + } + + /** @deprecated */ + @Deprecated + public void setData(MaterialData data) { + this.delegate.setData(data); + } + + /** @deprecated */ + @Deprecated + public void setDurability(short durability) { + this.delegate.setDurability(durability); + } + + /** @deprecated */ + @Deprecated + public short getDurability() { + return this.delegate.getDurability(); + } + + public int getMaxStackSize() { + return this.delegate.getMaxStackSize(); + } + + public boolean isSimilar(ItemStack stack) { + return this.delegate.isSimilar(stack); + } + + public boolean containsEnchantment(Enchantment ench) { + return this.delegate.containsEnchantment(ench); + } + + public int getEnchantmentLevel(Enchantment ench) { + return this.delegate.getEnchantmentLevel(ench); + } + + public Map getEnchantments() { + return this.delegate.getEnchantments(); + } + + public void addEnchantments(Map enchantments) { + this.delegate.addEnchantments(enchantments); + } + + public void addEnchantment(Enchantment ench, int level) { + this.delegate.addEnchantment(ench, level); + } + + public void addUnsafeEnchantments(Map enchantments) { + this.delegate.addUnsafeEnchantments(enchantments); + } + + public void addUnsafeEnchantment(Enchantment ench, int level) { + this.delegate.addUnsafeEnchantment(ench, level); + } + + public int removeEnchantment(Enchantment ench) { + return this.delegate.removeEnchantment(ench); + } + + public void removeEnchantments() { + this.delegate.removeEnchantments(); + } + + public Map serialize() { + return this.delegate.serialize(); + } + + public boolean editMeta(Consumer consumer) { + return this.delegate.editMeta(consumer); + } + + public boolean editMeta(Class metaClass, Consumer consumer) { + return this.delegate.editMeta(metaClass, consumer); + } + + public ItemMeta getItemMeta() { + return this.delegate.getItemMeta(); + } + + public boolean hasItemMeta() { + return this.delegate.hasItemMeta(); + } + + /** @deprecated */ + @Deprecated + public String getTranslationKey() { + return this.delegate.getTranslationKey(); + } + + public ItemStack enchantWithLevels(int levels, boolean allowTreasure, Random random) { + return this.delegate.enchantWithLevels(levels, allowTreasure, random); + } + + public ItemStack enchantWithLevels(int levels, RegistryKeySet keySet, Random random) { + return this.delegate.enchantWithLevels(levels, keySet, random); + } + + public HoverEvent asHoverEvent(UnaryOperator op) { + return this.delegate.asHoverEvent(op); + } + + public Component displayName() { + return this.delegate.displayName(); + } + + public ItemStack ensureServerConversions() { + return this.delegate.ensureServerConversions(); + } + + public byte[] serializeAsBytes() { + return this.delegate.serializeAsBytes(); + } + + /** @deprecated */ + public String getI18NDisplayName() { + return this.delegate.getI18NDisplayName(); + } + + /** @deprecated */ + public int getMaxItemUseDuration() { + return this.delegate.getMaxItemUseDuration(); + } + + public int getMaxItemUseDuration(LivingEntity entity) { + return this.delegate.getMaxItemUseDuration(entity); + } + + public ItemStack asOne() { + return this.delegate.asOne(); + } + + public ItemStack asQuantity(int qty) { + return this.delegate.asQuantity(qty); + } + + public ItemStack add() { + return this.delegate.add(); + } + + public ItemStack add(int qty) { + return this.delegate.add(qty); + } + + public ItemStack subtract() { + return this.delegate.subtract(); + } + + public ItemStack subtract(int qty) { + return this.delegate.subtract(qty); + } + + @Deprecated + public List getLore() { + return this.delegate.getLore(); + } + + public List lore() { + return this.delegate.lore(); + } + + @Deprecated + public void setLore(List lore) { + this.delegate.setLore(lore); + } + + public void lore(List lore) { + this.delegate.lore(lore); + } + + public void addItemFlags(ItemFlag... itemFlags) { + this.delegate.addItemFlags(itemFlags); + } + + public void removeItemFlags(ItemFlag... itemFlags) { + this.delegate.removeItemFlags(itemFlags); + } + + public Set getItemFlags() { + return this.delegate.getItemFlags(); + } + + public boolean hasItemFlag(ItemFlag flag) { + return this.delegate.hasItemFlag(flag); + } + + public String translationKey() { + return this.delegate.translationKey(); + } + + /** @deprecated */ + @Deprecated + public ItemRarity getRarity() { + return this.delegate.getRarity(); + } + + public boolean isRepairableBy(ItemStack repairMaterial) { + return this.delegate.isRepairableBy(repairMaterial); + } + + public boolean canRepair(ItemStack toBeRepaired) { + return this.delegate.canRepair(toBeRepaired); + } + + public ItemStack damage(int amount, LivingEntity livingEntity) { + return this.delegate.damage(amount, livingEntity); + } + + public boolean isEmpty() { + return this.delegate.isEmpty(); + } + + public List computeTooltipLines(TooltipContext tooltipContext, Player player) { + return this.delegate.computeTooltipLines(tooltipContext, player); + } + + public HoverEvent asHoverEvent() { + return this.delegate.asHoverEvent(); + } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/groups/NestedItemGroup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/groups/NestedItemGroup.java index 9a928c8be1..0d99f7347e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/groups/NestedItemGroup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/groups/NestedItemGroup.java @@ -41,7 +41,7 @@ public NestedItemGroup(NamespacedKey key, ItemStack item, int tier) { /** * This will add the given {@link SubItemGroup} to this {@link NestedItemGroup}. - * + * * @param group * The {@link SubItemGroup} to add. */ @@ -53,7 +53,7 @@ public void addSubGroup(@Nonnull SubItemGroup group) { /** * This will remove the given {@link SubItemGroup} from this {@link NestedItemGroup} (if present). - * + * * @param group * The {@link SubItemGroup} to remove. */ @@ -90,7 +90,7 @@ private void openGuide(Player p, PlayerProfile profile, SlimefunGuideMode mode, menu.addMenuOpeningHandler(SoundEffect.GUIDE_BUTTON_CLICK_SOUND::playFor); guide.createHeader(p, profile, menu); - menu.addItem(1, new CustomItemStack(ChestMenuUtils.getBackButton(p, "", ChatColor.GRAY + Slimefun.getLocalization().getMessage(p, "guide.back.guide")))); + menu.addItem(1, ChestMenuUtils.getBackButton(p, "", ChatColor.GRAY + Slimefun.getLocalization().getMessage(p, "guide.back.guide"))); menu.addMenuClickHandler(1, (pl, s, is, action) -> { SlimefunGuide.openMainMenu(profile, mode, history.getMainMenuPage()); return false; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/RecipeType.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/RecipeType.java index e22c947b67..1db98b7e6e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/RecipeType.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/RecipeType.java @@ -6,6 +6,7 @@ import java.util.HashSet; import java.util.List; import java.util.Locale; +import java.util.Optional; import java.util.Set; import java.util.function.BiConsumer; @@ -34,7 +35,7 @@ // TODO: Remove this class and rewrite the recipe system public class RecipeType implements Keyed { - public static final RecipeType MULTIBLOCK = new RecipeType(new NamespacedKey(Slimefun.instance(), "multiblock"), new CustomItemStack(Material.BRICKS, "&bMultiBlock", "", "&a&oBuild it in the World")); + public static final RecipeType MULTIBLOCK = new RecipeType(new NamespacedKey(Slimefun.instance(), "multiblock"), CustomItemStack.create(Material.BRICKS, "&bMultiBlock", "", "&a&oBuild it in the World")); public static final RecipeType ARMOR_FORGE = new RecipeType(new NamespacedKey(Slimefun.instance(), "armor_forge"), SlimefunItems.ARMOR_FORGE, "", "&a&oCraft it in an Armor Forge"); public static final RecipeType GRIND_STONE = new RecipeType(new NamespacedKey(Slimefun.instance(), "grind_stone"), SlimefunItems.GRIND_STONE, "", "&a&oGrind it using the Grind Stone"); public static final RecipeType SMELTERY = new RecipeType(new NamespacedKey(Slimefun.instance(), "smeltery"), SlimefunItems.SMELTERY, "", "&a&oSmelt it using a Smeltery"); @@ -47,15 +48,15 @@ public class RecipeType implements Keyed { public static final RecipeType ENHANCED_CRAFTING_TABLE = new RecipeType(new NamespacedKey(Slimefun.instance(), "enhanced_crafting_table"), SlimefunItems.ENHANCED_CRAFTING_TABLE, "", "&a&oA regular Crafting Table cannot", "&a&ohold this massive Amount of Power..."); public static final RecipeType JUICER = new RecipeType(new NamespacedKey(Slimefun.instance(), "juicer"), SlimefunItems.JUICER, "", "&a&oUsed for Juice Creation"); - public static final RecipeType ANCIENT_ALTAR = new RecipeType(new NamespacedKey(Slimefun.instance(), "ancient_altar"), SlimefunItems.ANCIENT_ALTAR, (recipe, output) -> { + public static final RecipeType ANCIENT_ALTAR = new RecipeType(new NamespacedKey(Slimefun.instance(), "ancient_altar"), SlimefunItems.ANCIENT_ALTAR.item(), (recipe, output) -> { AltarRecipe altarRecipe = new AltarRecipe(Arrays.asList(recipe), output); AncientAltar altar = ((AncientAltar) SlimefunItems.ANCIENT_ALTAR.getItem()); altar.getRecipes().add(altarRecipe); }); - public static final RecipeType MOB_DROP = new RecipeType(new NamespacedKey(Slimefun.instance(), "mob_drop"), new CustomItemStack(Material.IRON_SWORD, "&bMob Drop"), RecipeType::registerMobDrop, "", "&rKill the specified Mob to obtain this Item"); - public static final RecipeType BARTER_DROP = new RecipeType(new NamespacedKey(Slimefun.instance(), "barter_drop"), new CustomItemStack(Material.GOLD_INGOT, "&bBarter Drop"), RecipeType::registerBarterDrop, "&aBarter with piglins for a chance", "&ato obtain this item"); - public static final RecipeType INTERACT = new RecipeType(new NamespacedKey(Slimefun.instance(), "interact"), new CustomItemStack(Material.PLAYER_HEAD, "&bInteract", "", "&a&oRight click with this item")); + public static final RecipeType MOB_DROP = new RecipeType(new NamespacedKey(Slimefun.instance(), "mob_drop"), CustomItemStack.create(Material.IRON_SWORD, "&bMob Drop"), RecipeType::registerMobDrop, "", "&rKill the specified Mob to obtain this Item"); + public static final RecipeType BARTER_DROP = new RecipeType(new NamespacedKey(Slimefun.instance(), "barter_drop"), CustomItemStack.create(Material.GOLD_INGOT, "&bBarter Drop"), RecipeType::registerBarterDrop, "&aBarter with piglins for a chance", "&ato obtain this item"); + public static final RecipeType INTERACT = new RecipeType(new NamespacedKey(Slimefun.instance(), "interact"), CustomItemStack.create(Material.PLAYER_HEAD, "&bInteract", "", "&a&oRight click with this item")); public static final RecipeType HEATED_PRESSURE_CHAMBER = new RecipeType(new NamespacedKey(Slimefun.instance(), "heated_pressure_chamber"), SlimefunItems.HEATED_PRESSURE_CHAMBER); public static final RecipeType FOOD_FABRICATOR = new RecipeType(new NamespacedKey(Slimefun.instance(), "food_fabricator"), SlimefunItems.FOOD_FABRICATOR); @@ -91,25 +92,20 @@ public RecipeType(ItemStack item, String machine) { } public RecipeType(NamespacedKey key, SlimefunItemStack slimefunItem, String... lore) { - this(key, slimefunItem, null, lore); + this(key, slimefunItem.item(), null, lore); } public RecipeType(NamespacedKey key, ItemStack item, BiConsumer callback, String... lore) { - this.item = new CustomItemStack(item, null, lore); + this.item = CustomItemStack.create(item, null, lore); this.key = key; this.consumer = callback; - if (item instanceof SlimefunItemStack slimefunItemStack) { - this.machine = slimefunItemStack.getItemId(); - } else { - this.machine = ""; - } + Optional itemId = Slimefun.getItemDataService().getItemData(item); + this.machine = itemId.orElse(""); } public RecipeType(NamespacedKey key, ItemStack item) { - this.key = key; - this.item = item; - this.machine = item instanceof SlimefunItemStack slimefunItemStack ? slimefunItemStack.getItemId() : ""; + this(key, item, null); } public RecipeType(MinecraftRecipe recipe) { @@ -230,4 +226,4 @@ public static ItemStack getRecipeOutputList(MultiBlockMachine machine, ItemStack List recipes = machine.getRecipes(); return recipes.get((recipes.indexOf(input) + 1))[0]; } -} \ No newline at end of file +} diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/SlimefunRegistry.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/SlimefunRegistry.java index bdafdc4293..ab8d41bd21 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/SlimefunRegistry.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/SlimefunRegistry.java @@ -47,7 +47,7 @@ /** * This class houses a lot of instances of {@link Map} and {@link List} that hold * various mappings and collections related to {@link SlimefunItem}. - * + * * @author TheBusyBiscuit * */ @@ -87,7 +87,7 @@ public final class SlimefunRegistry { private final Map worlds = new ConcurrentHashMap<>(); private final Map chunks = new HashMap<>(); private final Map guides = new EnumMap<>(SlimefunGuideMode.class); - private final Map> mobDrops = new EnumMap<>(EntityType.class); + private final Map> mobDrops = new HashMap<>(); private final Map blockMenuPresets = new HashMap<>(); private final Map universalInventories = new HashMap<>(); @@ -120,7 +120,7 @@ public void load(@Nonnull Slimefun plugin, @Nonnull Config cfg) { * Auto-Loading will automatically call {@link SlimefunItem#load()} when the item is registered. * Normally that method is called after the {@link Server} finished starting up. * But in the unusual scenario if a {@link SlimefunItem} is registered after that, this is gonna cover that. - * + * * @return Whether auto-loading is enabled */ public boolean isAutoLoadingEnabled() { @@ -132,7 +132,7 @@ public boolean isAutoLoadingEnabled() { * call {@link SlimefunItem#load()}. * Normally this method call is delayed but when the {@link Server} is already running, * the method can be called instantaneously. - * + * * @param mode * Whether auto-loading should be enabled */ @@ -142,7 +142,7 @@ public void setAutoLoadingMode(boolean mode) { /** * This returns a {@link List} containing every enabled {@link ItemGroup}. - * + * * @return {@link List} containing every enabled {@link ItemGroup} */ public @Nonnull List getAllItemGroups() { @@ -151,7 +151,7 @@ public void setAutoLoadingMode(boolean mode) { /** * This {@link List} contains every {@link SlimefunItem}, even disabled items. - * + * * @return A {@link List} containing every {@link SlimefunItem} */ public @Nonnull List getAllSlimefunItems() { @@ -160,7 +160,7 @@ public void setAutoLoadingMode(boolean mode) { /** * This {@link List} contains every enabled {@link SlimefunItem}. - * + * * @return A {@link List} containing every enabled {@link SlimefunItem} */ @Nonnull @@ -170,7 +170,7 @@ public List getEnabledSlimefunItems() { /** * This returns a {@link List} containing every enabled {@link Research}. - * + * * @return A {@link List} containing every enabled {@link Research} */ @Nonnull @@ -181,7 +181,7 @@ public List getResearches() { /** * This method returns a {@link Set} containing the {@link UUID} of every * {@link Player} who is currently unlocking a {@link Research}. - * + * * @return A {@link Set} holding the {@link UUID} from every {@link Player} * who is currently unlocking a {@link Research} */ @@ -226,7 +226,7 @@ public boolean isLearningAnimationDisabled() { /** * This method returns a {@link List} of every enabled {@link MultiBlock}. - * + * * @return A {@link List} containing every enabled {@link MultiBlock} */ @Nonnull @@ -241,10 +241,10 @@ public List getMultiBlocks() { * This mainly only exists for internal purposes, if you want to open a certain section * using the {@link SlimefunGuide}, then please use the static methods provided in the * {@link SlimefunGuide} class. - * + * * @param mode * The {@link SlimefunGuideMode} - * + * * @return The corresponding {@link SlimefunGuideImplementation} */ @Nonnull @@ -263,7 +263,7 @@ public SlimefunGuideImplementation getSlimefunGuide(@Nonnull SlimefunGuideMode m /** * This returns a {@link Map} connecting the {@link EntityType} with a {@link Set} * of {@link ItemStack ItemStacks} which would be dropped when an {@link Entity} of that type was killed. - * + * * @return The {@link Map} of custom mob drops */ @Nonnull @@ -274,7 +274,7 @@ public Map> getMobDrops() { /** * This returns a {@link Set} of {@link ItemStack ItemStacks} which can be obtained by bartering * with {@link Piglin Piglins}. - * + * * @return A {@link Set} of bartering drops */ @Nonnull diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/BackpackCommand.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/BackpackCommand.java index 431d47cb66..3e124b8e77 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/BackpackCommand.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/BackpackCommand.java @@ -69,7 +69,7 @@ public void onExecute(CommandSender sender, String[] args) { } Slimefun.runSync(() -> { - ItemStack item = SlimefunItems.RESTORED_BACKPACK.clone(); + ItemStack item = SlimefunItems.RESTORED_BACKPACK.item(); Slimefun.getBackpackListener().setBackpackId(backpackOwner, item, 2, id); player.getInventory().addItem(item); Slimefun.getLocalization().sendMessage(sender, "commands.backpack.restored-backpack-given"); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/DebugFishCommand.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/DebugFishCommand.java index cc79b113e6..7b0c85b277 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/DebugFishCommand.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/DebugFishCommand.java @@ -20,7 +20,7 @@ class DebugFishCommand extends SubCommand { @Override public void onExecute(CommandSender sender, String[] args) { if (sender instanceof Player player && sender.hasPermission("slimefun.debugging")) { - player.getInventory().addItem(SlimefunItems.DEBUG_FISH.clone()); + player.getInventory().addItem(SlimefunItems.DEBUG_FISH.item()); } else { Slimefun.getLocalization().sendMessage(sender, "messages.no-permission", true); } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/GiveCommand.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/GiveCommand.java index 5d56959e84..cdf67f5bab 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/GiveCommand.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/GiveCommand.java @@ -65,7 +65,7 @@ private void giveItem(CommandSender sender, Player p, SlimefunItem sfItem, Strin if (amount > 0) { Slimefun.getLocalization().sendMessage(p, "messages.given-item", true, msg -> msg.replace(PLACEHOLDER_ITEM, sfItem.getItemName()).replace(PLACEHOLDER_AMOUNT, String.valueOf(amount))); - Map excess = p.getInventory().addItem(new CustomItemStack(sfItem.getItem(), amount)); + Map excess = p.getInventory().addItem(CustomItemStack.create(sfItem.getItem(), amount)); if (Slimefun.getCfg().getBoolean("options.drop-excess-sf-give-items") && !excess.isEmpty()) { for (ItemStack is : excess.values()) { p.getWorld().dropItem(p.getLocation(), is); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/ContributorsMenu.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/ContributorsMenu.java index 93e8d89a35..06d06c3379 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/ContributorsMenu.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/ContributorsMenu.java @@ -24,7 +24,7 @@ /** * This menu shows a list of every {@link Contributor} to this project. - * + * * @author TheBusyBiscuit * */ @@ -40,7 +40,7 @@ public static void open(Player p, int page) { ChestMenuUtils.drawBackground(menu, 0, 2, 3, 4, 5, 6, 7, 8, 45, 47, 48, 49, 50, 51, 53); - menu.addItem(1, new CustomItemStack(ChestMenuUtils.getBackButton(p, "", "&7" + Slimefun.getLocalization().getMessage(p, "guide.back.settings")))); + menu.addItem(1, ChestMenuUtils.getBackButton(p, "", "&7" + Slimefun.getLocalization().getMessage(p, "guide.back.settings"))); menu.addMenuClickHandler(1, (pl, slot, item, action) -> { SlimefunGuideSettings.openSettings(pl, p.getInventory().getItemInMainHand()); return false; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/FireworksOption.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/FireworksOption.java index 64f48a0656..d16b85a170 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/FireworksOption.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/FireworksOption.java @@ -38,7 +38,7 @@ public Optional getDisplayItem(Player p, ItemStack guide) { lore.add(""); lore.add("&7\u21E8 " + Slimefun.getLocalization().getMessage(p, "guide.options.fireworks." + optionState + ".click")); - ItemStack item = new CustomItemStack(Material.FIREWORK_ROCKET, lore); + ItemStack item = CustomItemStack.create(Material.FIREWORK_ROCKET, lore); return Optional.of(item); } else { return Optional.empty(); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/LearningAnimationOption.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/LearningAnimationOption.java index 5d694c896c..ee62bbbf07 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/LearningAnimationOption.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/LearningAnimationOption.java @@ -51,7 +51,7 @@ public Optional getDisplayItem(@Nonnull Player p, @Nonnull ItemStack lore.add(""); lore.add("&7\u21E8 " + Slimefun.getLocalization().getMessage(p, "guide.options.learning-animation." + optionState + ".click")); - ItemStack item = new CustomItemStack(enabled ? Material.MAP : Material.PAPER, lore); + ItemStack item = CustomItemStack.create(enabled ? Material.MAP : Material.PAPER, lore); return Optional.of(item); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/PlayerLanguageOption.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/PlayerLanguageOption.java index 7a4779ff59..8633f17a54 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/PlayerLanguageOption.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/PlayerLanguageOption.java @@ -49,7 +49,7 @@ public Optional getDisplayItem(Player p, ItemStack guide) { lore.add(""); lore.add("&7\u21E8 &e" + Slimefun.getLocalization().getMessage(p, "guide.languages.change")); - ItemStack item = new CustomItemStack(language.getItem(), "&7" + Slimefun.getLocalization().getMessage(p, "guide.languages.selected-language") + " &a" + languageName, lore.toArray(new String[0])); + ItemStack item = CustomItemStack.create(language.getItem(), "&7" + Slimefun.getLocalization().getMessage(p, "guide.languages.selected-language") + " &a" + languageName, lore.toArray(new String[0])); return Optional.of(item); } else { return Optional.empty(); @@ -88,7 +88,7 @@ private void openLanguageSelection(Player p, ItemStack guide) { return false; }); } else if (i == 7) { - menu.addItem(7, new CustomItemStack(SlimefunUtils.getCustomHead(HeadTexture.ADD_NEW_LANGUAGE.getTexture()), Slimefun.getLocalization().getMessage(p, "guide.languages.translations.name"), "", "&7\u21E8 &e" + Slimefun.getLocalization().getMessage(p, "guide.languages.translations.lore")), (pl, slot, item, action) -> { + menu.addItem(7, CustomItemStack.create(SlimefunUtils.getCustomHead(HeadTexture.ADD_NEW_LANGUAGE.getTexture()), Slimefun.getLocalization().getMessage(p, "guide.languages.translations.name"), "", "&7\u21E8 &e" + Slimefun.getLocalization().getMessage(p, "guide.languages.translations.lore")), (pl, slot, item, action) -> { ChatUtils.sendURL(pl, "https://github.com/Slimefun/Slimefun4/wiki/Translating-Slimefun"); pl.closeInventory(); return false; @@ -101,7 +101,7 @@ private void openLanguageSelection(Player p, ItemStack guide) { Language defaultLanguage = Slimefun.getLocalization().getDefaultLanguage(); String defaultLanguageString = Slimefun.getLocalization().getMessage(p, "languages.default"); - menu.addItem(9, new CustomItemStack(defaultLanguage.getItem(), ChatColor.GRAY + defaultLanguageString + ChatColor.DARK_GRAY + " (" + defaultLanguage.getName(p) + ")", "", "&7\u21E8 &e" + Slimefun.getLocalization().getMessage(p, "guide.languages.select-default")), (pl, i, item, action) -> { + menu.addItem(9, CustomItemStack.create(defaultLanguage.getItem(), ChatColor.GRAY + defaultLanguageString + ChatColor.DARK_GRAY + " (" + defaultLanguage.getName(p) + ")", "", "&7\u21E8 &e" + Slimefun.getLocalization().getMessage(p, "guide.languages.select-default")), (pl, i, item, action) -> { Slimefun.instance().getServer().getPluginManager().callEvent(new PlayerLanguageChangeEvent(pl, Slimefun.getLocalization().getLanguage(pl), defaultLanguage)); setSelectedOption(pl, guide, null); @@ -114,7 +114,7 @@ private void openLanguageSelection(Player p, ItemStack guide) { int slot = 10; for (Language language : Slimefun.getLocalization().getLanguages()) { - menu.addItem(slot, new CustomItemStack(language.getItem(), ChatColor.GREEN + language.getName(p), "&b" + language.getTranslationProgress() + '%', "", "&7\u21E8 &e" + Slimefun.getLocalization().getMessage(p, "guide.languages.select")), (pl, i, item, action) -> { + menu.addItem(slot, CustomItemStack.create(language.getItem(), ChatColor.GREEN + language.getName(p), "&b" + language.getTranslationProgress() + '%', "", "&7\u21E8 &e" + Slimefun.getLocalization().getMessage(p, "guide.languages.select")), (pl, i, item, action) -> { Slimefun.instance().getServer().getPluginManager().callEvent(new PlayerLanguageChangeEvent(pl, Slimefun.getLocalization().getLanguage(pl), language)); setSelectedOption(pl, guide, language.getId()); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/SlimefunGuideSettings.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/SlimefunGuideSettings.java index 6761a9c19c..a1e310e4fc 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/SlimefunGuideSettings.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/guide/options/SlimefunGuideSettings.java @@ -32,11 +32,11 @@ /** * This static utility class offers various methods that provide access to the * Settings menu of our {@link SlimefunGuide}. - * + * * This menu is used to allow a {@link Player} to change things such as the {@link Language}. - * + * * @author TheBusyBiscuit - * + * * @see SlimefunGuide * */ @@ -78,11 +78,10 @@ private static void addHeader(Player p, ChestMenu menu, ItemStack guide) { LocalizationService locale = Slimefun.getLocalization(); // @formatter:off - menu.addItem(0, new CustomItemStack(SlimefunGuide.getItem(SlimefunGuideMode.SURVIVAL_MODE), + menu.addItem(0, CustomItemStack.create(SlimefunGuide.getItem(SlimefunGuideMode.SURVIVAL_MODE), "&e\u21E6 " + locale.getMessage(p, "guide.back.title"), "", - "&7" + locale.getMessage(p, "guide.back.guide") - )); + "&7" + locale.getMessage(p, "guide.back.guide"))); // @formatter:on menu.addMenuClickHandler(0, (pl, slot, item, action) -> { @@ -99,10 +98,9 @@ private static void addHeader(Player p, ChestMenu menu, ItemStack guide) { contributorsLore.add("&7\u21E8 &e" + locale.getMessage(p, "guide.credits.open")); // @formatter:off - menu.addItem(2, new CustomItemStack(SlimefunUtils.getCustomHead("e952d2b3f351a6b0487cc59db31bf5f2641133e5ba0006b18576e996a0293e52"), + menu.addItem(2, CustomItemStack.create(SlimefunUtils.getCustomHead("e952d2b3f351a6b0487cc59db31bf5f2641133e5ba0006b18576e996a0293e52"), "&c" + locale.getMessage(p, "guide.title.credits"), - contributorsLore.toArray(new String[0]) - )); + contributorsLore.toArray(new String[0]))); // @formatter:on menu.addMenuClickHandler(2, (pl, slot, action, item) -> { @@ -111,7 +109,7 @@ private static void addHeader(Player p, ChestMenu menu, ItemStack guide) { }); // @formatter:off - menu.addItem(4, new CustomItemStack(Material.WRITABLE_BOOK, + menu.addItem(4, CustomItemStack.create(Material.WRITABLE_BOOK, ChatColor.GREEN + locale.getMessage(p, "guide.title.versions"), "&7&o" + locale.getMessage(p, "guide.tooltips.versions-notice"), "", @@ -122,7 +120,7 @@ private static void addHeader(Player p, ChestMenu menu, ItemStack guide) { // @formatter:on // @formatter:off - menu.addItem(6, new CustomItemStack(Material.COMPARATOR, + menu.addItem(6, CustomItemStack.create(Material.COMPARATOR, "&e" + locale.getMessage(p, "guide.title.source"), "", "&7Last Activity: &a" + NumberUtils.getElapsedTime(github.getLastUpdate()) + " ago", "&7Forks: &e" + github.getForks(), @@ -133,8 +131,7 @@ private static void addHeader(Player p, ChestMenu menu, ItemStack guide) { "&7&oand if you want to keep this Plugin alive,", "&7&othen please consider contributing to it", "", - "&7\u21E8 &eClick to go to GitHub" - )); + "&7\u21E8 &eClick to go to GitHub")); // @formatter:on menu.addMenuClickHandler(6, (pl, slot, item, action) -> { @@ -144,15 +141,14 @@ private static void addHeader(Player p, ChestMenu menu, ItemStack guide) { }); // @formatter:off - menu.addItem(8, new CustomItemStack(Material.KNOWLEDGE_BOOK, + menu.addItem(8, CustomItemStack.create(Material.KNOWLEDGE_BOOK, "&3" + locale.getMessage(p, "guide.title.wiki"), "", "&7Do you need help with an Item or machine?", "&7You cannot figure out what to do?", "&7Check out our community-maintained Wiki", "&7and become one of our Editors!", "", - "&7\u21E8 &eClick to go to the official Slimefun Wiki" - )); + "&7\u21E8 &eClick to go to the official Slimefun Wiki")); // @formatter:on menu.addMenuClickHandler(8, (pl, slot, item, action) -> { @@ -162,7 +158,7 @@ private static void addHeader(Player p, ChestMenu menu, ItemStack guide) { }); // @formatter:off - menu.addItem(47, new CustomItemStack(Material.BOOKSHELF, + menu.addItem(47, CustomItemStack.create(Material.BOOKSHELF, "&3" + locale.getMessage(p, "guide.title.addons"), "", "&7Slimefun is huge. But its addons are what makes", @@ -171,8 +167,7 @@ private static void addHeader(Player p, ChestMenu menu, ItemStack guide) { "", "&7Installed on this Server: &b" + Slimefun.getInstalledAddons().size(), "", - "&7\u21E8 &eClick to see all available addons for Slimefun4" - )); + "&7\u21E8 &eClick to see all available addons for Slimefun4")); // @formatter:on menu.addMenuClickHandler(47, (pl, slot, item, action) -> { @@ -183,7 +178,7 @@ private static void addHeader(Player p, ChestMenu menu, ItemStack guide) { if (Slimefun.getUpdater().getBranch().isOfficial()) { // @formatter:off - menu.addItem(49, new CustomItemStack(Material.REDSTONE_TORCH, + menu.addItem(49, CustomItemStack.create(Material.REDSTONE_TORCH, "&4" + locale.getMessage(p, "guide.title.bugs"), "", "&7&oBug reports have to be made in English!", @@ -191,8 +186,7 @@ private static void addHeader(Player p, ChestMenu menu, ItemStack guide) { "&7Open Issues: &a" + github.getOpenIssues(), "&7Pending Pull Requests: &a" + github.getPendingPullRequests(), "", - "&7\u21E8 &eClick to go to the Slimefun4 Bug Tracker" - )); + "&7\u21E8 &eClick to go to the Slimefun4 Bug Tracker")); // @formatter:on menu.addMenuClickHandler(49, (pl, slot, item, action) -> { @@ -204,7 +198,7 @@ private static void addHeader(Player p, ChestMenu menu, ItemStack guide) { menu.addItem(49, ChestMenuUtils.getBackground(), ChestMenuUtils.getEmptyClickHandler()); } - menu.addItem(51, new CustomItemStack(Material.TOTEM_OF_UNDYING, ChatColor.RED + locale.getMessage(p, "guide.work-in-progress")), (pl, slot, item, action) -> { + menu.addItem(51, CustomItemStack.create(Material.TOTEM_OF_UNDYING, ChatColor.RED + locale.getMessage(p, "guide.work-in-progress")), (pl, slot, item, action) -> { // Add something here return false; }); @@ -233,10 +227,10 @@ private static void addConfigurableOptions(Player p, ChestMenu menu, ItemStack g * This method checks if the given {@link Player} has enabled the {@link FireworksOption} * in their {@link SlimefunGuide}. * If they enabled this setting, they will see fireworks when they unlock a {@link Research}. - * + * * @param p * The {@link Player} - * + * * @return Whether this {@link Player} wants to see fireworks when unlocking a {@link Research} */ public static boolean hasFireworksEnabled(@Nonnull Player p) { @@ -271,7 +265,7 @@ public static boolean hasLearningAnimationEnabled(@Nonnull Player p) { * Type of the {@link SlimefunGuideOption} * @param * Type of the {@link SlimefunGuideOption} value - * + * * @return The value of given {@link SlimefunGuideOption} */ @Nonnull diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/localization/SlimefunLocalization.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/localization/SlimefunLocalization.java index 893e3baf21..a146a9f620 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/localization/SlimefunLocalization.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/services/localization/SlimefunLocalization.java @@ -68,7 +68,7 @@ protected void save() { * This returns the chat prefix for our messages. * Every message (unless explicitly omitted) will have this * prefix prepended. - * + * * @return The chat prefix */ public @Nonnull String getChatPrefix() { @@ -321,7 +321,7 @@ protected void loadEmbeddedLanguages() { Language language = getLanguage(p); NamespacedKey key = recipeType.getKey(); - return new CustomItemStack(item, meta -> { + return CustomItemStack.create(item, meta -> { String displayName = getStringOrNull(language, LanguageFile.RECIPES, key.getNamespace() + "." + key.getKey() + ".name"); // Set the display name if possible, else keep the default item name. diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java index d3adb16e0b..62bc4d59e9 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java @@ -640,19 +640,19 @@ private SlimefunItems() {} public static final SlimefunItemStack SOULBOUND_BOOTS = new SlimefunItemStack("SOULBOUND_BOOTS", Material.DIAMOND_BOOTS, "&cSoulbound Boots"); /* Runes */ - public static final SlimefunItemStack BLANK_RUNE = new SlimefunItemStack("BLANK_RUNE", new ColoredFireworkStar(Color.BLACK, "&8Blank Rune")); - - public static final SlimefunItemStack AIR_RUNE = new SlimefunItemStack("ANCIENT_RUNE_AIR", new ColoredFireworkStar(Color.AQUA, "&7Ancient Rune &8&l[&b&lAir&8&l]")); - public static final SlimefunItemStack WATER_RUNE = new SlimefunItemStack("ANCIENT_RUNE_WATER", new ColoredFireworkStar(Color.BLUE, "&7Ancient Rune &8&l[&1&lWater&8&l]")); - public static final SlimefunItemStack FIRE_RUNE = new SlimefunItemStack("ANCIENT_RUNE_FIRE", new ColoredFireworkStar(Color.RED, "&7Ancient Rune &8&l[&4&lFire&8&l]")); - public static final SlimefunItemStack EARTH_RUNE = new SlimefunItemStack("ANCIENT_RUNE_EARTH", new ColoredFireworkStar(Color.fromRGB(112, 47, 7), "&7Ancient Rune &8&l[&c&lEarth&8&l]")); - public static final SlimefunItemStack ENDER_RUNE = new SlimefunItemStack("ANCIENT_RUNE_ENDER", new ColoredFireworkStar(Color.PURPLE, "&7Ancient Rune &8&l[&5&lEnder&8&l]")); - - public static final SlimefunItemStack RAINBOW_RUNE = new SlimefunItemStack("ANCIENT_RUNE_RAINBOW", new ColoredFireworkStar(Color.FUCHSIA, "&7Ancient Rune &8&l[&d&lRainbow&8&l]")); - public static final SlimefunItemStack LIGHTNING_RUNE = new SlimefunItemStack("ANCIENT_RUNE_LIGHTNING", new ColoredFireworkStar(Color.fromRGB(255, 255, 95), "&7Ancient Rune &8&l[&e&lLightning&8&l]")); - public static final SlimefunItemStack SOULBOUND_RUNE = new SlimefunItemStack("ANCIENT_RUNE_SOULBOUND", new ColoredFireworkStar(Color.fromRGB(47, 0, 117), "&7Ancient Rune &8&l[&5&lSoulbound&8&l]", "&eDrop this rune onto a dropped item to", "&5bind ðat item to your soul.", " ", "&eIt is advised that you only use this rune", "&eon &6important &eitems.", " ", "&eItems bound to your soul won't drop on death.")); - public static final SlimefunItemStack ENCHANTMENT_RUNE = new SlimefunItemStack("ANCIENT_RUNE_ENCHANTMENT", new ColoredFireworkStar(Color.fromRGB(255, 217, 25), "&7Ancient Rune &8&l[&6&lEnchantment&8&l]", "&eDrop this rune onto a dropped item to", "&6enchant ðat item with a random enchantment.")); - public static final SlimefunItemStack VILLAGER_RUNE = new SlimefunItemStack("ANCIENT_RUNE_VILLAGERS", new ColoredFireworkStar(Color.fromRGB(160, 20, 5), "&7Ancient Rune &8&l[&4&lVillagers&8&l]", "&eRight click a villager to clear", "ðeir current job and trades.", "&eThe villager will start looking", "&efor a job again after some", "&etime has passed.")); + public static final SlimefunItemStack BLANK_RUNE = new SlimefunItemStack("BLANK_RUNE", ColoredFireworkStar.create(Color.BLACK, "&8Blank Rune")); + + public static final SlimefunItemStack AIR_RUNE = new SlimefunItemStack("ANCIENT_RUNE_AIR", ColoredFireworkStar.create(Color.AQUA, "&7Ancient Rune &8&l[&b&lAir&8&l]")); + public static final SlimefunItemStack WATER_RUNE = new SlimefunItemStack("ANCIENT_RUNE_WATER", ColoredFireworkStar.create(Color.BLUE, "&7Ancient Rune &8&l[&1&lWater&8&l]")); + public static final SlimefunItemStack FIRE_RUNE = new SlimefunItemStack("ANCIENT_RUNE_FIRE", ColoredFireworkStar.create(Color.RED, "&7Ancient Rune &8&l[&4&lFire&8&l]")); + public static final SlimefunItemStack EARTH_RUNE = new SlimefunItemStack("ANCIENT_RUNE_EARTH", ColoredFireworkStar.create(Color.fromRGB(112, 47, 7), "&7Ancient Rune &8&l[&c&lEarth&8&l]")); + public static final SlimefunItemStack ENDER_RUNE = new SlimefunItemStack("ANCIENT_RUNE_ENDER", ColoredFireworkStar.create(Color.PURPLE, "&7Ancient Rune &8&l[&5&lEnder&8&l]")); + + public static final SlimefunItemStack RAINBOW_RUNE = new SlimefunItemStack("ANCIENT_RUNE_RAINBOW", ColoredFireworkStar.create(Color.FUCHSIA, "&7Ancient Rune &8&l[&d&lRainbow&8&l]")); + public static final SlimefunItemStack LIGHTNING_RUNE = new SlimefunItemStack("ANCIENT_RUNE_LIGHTNING", ColoredFireworkStar.create(Color.fromRGB(255, 255, 95), "&7Ancient Rune &8&l[&e&lLightning&8&l]")); + public static final SlimefunItemStack SOULBOUND_RUNE = new SlimefunItemStack("ANCIENT_RUNE_SOULBOUND", ColoredFireworkStar.create(Color.fromRGB(47, 0, 117), "&7Ancient Rune &8&l[&5&lSoulbound&8&l]", "&eDrop this rune onto a dropped item to", "&5bind ðat item to your soul.", " ", "&eIt is advised that you only use this rune", "&eon &6important &eitems.", " ", "&eItems bound to your soul won't drop on death.")); + public static final SlimefunItemStack ENCHANTMENT_RUNE = new SlimefunItemStack("ANCIENT_RUNE_ENCHANTMENT", ColoredFireworkStar.create(Color.fromRGB(255, 217, 25), "&7Ancient Rune &8&l[&6&lEnchantment&8&l]", "&eDrop this rune onto a dropped item to", "&6enchant ðat item with a random enchantment.")); + public static final SlimefunItemStack VILLAGER_RUNE = new SlimefunItemStack("ANCIENT_RUNE_VILLAGERS", ColoredFireworkStar.create(Color.fromRGB(160, 20, 5), "&7Ancient Rune &8&l[&4&lVillagers&8&l]", "&eRight click a villager to clear", "ðeir current job and trades.", "&eThe villager will start looking", "&efor a job again after some", "&etime has passed.")); /* Electricity */ public static final SlimefunItemStack SOLAR_GENERATOR = new SlimefunItemStack("SOLAR_GENERATOR", Material.DAYLIGHT_DETECTOR, "&bSolar Generator", "", LoreBuilder.machine(MachineTier.BASIC, MachineType.GENERATOR), LoreBuilder.powerBuffer(0), LoreBuilder.powerPerSecond(4)); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/guide/SurvivalSlimefunGuide.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/guide/SurvivalSlimefunGuide.java index 83e43be65f..617816af07 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/guide/SurvivalSlimefunGuide.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/guide/SurvivalSlimefunGuide.java @@ -59,7 +59,7 @@ * It uses an {@link Inventory} to display {@link SlimefunGuide} contents. * * @author TheBusyBiscuit - * + * * @see SlimefunGuide * @see SlimefunGuideImplementation * @see CheatSheetSlimefunGuide @@ -101,7 +101,7 @@ protected final boolean isSurvivalMode() { * The {@link Player} who opened his {@link SlimefunGuide} * @param profile * The {@link PlayerProfile} of the {@link Player} - * + * * @return a {@link List} of visible {@link ItemGroup} instances */ protected @Nonnull List getVisibleItemGroups(@Nonnull Player p, @Nonnull PlayerProfile profile) { @@ -209,7 +209,7 @@ private void showItemGroup(ChestMenu menu, Player p, PlayerProfile profile, Item lore.add(parent.getItem(p).getItemMeta().getDisplayName()); } - menu.addItem(index, new CustomItemStack(Material.BARRIER, "&4" + Slimefun.getLocalization().getMessage(p, "guide.locked") + " &7- &f" + group.getItem(p).getItemMeta().getDisplayName(), lore.toArray(new String[0]))); + menu.addItem(index, CustomItemStack.create(Material.BARRIER, "&4" + Slimefun.getLocalization().getMessage(p, "guide.locked") + " &7- &f" + group.getItem(p).getItemMeta().getDisplayName(), lore.toArray(new String[0]))); menu.addMenuClickHandler(index, ChestMenuUtils.getEmptyClickHandler()); } } @@ -287,10 +287,10 @@ private void displaySlimefunItem(ChestMenu menu, ItemGroup itemGroup, Player p, if (isSurvivalMode() && !hasPermission(p, sfitem)) { List message = Slimefun.getPermissionsService().getLore(sfitem); - menu.addItem(index, new CustomItemStack(ChestMenuUtils.getNoPermissionItem(), sfitem.getItemName(), message.toArray(new String[0]))); + menu.addItem(index, CustomItemStack.create(ChestMenuUtils.getNoPermissionItem(), sfitem.getItemName(), message.toArray(new String[0]))); menu.addMenuClickHandler(index, ChestMenuUtils.getEmptyClickHandler()); } else if (isSurvivalMode() && research != null && !profile.hasUnlocked(research)) { - menu.addItem(index, new CustomItemStack(ChestMenuUtils.getNotResearchedItem(), ChatColor.WHITE + ItemUtils.getItemName(sfitem.getItem()), "&4&l" + Slimefun.getLocalization().getMessage(p, "guide.locked"), "", "&a> Click to unlock", "", "&7Cost: &b" + research.getCost() + " Level(s)")); + menu.addItem(index, CustomItemStack.create(ChestMenuUtils.getNotResearchedItem(), ChatColor.WHITE + ItemUtils.getItemName(sfitem.getItem()), "&4&l" + Slimefun.getLocalization().getMessage(p, "guide.locked"), "", "&a> Click to unlock", "", "&7Cost: &b" + research.getCost() + " Level(s)")); menu.addMenuClickHandler(index, (pl, slot, item, action) -> { research.unlockFromGuide(this, p, profile, sfitem, itemGroup, page); return false; @@ -358,7 +358,7 @@ public void openSearch(PlayerProfile profile, String input, boolean addToHistory } if (!slimefunItem.isHidden() && isItemGroupAccessible(p, slimefunItem) && isSearchFilterApplicable(slimefunItem, searchTerm)) { - ItemStack itemstack = new CustomItemStack(slimefunItem.getItem(), meta -> { + ItemStack itemstack = CustomItemStack.create(slimefunItem.getItem(), meta -> { ItemGroup itemGroup = slimefunItem.getItemGroup(); meta.setLore(Arrays.asList("", ChatColor.DARK_GRAY + "\u21E8 " + ChatColor.WHITE + itemGroup.getDisplayName(p))); meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES, ItemFlag.HIDE_ENCHANTS, VersionedItemFlag.HIDE_ADDITIONAL_TOOLTIP); @@ -442,7 +442,7 @@ private void showMinecraftRecipe(Recipe[] recipes, int index, ItemStack item, Pl recipeType = new RecipeType(optional.get()); result = recipe.getResult(); } else { - recipeItems = new ItemStack[] { null, null, null, null, new CustomItemStack(Material.BARRIER, "&4We are somehow unable to show you this Recipe :/"), null, null, null, null }; + recipeItems = new ItemStack[] { null, null, null, null, CustomItemStack.create(Material.BARRIER, "&4We are somehow unable to show you this Recipe :/"), null, null, null, null }; } ChestMenu menu = create(p); @@ -515,7 +515,7 @@ public void displayItem(PlayerProfile profile, SlimefunItem item, boolean addToH Optional wiki = item.getWikipage(); if (wiki.isPresent()) { - menu.addItem(8, new CustomItemStack(Material.KNOWLEDGE_BOOK, ChatColor.WHITE + Slimefun.getLocalization().getMessage(p, "guide.tooltips.wiki"), "", ChatColor.GRAY + "\u21E8 " + ChatColor.GREEN + Slimefun.getLocalization().getMessage(p, "guide.tooltips.open-itemgroup"))); + menu.addItem(8, CustomItemStack.create(Material.KNOWLEDGE_BOOK, ChatColor.WHITE + Slimefun.getLocalization().getMessage(p, "guide.tooltips.wiki"), "", ChatColor.GRAY + "\u21E8 " + ChatColor.GREEN + Slimefun.getLocalization().getMessage(p, "guide.tooltips.open-itemgroup"))); menu.addMenuClickHandler(8, (pl, slot, itemstack, action) -> { pl.closeInventory(); ChatUtils.sendURL(pl, wiki.get()); @@ -617,7 +617,7 @@ private void addBackButton(ChestMenu menu, int slot, Player p, PlayerProfile pro GuideHistory history = profile.getGuideHistory(); if (isSurvivalMode() && history.size() > 1) { - menu.addItem(slot, new CustomItemStack(ChestMenuUtils.getBackButton(p, "", "&fLeft Click: &7Go back to previous Page", "&fShift + left Click: &7Go back to Main Menu"))); + menu.addItem(slot, ChestMenuUtils.getBackButton(p, "", "&fLeft Click: &7Go back to previous Page", "&fShift + left Click: &7Go back to Main Menu")); menu.addMenuClickHandler(slot, (pl, s, is, action) -> { if (action.isShiftClicked()) { @@ -629,7 +629,7 @@ private void addBackButton(ChestMenu menu, int slot, Player p, PlayerProfile pro }); } else { - menu.addItem(slot, new CustomItemStack(ChestMenuUtils.getBackButton(p, "", ChatColor.GRAY + Slimefun.getLocalization().getMessage(p, "guide.back.guide")))); + menu.addItem(slot, ChestMenuUtils.getBackButton(p, "", ChatColor.GRAY + Slimefun.getLocalization().getMessage(p, "guide.back.guide"))); menu.addMenuClickHandler(slot, (pl, s, is, action) -> { openMainMenu(profile, profile.getGuideHistory().getMainMenuPage()); return false; @@ -647,7 +647,7 @@ private void addBackButton(ChestMenu menu, int slot, Player p, PlayerProfile pro } String lore = hasPermission(p, slimefunItem) ? "&fNeeds to be unlocked in " + slimefunItem.getItemGroup().getDisplayName(p) : "&fNo Permission"; - return slimefunItem.canUse(p, false) ? item : new CustomItemStack(Material.BARRIER, ItemUtils.getItemName(item), "&4&l" + Slimefun.getLocalization().getMessage(p, "guide.locked"), "", lore); + return slimefunItem.canUse(p, false) ? item : CustomItemStack.create(Material.BARRIER, ItemUtils.getItemName(item), "&4&l" + Slimefun.getLocalization().getMessage(p, "guide.locked"), "", lore); } else { return item; } @@ -662,7 +662,7 @@ private void displayRecipes(Player p, PlayerProfile profile, ChestMenu menu, Rec if (page == 0) { for (int i = 27; i < 36; i++) { - menu.replaceExistingItem(i, new CustomItemStack(ChestMenuUtils.getBackground(), sfItem.getRecipeSectionLabel(p))); + menu.replaceExistingItem(i, CustomItemStack.create(ChestMenuUtils.getBackground(), sfItem.getRecipeSectionLabel(p))); menu.addMenuClickHandler(i, ChestMenuUtils.getEmptyClickHandler()); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/altar/AncientPedestal.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/altar/AncientPedestal.java index bbf19d36d8..5d2548e0b8 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/altar/AncientPedestal.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/altar/AncientPedestal.java @@ -40,11 +40,11 @@ * The {@link AncientPedestal} is a part of the {@link AncientAltar}. * You can place any {@link ItemStack} onto the {@link AncientPedestal} to provide it to * the altar as a crafting ingredient. - * + * * @author Redemption198 * @author TheBusyBiscuit * @author JustAHuman - * + * * @see AncientAltar * @see AncientAltarListener * @see AncientAltarTask @@ -68,7 +68,7 @@ public AncientPedestal(ItemGroup itemGroup, SlimefunItemStack item, RecipeType r public void onBlockBreak(@Nonnull Block b) { Optional entity = getPlacedItem(b); ArmorStand armorStand = getArmorStand(b, false); - + if (entity.isPresent()) { Item stack = entity.get(); @@ -78,7 +78,7 @@ public void onBlockBreak(@Nonnull Block b) { stack.remove(); } } - + if (armorStand != null && armorStand.isValid()) { armorStand.remove(); } @@ -102,21 +102,21 @@ public void onBlockBreak(@Nonnull Block b) { return Optional.empty(); } - + public @Nullable ArmorStand getArmorStand(@Nonnull Block pedestal, boolean createIfNoneExists) { Optional entity = getPlacedItem(pedestal); - + if (entity.isPresent() && entity.get().getVehicle() instanceof ArmorStand armorStand) { return armorStand; } - + Location l = pedestal.getLocation().add(0.5, 1.2, 0.5); for (Entity n : l.getWorld().getNearbyEntities(l, 0.5, 0.5, 0.5, this::testArmorStand)) { if (n instanceof ArmorStand armorStand) { return armorStand; } } - + return createIfNoneExists ? ArmorStandUtils.spawnArmorStand(l) : null; } @@ -129,7 +129,7 @@ public static boolean testItem(@Nullable Entity n) { return false; } } - + private boolean testArmorStand(@Nullable Entity n) { if (n instanceof ArmorStand && n.isValid()) { String customName = n.getCustomName(); @@ -157,7 +157,7 @@ private boolean testArmorStand(@Nullable Entity n) { public void placeItem(@Nonnull Player p, @Nonnull Block b) { ItemStack hand = p.getInventory().getItemInMainHand(); String displayName = ITEM_PREFIX + System.nanoTime(); - ItemStack displayItem = new CustomItemStack(hand, displayName); + ItemStack displayItem = CustomItemStack.create(hand, displayName); displayItem.setAmount(1); // Get the display name of the original Item in the Player's hand diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/AndroidFuelSource.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/AndroidFuelSource.java index 3fef5f5925..d2bdc34581 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/AndroidFuelSource.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/AndroidFuelSource.java @@ -9,7 +9,7 @@ /** * This enum covers all different fuel sources a {@link ProgrammableAndroid} can have. - * + * * @author TheBusyBiscuit * */ @@ -38,12 +38,12 @@ public enum AndroidFuelSource { /** * This returns a display {@link ItemStack} for this {@link AndroidFuelSource}. - * + * * @return An {@link ItemStack} to display */ @Nonnull public ItemStack getItem() { - return new CustomItemStack(HeadTexture.GENERATOR.getAsItemStack(), "&8\u21E9 &cFuel Input &8\u21E9", lore); + return CustomItemStack.create(HeadTexture.GENERATOR.getAsItemStack(), "&8\u21E9 &cFuel Input &8\u21E9", lore); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/ProgrammableAndroid.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/ProgrammableAndroid.java index 8db9826bc7..669327a9bf 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/ProgrammableAndroid.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/ProgrammableAndroid.java @@ -102,7 +102,7 @@ public boolean canOpen(Block b, Player p) { @Override public void newInstance(BlockMenu menu, Block b) { - menu.replaceExistingItem(15, new CustomItemStack(HeadTexture.SCRIPT_START.getAsItemStack(), "&aStart/Continue")); + menu.replaceExistingItem(15, CustomItemStack.create(HeadTexture.SCRIPT_START.getAsItemStack(), "&aStart/Continue")); menu.addMenuClickHandler(15, (p, slot, item, action) -> { Slimefun.getLocalization().sendMessage(p, "android.started", true); BlockStorage.addBlockInfo(b, "paused", "false"); @@ -110,14 +110,14 @@ public void newInstance(BlockMenu menu, Block b) { return false; }); - menu.replaceExistingItem(17, new CustomItemStack(HeadTexture.SCRIPT_PAUSE.getAsItemStack(), "&4Pause")); + menu.replaceExistingItem(17, CustomItemStack.create(HeadTexture.SCRIPT_PAUSE.getAsItemStack(), "&4Pause")); menu.addMenuClickHandler(17, (p, slot, item, action) -> { BlockStorage.addBlockInfo(b, "paused", "true"); Slimefun.getLocalization().sendMessage(p, "android.stopped", true); return false; }); - menu.replaceExistingItem(16, new CustomItemStack(HeadTexture.ENERGY_REGULATOR.getAsItemStack(), "&bMemory Core", "", "&8\u21E8 &7Click to open the Script Editor")); + menu.replaceExistingItem(16, CustomItemStack.create(HeadTexture.ENERGY_REGULATOR.getAsItemStack(), "&bMemory Core", "", "&8\u21E8 &7Click to open the Script Editor")); menu.addMenuClickHandler(16, (p, slot, item, action) -> { BlockStorage.addBlockInfo(b, "paused", "true"); Slimefun.getLocalization().sendMessage(p, "android.stopped", true); @@ -189,7 +189,7 @@ public void onPlayerBreak(BlockBreakEvent e, ItemStack item, List dro /** * This returns the {@link AndroidType} that is associated with this {@link ProgrammableAndroid}. - * + * * @return The type of this {@link ProgrammableAndroid} */ public AndroidType getAndroidType() { @@ -199,7 +199,7 @@ public AndroidType getAndroidType() { /** * This returns the {@link AndroidFuelSource} for this {@link ProgrammableAndroid}. * It determines what kind of fuel is required to run it. - * + * * @return The required type of fuel */ public AndroidFuelSource getFuelSource() { @@ -236,7 +236,7 @@ public void openScript(Player p, Block b, String sourceCode) { ChestMenu menu = new ChestMenu(ChatColor.DARK_AQUA + Slimefun.getLocalization().getMessage(p, "android.scripts.editor")); menu.setEmptySlotsClickable(false); - menu.addItem(0, new CustomItemStack(Instruction.START.getItem(), Slimefun.getLocalization().getMessage(p, "android.scripts.instructions.START"), "", "&7\u21E8 &eLeft Click &7to return to the Android's interface")); + menu.addItem(0, CustomItemStack.create(Instruction.START.getItem(), Slimefun.getLocalization().getMessage(p, "android.scripts.instructions.START"), "", "&7\u21E8 &eLeft Click &7to return to the Android's interface")); menu.addMenuClickHandler(0, (pl, slot, item, action) -> { BlockMenu inv = BlockStorage.getInventory(b); // Fixes #2937 @@ -257,7 +257,7 @@ public void openScript(Player p, Block b, String sourceCode) { boolean hasFreeSlot = script.length < 54; if (hasFreeSlot) { - menu.addItem(i, new CustomItemStack(HeadTexture.SCRIPT_NEW.getAsItemStack(), "&7> Add new Command")); + menu.addItem(i, CustomItemStack.create(HeadTexture.SCRIPT_NEW.getAsItemStack(), "&7> Add new Command")); menu.addMenuClickHandler(i, (pl, slot, item, action) -> { editInstruction(pl, b, script, index); return false; @@ -265,7 +265,7 @@ public void openScript(Player p, Block b, String sourceCode) { } int slot = i + (hasFreeSlot ? 1 : 0); - menu.addItem(slot, new CustomItemStack(Instruction.REPEAT.getItem(), Slimefun.getLocalization().getMessage(p, "android.scripts.instructions.REPEAT"), "", "&7\u21E8 &eLeft Click &7to return to the Android's interface")); + menu.addItem(slot, CustomItemStack.create(Instruction.REPEAT.getItem(), Slimefun.getLocalization().getMessage(p, "android.scripts.instructions.REPEAT"), "", "&7\u21E8 &eLeft Click &7to return to the Android's interface")); menu.addMenuClickHandler(slot, (pl, s, item, action) -> { BlockMenu inv = BlockStorage.getInventory(b); // Fixes #2937 @@ -285,7 +285,7 @@ public void openScript(Player p, Block b, String sourceCode) { } ItemStack stack = instruction.getItem(); - menu.addItem(i, new CustomItemStack(stack, Slimefun.getLocalization().getMessage(p, "android.scripts.instructions." + instruction.name()), "", "&7\u21E8 &eLeft Click &7to edit", "&7\u21E8 &eRight Click &7to delete", "&7\u21E8 &eShift + Right Click &7to duplicate")); + menu.addItem(i, CustomItemStack.create(stack, Slimefun.getLocalization().getMessage(p, "android.scripts.instructions." + instruction.name()), "", "&7\u21E8 &eLeft Click &7to edit", "&7\u21E8 &eRight Click &7to delete", "&7\u21E8 &eShift + Right Click &7to duplicate")); menu.addMenuClickHandler(i, (pl, slot, item, action) -> { if (action.isRightClicked() && action.isShiftClicked()) { if (script.length == 54) { @@ -392,7 +392,7 @@ protected void openScriptDownloader(Player p, Block b, int page) { return false; }); - menu.addItem(48, new CustomItemStack(HeadTexture.SCRIPT_UP.getAsItemStack(), "&eUpload a Script", "", "&6Click &7to upload your Android's Script", "&7to the Server's database")); + menu.addItem(48, CustomItemStack.create(HeadTexture.SCRIPT_UP.getAsItemStack(), "&eUpload a Script", "", "&6Click &7to upload your Android's Script", "&7to the Server's database")); menu.addMenuClickHandler(48, (pl, slot, item, action) -> { uploadScript(pl, b, page); return false; @@ -410,7 +410,7 @@ protected void openScriptDownloader(Player p, Block b, int page) { return false; }); - menu.addItem(53, new CustomItemStack(HeadTexture.SCRIPT_LEFT.getAsItemStack(), "&6> Back", "", "&7Return to the Android's interface")); + menu.addItem(53, CustomItemStack.create(HeadTexture.SCRIPT_LEFT.getAsItemStack(), "&6> Back", "", "&7Return to the Android's interface")); menu.addMenuClickHandler(53, (pl, slot, item, action) -> { openScriptEditor(pl, b); return false; @@ -487,7 +487,7 @@ public void openScriptEditor(Player p, Block b) { ChestMenu menu = new ChestMenu(ChatColor.DARK_AQUA + Slimefun.getLocalization().getMessage(p, "android.scripts.editor")); menu.setEmptySlotsClickable(false); - menu.addItem(1, new CustomItemStack(HeadTexture.SCRIPT_FORWARD.getAsItemStack(), "&2> Edit Script", "", "&aEdits your current Script")); + menu.addItem(1, CustomItemStack.create(HeadTexture.SCRIPT_FORWARD.getAsItemStack(), "&2> Edit Script", "", "&aEdits your current Script")); menu.addMenuClickHandler(1, (pl, slot, item, action) -> { String script = BlockStorage.getLocationInfo(b.getLocation()).getString("script"); // Fixes #2937 @@ -504,19 +504,19 @@ public void openScriptEditor(Player p, Block b) { return false; }); - menu.addItem(3, new CustomItemStack(HeadTexture.SCRIPT_NEW.getAsItemStack(), "&4> Create new Script", "", "&cDeletes your current Script", "&cand creates a blank one")); + menu.addItem(3, CustomItemStack.create(HeadTexture.SCRIPT_NEW.getAsItemStack(), "&4> Create new Script", "", "&cDeletes your current Script", "&cand creates a blank one")); menu.addMenuClickHandler(3, (pl, slot, item, action) -> { openScript(pl, b, DEFAULT_SCRIPT); return false; }); - menu.addItem(5, new CustomItemStack(HeadTexture.SCRIPT_DOWN.getAsItemStack(), "&6> Download a Script", "", "&eDownload a Script from the Server", "&eYou can edit or simply use it")); + menu.addItem(5, CustomItemStack.create(HeadTexture.SCRIPT_DOWN.getAsItemStack(), "&6> Download a Script", "", "&eDownload a Script from the Server", "&eYou can edit or simply use it")); menu.addMenuClickHandler(5, (pl, slot, item, action) -> { openScriptDownloader(pl, b, 1); return false; }); - menu.addItem(8, new CustomItemStack(HeadTexture.SCRIPT_LEFT.getAsItemStack(), "&6> Back", "", "&7Return to the Android's interface")); + menu.addItem(8, CustomItemStack.create(HeadTexture.SCRIPT_LEFT.getAsItemStack(), "&6> Back", "", "&7Return to the Android's interface")); menu.addMenuClickHandler(8, (pl, slot, item, action) -> { BlockMenu inv = BlockStorage.getInventory(b); // Fixes #2937 @@ -553,7 +553,7 @@ protected void editInstruction(Player p, Block b, String[] script, int index) { ChestMenuUtils.drawBackground(menu, 0, 1, 2, 3, 4, 5, 6, 7, 8); menu.setEmptySlotsClickable(false); - menu.addItem(9, new CustomItemStack(HeadTexture.SCRIPT_PAUSE.getAsItemStack(), "&fDo nothing"), (pl, slot, item, action) -> { + menu.addItem(9, CustomItemStack.create(HeadTexture.SCRIPT_PAUSE.getAsItemStack(), "&fDo nothing"), (pl, slot, item, action) -> { String code = deleteInstruction(script, index); setScript(b.getLocation(), code); openScript(p, b, code); @@ -562,7 +562,7 @@ protected void editInstruction(Player p, Block b, String[] script, int index) { int i = 10; for (Instruction instruction : getValidScriptInstructions()) { - menu.addItem(i, new CustomItemStack(instruction.getItem(), Slimefun.getLocalization().getMessage(p, "android.scripts.instructions." + instruction.name())), (pl, slot, item, action) -> { + menu.addItem(i, CustomItemStack.create(instruction.getItem(), Slimefun.getLocalization().getMessage(p, "android.scripts.instructions." + instruction.name())), (pl, slot, item, action) -> { String code = addInstruction(script, index, instruction); setScript(b.getLocation(), code); openScript(p, b, code); @@ -808,7 +808,7 @@ private boolean insertFuel(BlockMenu menu, Inventory dispenser, int slot, ItemSt if (rest > 0) { int amount = newFuel.getAmount() > rest ? rest : newFuel.getAmount(); - menu.replaceExistingItem(43, new CustomItemStack(newFuel, currentFuel.getAmount() + amount)); + menu.replaceExistingItem(43, CustomItemStack.create(newFuel, currentFuel.getAmount() + amount)); ItemUtils.consumeItem(newFuel, amount, false); } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/Script.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/Script.java index 652a75f9ba..bdb647b5cd 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/Script.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/Script.java @@ -27,7 +27,7 @@ /** * A {@link Script} represents runnable code for a {@link ProgrammableAndroid}. - * + * * @author TheBusyBiscuit * */ @@ -40,7 +40,7 @@ public final class Script { /** * This constructs a new {@link Script} from the given {@link Config}. - * + * * @param config * The {@link Config} */ @@ -64,7 +64,7 @@ private Script(@Nonnull Config config) { /** * This returns the name of this {@link Script}. - * + * * @return The name */ @Nonnull @@ -75,7 +75,7 @@ public String getName() { /** * This returns the author of this {@link Script}. * The author is the person who initially created and uploaded this {@link Script}. - * + * * @return The author of this {@link Script} */ @Nonnull @@ -87,7 +87,7 @@ public String getAuthor() { * This method returns the actual code of this {@link Script}. * It is basically a {@link String} describing the order of {@link Instruction Instructions} that * shall be executed. - * + * * @return The code for this {@link Script} */ @Nonnull @@ -98,10 +98,10 @@ public String getSourceCode() { /** * This method determines whether the given {@link OfflinePlayer} is the author of * this {@link Script}. - * + * * @param p * The {@link OfflinePlayer} to check for - * + * * @return Whether the given {@link OfflinePlayer} is the author of this {@link Script}. */ public boolean isAuthor(@Nonnull OfflinePlayer p) { @@ -111,10 +111,10 @@ public boolean isAuthor(@Nonnull OfflinePlayer p) { /** * This method checks whether a given {@link Player} is able to leave a rating for this {@link Script}. * A {@link Player} is unable to rate his own {@link Script} or a {@link Script} he already rated before. - * + * * @param p * The {@link Player} to check for - * + * * @return Whether the given {@link Player} is able to rate this {@link Script} */ public boolean canRate(@Nonnull Player p) { @@ -145,7 +145,7 @@ ItemStack getAsItemStack(@Nonnull ProgrammableAndroid android, @Nonnull Player p lore.add("&eShift + Right Click &fto leave a negative Rating"); } - return new CustomItemStack(android.getItem(), "&b" + getName(), lore.toArray(new String[0])); + return CustomItemStack.create(android.getItem(), "&b" + getName(), lore.toArray(new String[0])); } @Nonnull @@ -156,7 +156,7 @@ private String getScriptRatingPercentage() { /** * This method returns the amount of upvotes this {@link Script} has received. - * + * * @return The amount of upvotes */ public int getUpvotes() { @@ -165,7 +165,7 @@ public int getUpvotes() { /** * This method returns the amount of downvotes this {@link Script} has received. - * + * * @return The amount of downvotes */ public int getDownvotes() { @@ -174,7 +174,7 @@ public int getDownvotes() { /** * This returns how often this {@link Script} has been downloaded. - * + * * @return The amount of downloads for this {@link Script}. */ public int getDownloads() { @@ -184,7 +184,7 @@ public int getDownloads() { /** * This returns the "rating" of this {@link Script}. * This value is calculated from the up- and downvotes this {@link Script} received. - * + * * @return The rating for this {@link Script} */ public float getRating() { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/AbstractAutoCrafter.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/AbstractAutoCrafter.java index b75d3c6643..4186291716 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/AbstractAutoCrafter.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/AbstractAutoCrafter.java @@ -52,9 +52,9 @@ /** * This is the abstract super class for our auto crafters. - * + * * @author TheBusyBiscuit - * + * * @see VanillaAutoCrafter * @see EnhancedAutoCrafter * @@ -117,7 +117,7 @@ public boolean isSynchronized() { *

* Do not call this method directly, see our {@link AutoCrafterListener} for the intended * use case. - * + * * @param b * The {@link Block} that was clicked * @param p @@ -153,7 +153,7 @@ public void onRightClick(Block b, Player p) { /** * This method performs one tick for the {@link AbstractAutoCrafter}. - * + * * @param b * The block for this {@link AbstractAutoCrafter} * @param data @@ -192,10 +192,10 @@ protected void tick(@Nonnull Block b, @Nonnull Config data) { * where the Auto Crafter could be placed upon. * Right now this only supports chests and a few select tile entities but it can change or * be overridden in the future. - * + * * @param block * The {@link Block} to check - * + * * @return Whether that {@link Block} has a valid {@link Inventory} */ protected boolean isValidInventory(@Nonnull Block block) { @@ -207,10 +207,10 @@ protected boolean isValidInventory(@Nonnull Block block) { /** * This method returns the currently selected {@link AbstractRecipe} for the given * {@link Block}. - * + * * @param b * The {@link Block} - * + * * @return The currently selected {@link AbstractRecipe} or null */ @Nullable @@ -220,7 +220,7 @@ protected boolean isValidInventory(@Nonnull Block block) { * This method is called when a {@link Player} right clicks the {@link AbstractAutoCrafter} * while holding the shift button. * Use it to choose the {@link AbstractRecipe}. - * + * * @param b * The {@link Block} which was clicked * @param p @@ -231,7 +231,7 @@ protected boolean isValidInventory(@Nonnull Block block) { /** * This method sets the selected {@link AbstractRecipe} for the given {@link Block}. * The recipe will be stored using the {@link PersistentDataAPI}. - * + * * @param b * The {@link Block} to store the data on * @param recipe @@ -264,7 +264,7 @@ protected void setSelectedRecipe(@Nonnull Block b, @Nullable AbstractRecipe reci /** * This shows the given {@link AbstractRecipe} to the {@link Player} in a preview window. - * + * * @param p * The {@link Player} * @param b @@ -286,7 +286,7 @@ protected void showRecipe(Player p, Block b, AbstractRecipe recipe) { ChestMenuUtils.drawBackground(menu, 45, 46, 47, 48, 50, 51, 52, 53); if (recipe.isEnabled()) { - menu.addItem(49, new CustomItemStack(Material.BARRIER, Slimefun.getLocalization().getMessages(p, "messages.auto-crafting.tooltips.enabled"))); + menu.addItem(49, CustomItemStack.create(Material.BARRIER, Slimefun.getLocalization().getMessages(p, "messages.auto-crafting.tooltips.enabled"))); menu.addMenuClickHandler(49, (pl, item, slot, action) -> { if (action.isRightClicked()) { deleteRecipe(pl, b); @@ -297,7 +297,7 @@ protected void showRecipe(Player p, Block b, AbstractRecipe recipe) { return false; }); } else { - menu.addItem(49, new CustomItemStack(HeadTexture.EXCLAMATION_MARK.getAsItemStack(), Slimefun.getLocalization().getMessages(p, "messages.auto-crafting.tooltips.disabled"))); + menu.addItem(49, CustomItemStack.create(HeadTexture.EXCLAMATION_MARK.getAsItemStack(), Slimefun.getLocalization().getMessages(p, "messages.auto-crafting.tooltips.disabled"))); menu.addMenuClickHandler(49, (pl, item, slot, action) -> { if (action.isRightClicked()) { deleteRecipe(pl, b); @@ -350,12 +350,12 @@ private void deleteRecipe(Player p, Block b) { /** * This method checks whether the given {@link Predicate} matches the provided {@link ItemStack}. - * + * * @param item * The {@link ItemStack} to check * @param predicate * The {@link Predicate} - * + * * @return Whether the {@link Predicate} matches the {@link ItemStack} */ @ParametersAreNonnullByDefault @@ -390,12 +390,12 @@ protected boolean matchesAny(Inventory inv, Map itemQuantities * the given {@link Inventory}. * This will consume items and add the result to the {@link Inventory}. * This method does not handle energy consumption. - * + * * @param inv * The {@link Inventory} to take resources from * @param recipe * The {@link AbstractRecipe} to craft - * + * * @return Whether this crafting operation was successful or not */ public boolean craft(@Nonnull Inventory inv, @Nonnull AbstractRecipe recipe) { @@ -461,10 +461,10 @@ public boolean craft(@Nonnull Inventory inv, @Nonnull AbstractRecipe recipe) { * However we cannot use this method as it is only available in the latest 1.16 snapshots * of Spigot, not even on earlier 1.16 builds... * But this gives us more control over the leftovers anyway! - * + * * @param item * The {@link ItemStack} that is being consumed - * + * * @return The leftover item or null if the item is fully consumed */ @Nullable @@ -484,7 +484,7 @@ private ItemStack getLeftoverItem(@Nonnull ItemStack item) { /** * This method returns the max amount of electricity this machine can hold. - * + * * @return The max amount of electricity this Block can store. */ @Override @@ -494,7 +494,7 @@ public int getCapacity() { /** * This method returns the amount of energy that is consumed per operation. - * + * * @return The rate of energy consumption */ public int getEnergyConsumption() { @@ -505,10 +505,10 @@ public int getEnergyConsumption() { * This sets the energy capacity for this machine. * This method must be called before registering the item * and only before registering. - * + * * @param capacity * The amount of energy this machine can store - * + * * @return This method will return the current instance of {@link AContainer}, so that it can be chained. */ @Nonnull @@ -525,10 +525,10 @@ public final AbstractAutoCrafter setCapacity(int capacity) { /** * This method sets the energy consumed by this machine per tick. - * + * * @param energyConsumption * The energy consumed per tick - * + * * @return This method will return the current instance of {@link AContainer}, so that it can be chained. */ @Nonnull diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/SlimefunAutoCrafter.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/SlimefunAutoCrafter.java index 620e689b70..d6b730b981 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/SlimefunAutoCrafter.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/SlimefunAutoCrafter.java @@ -33,9 +33,9 @@ * {@link RecipeType}. * The concrete implementation for this can be seen in the {@link EnhancedAutoCrafter} but * it theoretically works for any {@link RecipeType}. - * + * * @author TheBusyBiscuit - * + * * @see EnhancedAutoCrafter * */ @@ -95,7 +95,7 @@ protected void updateRecipe(@Nonnull Block b, @Nonnull Player p) { ChestMenuUtils.drawBackground(menu, background); ChestMenuUtils.drawBackground(menu, 45, 46, 47, 48, 50, 51, 52, 53); - menu.addItem(49, new CustomItemStack(Material.CRAFTING_TABLE, ChatColor.GREEN + Slimefun.getLocalization().getMessage(p, "messages.auto-crafting.select"))); + menu.addItem(49, CustomItemStack.create(Material.CRAFTING_TABLE, ChatColor.GREEN + Slimefun.getLocalization().getMessage(p, "messages.auto-crafting.select"))); menu.addMenuClickHandler(49, (pl, stack, slot, action) -> { setSelectedRecipe(b, recipe); SoundEffect.AUTO_CRAFTER_UPDATE_RECIPE.playAt(b); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/VanillaAutoCrafter.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/VanillaAutoCrafter.java index e9c9c962dc..5885d99aec 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/VanillaAutoCrafter.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/VanillaAutoCrafter.java @@ -43,9 +43,9 @@ * The {@link VanillaAutoCrafter} is an implementation of the {@link AbstractAutoCrafter}. * It can craft items that are crafted using a normal crafting table. * Only {@link ShapedRecipe} and {@link ShapelessRecipe} are therefore supported. - * + * * @author TheBusyBiscuit - * + * * @see AbstractAutoCrafter * @see EnhancedAutoCrafter * @see VanillaRecipe @@ -154,7 +154,7 @@ private void offerRecipe(Player p, Block b, List recipes, int index, Che AbstractRecipe recipe = AbstractRecipe.of(recipes.get(index)); - menu.replaceExistingItem(49, new CustomItemStack(Material.CRAFTING_TABLE, ChatColor.GREEN + Slimefun.getLocalization().getMessage(p, "messages.auto-crafting.select"))); + menu.replaceExistingItem(49, CustomItemStack.create(Material.CRAFTING_TABLE, ChatColor.GREEN + Slimefun.getLocalization().getMessage(p, "messages.auto-crafting.select"))); menu.addMenuClickHandler(49, (pl, slot, item, action) -> { setSelectedRecipe(b, recipe); pl.closeInventory(); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/HologramProjector.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/HologramProjector.java index 21891d293a..640d0d375a 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/HologramProjector.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/HologramProjector.java @@ -35,11 +35,11 @@ /** * The {@link HologramProjector} is a very simple block which allows the {@link Player} * to create a floating text that is completely configurable. - * + * * @author TheBusyBiscuit * @author Kry-Vosa * @author SoSeDiK - * + * * @see HologramOwner * @see HologramsService * @@ -97,7 +97,7 @@ public void onBlockBreak(@Nonnull Block b) { private void openEditor(@Nonnull Player p, @Nonnull Block projector) { ChestMenu menu = new ChestMenu(Slimefun.getLocalization().getMessage(p, "machines.HOLOGRAM_PROJECTOR.inventory-title")); - menu.addItem(0, new CustomItemStack(Material.NAME_TAG, "&7Text &e(Click to edit)", "", "&f" + ChatColors.color(BlockStorage.getLocationInfo(projector.getLocation(), "text")))); + menu.addItem(0, CustomItemStack.create(Material.NAME_TAG, "&7Text &e(Click to edit)", "", "&f" + ChatColors.color(BlockStorage.getLocationInfo(projector.getLocation(), "text")))); menu.addMenuClickHandler(0, (pl, slot, item, action) -> { pl.closeInventory(); Slimefun.getLocalization().sendMessage(pl, "machines.HOLOGRAM_PROJECTOR.enter-text", true); @@ -119,7 +119,7 @@ private void openEditor(@Nonnull Player p, @Nonnull Block projector) { return false; }); - menu.addItem(1, new CustomItemStack(Material.CLOCK, "&7Offset: &e" + NumberUtils.roundDecimalNumber(Double.valueOf(BlockStorage.getLocationInfo(projector.getLocation(), OFFSET_PARAMETER)) + 1.0D), "", "&fLeft Click: &7+0.1", "&fRight Click: &7-0.1")); + menu.addItem(1, CustomItemStack.create(Material.CLOCK, "&7Offset: &e" + NumberUtils.roundDecimalNumber(Double.valueOf(BlockStorage.getLocationInfo(projector.getLocation(), OFFSET_PARAMETER)) + 1.0D), "", "&fLeft Click: &7+0.1", "&fRight Click: &7-0.1")); menu.addMenuClickHandler(1, (pl, slot, item, action) -> { double offset = NumberUtils.reparseDouble(Double.valueOf(BlockStorage.getLocationInfo(projector.getLocation(), OFFSET_PARAMETER)) + (action.isRightClicked() ? -0.1F : 0.1F)); ArmorStand hologram = getArmorStand(projector, true); @@ -152,7 +152,7 @@ private static ArmorStand getArmorStand(@Nonnull Block projector, boolean create if (!createIfNoneExists) { return null; } - + return ArmorStandUtils.spawnArmorStand(l, nametag); } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/AbstractCargoNode.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/AbstractCargoNode.java index b662a060c1..c335e7fc25 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/AbstractCargoNode.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/AbstractCargoNode.java @@ -32,7 +32,7 @@ /** * This abstract class is the super class of all cargo nodes. - * + * * @author TheBusyBiscuit * */ @@ -91,7 +91,7 @@ public void onPlayerPlace(BlockPlaceEvent e) { protected void addChannelSelector(Block b, BlockMenu menu, int slotPrev, int slotCurrent, int slotNext) { int channel = getSelectedChannel(b); - menu.replaceExistingItem(slotPrev, new CustomItemStack(HeadTexture.CARGO_ARROW_LEFT.getAsItemStack(), "&bPrevious Channel", "", "&e> Click to decrease the Channel ID by 1")); + menu.replaceExistingItem(slotPrev, CustomItemStack.create(HeadTexture.CARGO_ARROW_LEFT.getAsItemStack(), "&bPrevious Channel", "", "&e> Click to decrease the Channel ID by 1")); menu.addMenuClickHandler(slotPrev, (p, slot, item, action) -> { int newChannel = channel - 1; @@ -105,14 +105,14 @@ protected void addChannelSelector(Block b, BlockMenu menu, int slotPrev, int slo }); if (channel == 16) { - menu.replaceExistingItem(slotCurrent, new CustomItemStack(HeadTexture.CHEST_TERMINAL.getAsItemStack(), "&bChannel ID: &3" + (channel + 1))); + menu.replaceExistingItem(slotCurrent, CustomItemStack.create(HeadTexture.CHEST_TERMINAL.getAsItemStack(), "&bChannel ID: &3" + (channel + 1))); menu.addMenuClickHandler(slotCurrent, ChestMenuUtils.getEmptyClickHandler()); } else { - menu.replaceExistingItem(slotCurrent, new CustomItemStack(ColoredMaterial.WOOL.get(channel), "&bChannel ID: &3" + (channel + 1))); + menu.replaceExistingItem(slotCurrent, CustomItemStack.create(ColoredMaterial.WOOL.get(channel), "&bChannel ID: &3" + (channel + 1))); menu.addMenuClickHandler(slotCurrent, ChestMenuUtils.getEmptyClickHandler()); } - menu.replaceExistingItem(slotNext, new CustomItemStack(HeadTexture.CARGO_ARROW_RIGHT.getAsItemStack(), "&bNext Channel", "", "&e> Click to increase the Channel ID by 1")); + menu.replaceExistingItem(slotNext, CustomItemStack.create(HeadTexture.CARGO_ARROW_RIGHT.getAsItemStack(), "&bNext Channel", "", "&e> Click to increase the Channel ID by 1")); menu.addMenuClickHandler(slotNext, (p, slot, item, action) -> { int newChannel = channel + 1; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/AbstractFilterNode.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/AbstractFilterNode.java index d3197270bf..c28891e81a 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/AbstractFilterNode.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/AbstractFilterNode.java @@ -25,9 +25,9 @@ /** * This abstract super class represents all filtered Cargo nodes. - * + * * @author TheBusyBiscuit - * + * * @see CargoInputNode * @see AdvancedCargoOutputNode * @@ -80,10 +80,10 @@ protected void onPlace(BlockPlaceEvent e) { @Override protected void createBorder(BlockMenuPreset preset) { for (int i : getBorder()) { - preset.addItem(i, new CustomItemStack(Material.CYAN_STAINED_GLASS_PANE, " "), ChestMenuUtils.getEmptyClickHandler()); + preset.addItem(i, CustomItemStack.create(Material.CYAN_STAINED_GLASS_PANE, " "), ChestMenuUtils.getEmptyClickHandler()); } - preset.addItem(2, new CustomItemStack(Material.PAPER, "&3Items", "", "&bPut in all Items you want to", "&bblacklist/whitelist"), ChestMenuUtils.getEmptyClickHandler()); + preset.addItem(2, CustomItemStack.create(Material.PAPER, "&3Items", "", "&bPut in all Items you want to", "&bblacklist/whitelist"), ChestMenuUtils.getEmptyClickHandler()); } @Override @@ -92,14 +92,14 @@ protected void updateBlockMenu(BlockMenu menu, Block b) { String filterType = BlockStorage.getLocationInfo(loc, FILTER_TYPE); if (!BlockStorage.hasBlockInfo(b) || filterType == null || filterType.equals("whitelist")) { - menu.replaceExistingItem(15, new CustomItemStack(Material.WHITE_WOOL, "&7Type: &rWhitelist", "", "&e> Click to change it to Blacklist")); + menu.replaceExistingItem(15, CustomItemStack.create(Material.WHITE_WOOL, "&7Type: &rWhitelist", "", "&e> Click to change it to Blacklist")); menu.addMenuClickHandler(15, (p, slot, item, action) -> { BlockStorage.addBlockInfo(b, FILTER_TYPE, "blacklist"); updateBlockMenu(menu, b); return false; }); } else { - menu.replaceExistingItem(15, new CustomItemStack(Material.BLACK_WOOL, "&7Type: &8Blacklist", "", "&e> Click to change it to Whitelist")); + menu.replaceExistingItem(15, CustomItemStack.create(Material.BLACK_WOOL, "&7Type: &8Blacklist", "", "&e> Click to change it to Whitelist")); menu.addMenuClickHandler(15, (p, slot, item, action) -> { BlockStorage.addBlockInfo(b, FILTER_TYPE, "whitelist"); updateBlockMenu(menu, b); @@ -110,14 +110,14 @@ protected void updateBlockMenu(BlockMenu menu, Block b) { String lore = BlockStorage.getLocationInfo(b.getLocation(), FILTER_LORE); if (!BlockStorage.hasBlockInfo(b) || lore == null || lore.equals(String.valueOf(true))) { - menu.replaceExistingItem(25, new CustomItemStack(Material.MAP, "&7Include Lore: &2\u2714", "", "&e> Click to toggle whether the Lore has to match")); + menu.replaceExistingItem(25, CustomItemStack.create(Material.MAP, "&7Include Lore: &2\u2714", "", "&e> Click to toggle whether the Lore has to match")); menu.addMenuClickHandler(25, (p, slot, item, action) -> { BlockStorage.addBlockInfo(b, FILTER_LORE, String.valueOf(false)); updateBlockMenu(menu, b); return false; }); } else { - menu.replaceExistingItem(25, new CustomItemStack(Material.MAP, "&7Include Lore: &4\u2718", "", "&e> Click to toggle whether the Lore has to match")); + menu.replaceExistingItem(25, CustomItemStack.create(Material.MAP, "&7Include Lore: &4\u2718", "", "&e> Click to toggle whether the Lore has to match")); menu.addMenuClickHandler(25, (p, slot, item, action) -> { BlockStorage.addBlockInfo(b, FILTER_LORE, String.valueOf(true)); updateBlockMenu(menu, b); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/CargoInputNode.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/CargoInputNode.java index d39557bf5d..fe32c6fe7d 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/CargoInputNode.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/CargoInputNode.java @@ -47,14 +47,14 @@ protected void updateBlockMenu(BlockMenu menu, Block b) { String roundRobinMode = BlockStorage.getLocationInfo(b.getLocation(), ROUND_ROBIN_MODE); if (!BlockStorage.hasBlockInfo(b) || roundRobinMode == null || roundRobinMode.equals(String.valueOf(false))) { - menu.replaceExistingItem(24, new CustomItemStack(HeadTexture.ENERGY_REGULATOR.getAsItemStack(), "&7Round-Robin Mode: &4\u2718", "", "&e> Click to enable Round Robin Mode", "&e(Items will be equally distributed on the Channel)")); + menu.replaceExistingItem(24, CustomItemStack.create(HeadTexture.ENERGY_REGULATOR.getAsItemStack(), "&7Round-Robin Mode: &4\u2718", "", "&e> Click to enable Round Robin Mode", "&e(Items will be equally distributed on the Channel)")); menu.addMenuClickHandler(24, (p, slot, item, action) -> { BlockStorage.addBlockInfo(b, ROUND_ROBIN_MODE, String.valueOf(true)); updateBlockMenu(menu, b); return false; }); } else { - menu.replaceExistingItem(24, new CustomItemStack(HeadTexture.ENERGY_REGULATOR.getAsItemStack(), "&7Round-Robin Mode: &2\u2714", "", "&e> Click to disable Round Robin Mode", "&e(Items will be equally distributed on the Channel)")); + menu.replaceExistingItem(24, CustomItemStack.create(HeadTexture.ENERGY_REGULATOR.getAsItemStack(), "&7Round-Robin Mode: &2\u2714", "", "&e> Click to disable Round Robin Mode", "&e(Items will be equally distributed on the Channel)")); menu.addMenuClickHandler(24, (p, slot, item, action) -> { BlockStorage.addBlockInfo(b, ROUND_ROBIN_MODE, String.valueOf(false)); updateBlockMenu(menu, b); @@ -64,14 +64,14 @@ protected void updateBlockMenu(BlockMenu menu, Block b) { String smartFillNode = BlockStorage.getLocationInfo(b.getLocation(), SMART_FILL_MODE); if (!BlockStorage.hasBlockInfo(b) || smartFillNode == null || smartFillNode.equals(String.valueOf(false))) { - menu.replaceExistingItem(16, new CustomItemStack(Material.WRITABLE_BOOK, "&7\"Smart-Filling\" Mode: &4\u2718", "", "&e> Click to enable \"Smart-Filling\" Mode", "", "&fIn this mode, the Cargo node will attempt", "&fto keep a constant amount of items", "&fin the inventory. This is not perfect", "&fand will still fill in empty slots that", "&fcome before a stack of a configured item.")); + menu.replaceExistingItem(16, CustomItemStack.create(Material.WRITABLE_BOOK, "&7\"Smart-Filling\" Mode: &4\u2718", "", "&e> Click to enable \"Smart-Filling\" Mode", "", "&fIn this mode, the Cargo node will attempt", "&fto keep a constant amount of items", "&fin the inventory. This is not perfect", "&fand will still fill in empty slots that", "&fcome before a stack of a configured item.")); menu.addMenuClickHandler(16, (p, slot, item, action) -> { BlockStorage.addBlockInfo(b, SMART_FILL_MODE, String.valueOf(true)); updateBlockMenu(menu, b); return false; }); } else { - menu.replaceExistingItem(16, new CustomItemStack(Material.WRITTEN_BOOK, "&7\"Smart-Filling\" Mode: &2\u2714", "", "&e> Click to disable \"Smart-Filling\" Mode", "", "&fIn this mode, the Cargo node will attempt", "&fto keep a constant amount of items", "&fin the inventory. This is not perfect", "&fand will still fill in empty slots that", "&fcome before a stack of a configured item.")); + menu.replaceExistingItem(16, CustomItemStack.create(Material.WRITTEN_BOOK, "&7\"Smart-Filling\" Mode: &2\u2714", "", "&e> Click to disable \"Smart-Filling\" Mode", "", "&fIn this mode, the Cargo node will attempt", "&fto keep a constant amount of items", "&fin the inventory. This is not perfect", "&fand will still fill in empty slots that", "&fcome before a stack of a configured item.")); menu.addMenuClickHandler(16, (p, slot, item, action) -> { BlockStorage.addBlockInfo(b, SMART_FILL_MODE, String.valueOf(false)); updateBlockMenu(menu, b); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/CargoOutputNode.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/CargoOutputNode.java index c0c7f0efd0..d00de44ea7 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/CargoOutputNode.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/CargoOutputNode.java @@ -39,7 +39,7 @@ protected void onPlace(BlockPlaceEvent e) { @Override protected void createBorder(BlockMenuPreset preset) { for (int i : BORDER) { - preset.addItem(i, new CustomItemStack(Material.CYAN_STAINED_GLASS_PANE, " "), ChestMenuUtils.getEmptyClickHandler()); + preset.addItem(i, CustomItemStack.create(Material.CYAN_STAINED_GLASS_PANE, " "), ChestMenuUtils.getEmptyClickHandler()); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/ReactorAccessPort.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/ReactorAccessPort.java index 241c1f00f7..52b61e10d2 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/ReactorAccessPort.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/ReactorAccessPort.java @@ -35,7 +35,7 @@ * The {@link ReactorAccessPort} is a block which acts as an interface * between a {@link Reactor} and a {@link CargoNet}. * Any item placed into the port will get transferred to the {@link Reactor}. - * + * * @author TheBusyBiscuit * @author AlexLander123 * @@ -72,7 +72,7 @@ public void newInstance(BlockMenu menu, Block b) { BlockMenu reactor = getReactor(b.getLocation()); if (reactor != null) { - menu.replaceExistingItem(INFO_SLOT, new CustomItemStack(Material.GREEN_WOOL, "&7Reactor", "", "&6Detected", "", "&7> Click to view Reactor")); + menu.replaceExistingItem(INFO_SLOT, CustomItemStack.create(Material.GREEN_WOOL, "&7Reactor", "", "&6Detected", "", "&7> Click to view Reactor")); menu.addMenuClickHandler(INFO_SLOT, (p, slot, item, action) -> { if (reactor != null) { reactor.open(p); @@ -83,7 +83,7 @@ public void newInstance(BlockMenu menu, Block b) { return false; }); } else { - menu.replaceExistingItem(INFO_SLOT, new CustomItemStack(Material.RED_WOOL, "&7Reactor", "", "&cNot detected", "", "&7Reactor must be", "&7placed 3 blocks below", "&7the access port!")); + menu.replaceExistingItem(INFO_SLOT, CustomItemStack.create(Material.RED_WOOL, "&7Reactor", "", "&cNot detected", "", "&7Reactor must be", "&7placed 3 blocks below", "&7the access port!")); menu.addMenuClickHandler(INFO_SLOT, (p, slot, item, action) -> { newInstance(menu, b); return false; @@ -135,13 +135,13 @@ public void onBlockBreak(@Nonnull Block b) { private void constructMenu(@Nonnull BlockMenuPreset preset) { preset.drawBackground(ChestMenuUtils.getBackground(), background); - preset.drawBackground(new CustomItemStack(Material.LIME_STAINED_GLASS_PANE, " "), fuelBorder); - preset.drawBackground(new CustomItemStack(Material.CYAN_STAINED_GLASS_PANE, " "), inputBorder); - preset.drawBackground(new CustomItemStack(Material.GREEN_STAINED_GLASS_PANE, " "), outputBorder); + preset.drawBackground(CustomItemStack.create(Material.LIME_STAINED_GLASS_PANE, " "), fuelBorder); + preset.drawBackground(CustomItemStack.create(Material.CYAN_STAINED_GLASS_PANE, " "), inputBorder); + preset.drawBackground(CustomItemStack.create(Material.GREEN_STAINED_GLASS_PANE, " "), outputBorder); - preset.addItem(1, new CustomItemStack(SlimefunItems.URANIUM, "&7Fuel Slot", "", "&rThis Slot accepts radioactive Fuel such as:", "&2Uranium &ror &aNeptunium"), ChestMenuUtils.getEmptyClickHandler()); - preset.addItem(22, new CustomItemStack(SlimefunItems.PLUTONIUM, "&7Byproduct Slot", "", "&rThis Slot contains the Reactor's Byproduct", "&rsuch as &aNeptunium &ror &7Plutonium"), ChestMenuUtils.getEmptyClickHandler()); - preset.addItem(7, new CustomItemStack(SlimefunItems.REACTOR_COOLANT_CELL, "&bCoolant Slot", "", "&rThis Slot accepts Coolant Cells", "&4Without any Coolant Cells, your Reactor", "&4will explode"), ChestMenuUtils.getEmptyClickHandler()); + preset.addItem(1, CustomItemStack.create(SlimefunItems.URANIUM.item(), "&7Fuel Slot", "", "&rThis Slot accepts radioactive Fuel such as:", "&2Uranium &ror &aNeptunium"), ChestMenuUtils.getEmptyClickHandler()); + preset.addItem(22, CustomItemStack.create(SlimefunItems.PLUTONIUM.item(), "&7Byproduct Slot", "", "&rThis Slot contains the Reactor's Byproduct", "&rsuch as &aNeptunium &ror &7Plutonium"), ChestMenuUtils.getEmptyClickHandler()); + preset.addItem(7, CustomItemStack.create(SlimefunItems.REACTOR_COOLANT_CELL.item(), "&bCoolant Slot", "", "&rThis Slot accepts Coolant Cells", "&4Without any Coolant Cells, your Reactor", "&4will explode"), ChestMenuUtils.getEmptyClickHandler()); } @Nonnull diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/TrashCan.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/TrashCan.java index bc5e86aef4..a61f8deb54 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/TrashCan.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/cargo/TrashCan.java @@ -23,14 +23,14 @@ /** * The {@link TrashCan} is a simple container which simply voids all * items that enter it. - * + * * @author TheBusyBiscuit * */ public class TrashCan extends SlimefunItem implements InventoryBlock { private final int[] border = { 0, 1, 2, 3, 5, 4, 6, 7, 8, 9, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 }; - private final ItemStack background = new CustomItemStack(Material.RED_STAINED_GLASS_PANE, " "); + private final ItemStack background = CustomItemStack.create(Material.RED_STAINED_GLASS_PANE, " "); @ParametersAreNonnullByDefault public TrashCan(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/BioGenerator.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/BioGenerator.java index cbbf092f6e..c9cd289dec 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/BioGenerator.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/BioGenerator.java @@ -69,7 +69,7 @@ protected void registerDefaultFuelTypes() { registerFuel(new MachineFuel(4, new ItemStack(Material.SHROOMLIGHT))); registerFuel(new MachineFuel(2, new ItemStack(Material.CRIMSON_FUNGUS))); registerFuel(new MachineFuel(2, new ItemStack(Material.WARPED_FUNGUS))); - registerFuel(new MachineFuel(16, SlimefunItems.STRANGE_NETHER_GOO)); + registerFuel(new MachineFuel(16, SlimefunItems.STRANGE_NETHER_GOO.item())); if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_17)) { registerFuel(new MachineFuel(2, new ItemStack(Material.GLOW_BERRIES))); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/CombustionGenerator.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/CombustionGenerator.java index 6d9bc6993b..eb69dc5718 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/CombustionGenerator.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/generators/CombustionGenerator.java @@ -22,8 +22,8 @@ public CombustionGenerator(ItemGroup itemGroup, SlimefunItemStack item, RecipeTy @Override protected void registerDefaultFuelTypes() { - registerFuel(new MachineFuel(30, SlimefunItems.OIL_BUCKET)); - registerFuel(new MachineFuel(90, SlimefunItems.FUEL_BUCKET)); + registerFuel(new MachineFuel(30, SlimefunItems.OIL_BUCKET.item())); + registerFuel(new MachineFuel(90, SlimefunItems.FUEL_BUCKET.item())); } @Override diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoAnvil.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoAnvil.java index 16329948bf..20b5a12d40 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoAnvil.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoAnvil.java @@ -49,7 +49,7 @@ protected MachineRecipe findNextRecipe(BlockMenu menu) { ItemStack item = menu.getItemInSlot(slot); if (item != null && item.getType().getMaxDurability() > 0 && ((Damageable) item.getItemMeta()).getDamage() > 0) { - if (SlimefunUtils.isItemSimilar(ductTape, SlimefunItems.DUCT_TAPE, true, false)) { + if (SlimefunUtils.isItemSimilar(ductTape, SlimefunItems.DUCT_TAPE.item(), true, false)) { ItemStack repairedItem = repair(item); if (!menu.fits(repairedItem, getOutputSlots())) { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoBrewer.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoBrewer.java index 962bc2d32f..6dcd35c335 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoBrewer.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoBrewer.java @@ -1,6 +1,6 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.electric.machines; -import java.util.EnumMap; +import java.util.HashMap; import java.util.Map; import javax.annotation.Nonnull; @@ -33,8 +33,8 @@ */ public class AutoBrewer extends AContainer implements NotHopperable { - private static final Map potionRecipes = new EnumMap<>(Material.class); - private static final Map fermentations = new EnumMap<>(PotionType.class); + private static final Map potionRecipes = new HashMap<>(); + private static final Map fermentations = new HashMap<>(); static { potionRecipes.put(Material.SUGAR, VersionedPotionType.SWIFTNESS); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoDrier.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoDrier.java index 0be46da7f9..e7245f5992 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoDrier.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/AutoDrier.java @@ -62,25 +62,25 @@ protected void registerDefaultRecipes() { recipeList.add(new ItemStack(Material.BUCKET)); recipeList.add(new ItemStack(Material.COOKED_BEEF)); - recipeList.add(SlimefunItems.BEEF_JERKY); + recipeList.add(SlimefunItems.BEEF_JERKY.item()); recipeList.add(new ItemStack(Material.COOKED_PORKCHOP)); - recipeList.add(SlimefunItems.PORK_JERKY); + recipeList.add(SlimefunItems.PORK_JERKY.item()); recipeList.add(new ItemStack(Material.COOKED_CHICKEN)); - recipeList.add(SlimefunItems.CHICKEN_JERKY); + recipeList.add(SlimefunItems.CHICKEN_JERKY.item()); recipeList.add(new ItemStack(Material.COOKED_MUTTON)); - recipeList.add(SlimefunItems.MUTTON_JERKY); + recipeList.add(SlimefunItems.MUTTON_JERKY.item()); recipeList.add(new ItemStack(Material.COOKED_RABBIT)); - recipeList.add(SlimefunItems.RABBIT_JERKY); + recipeList.add(SlimefunItems.RABBIT_JERKY.item()); recipeList.add(new ItemStack(Material.COOKED_COD)); - recipeList.add(SlimefunItems.FISH_JERKY); + recipeList.add(SlimefunItems.FISH_JERKY.item()); recipeList.add(new ItemStack(Material.COOKED_SALMON)); - recipeList.add(SlimefunItems.FISH_JERKY); + recipeList.add(SlimefunItems.FISH_JERKY.item()); if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_19)) { recipeList.add(new ItemStack(Material.MUD)); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/CarbonPress.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/CarbonPress.java index 4772b718d4..1ea7aa7769 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/CarbonPress.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/CarbonPress.java @@ -24,12 +24,12 @@ public CarbonPress(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recip @Override protected void registerDefaultRecipes() { registerRecipe(15, new ItemStack[] { new ItemStack(Material.CHARCOAL, 4) }, new ItemStack[] { new ItemStack(Material.COAL) }); - registerRecipe(20, new ItemStack[] { new ItemStack(Material.COAL, 8) }, new ItemStack[] { SlimefunItems.CARBON }); - registerRecipe(180, new ItemStack[] { new ItemStack(Material.COAL_BLOCK, 8) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.CARBON, 9) }); - registerRecipe(30, new ItemStack[] { new CustomItemStack(SlimefunItems.CARBON, 4) }, new ItemStack[] { SlimefunItems.COMPRESSED_CARBON }); - registerRecipe(60, new ItemStack[] { SlimefunItems.CARBON_CHUNK, SlimefunItems.SYNTHETIC_DIAMOND }, new ItemStack[] { SlimefunItems.RAW_CARBONADO }); - registerRecipe(60, new ItemStack[] { SlimefunItems.CARBON_CHUNK }, new ItemStack[] { SlimefunItems.SYNTHETIC_DIAMOND }); - registerRecipe(90, new ItemStack[] { SlimefunItems.RAW_CARBONADO }, new ItemStack[] { SlimefunItems.CARBONADO }); + registerRecipe(20, new ItemStack[] { new ItemStack(Material.COAL, 8) }, new ItemStack[] { SlimefunItems.CARBON.item() }); + registerRecipe(180, new ItemStack[] { new ItemStack(Material.COAL_BLOCK, 8) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.CARBON, 9).item() }); + registerRecipe(30, new ItemStack[] { CustomItemStack.create(SlimefunItems.CARBON.item(), 4) }, new ItemStack[] { SlimefunItems.COMPRESSED_CARBON.item() }); + registerRecipe(60, new ItemStack[] { SlimefunItems.CARBON_CHUNK.item(), SlimefunItems.SYNTHETIC_DIAMOND.item() }, new ItemStack[] { SlimefunItems.RAW_CARBONADO.item() }); + registerRecipe(60, new ItemStack[] { SlimefunItems.CARBON_CHUNK.item() }, new ItemStack[] { SlimefunItems.SYNTHETIC_DIAMOND.item() }); + registerRecipe(90, new ItemStack[] { SlimefunItems.RAW_CARBONADO.item() }, new ItemStack[] { SlimefunItems.CARBONADO.item() }); } @Override diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricDustWasher.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricDustWasher.java index ad56c3d8a9..d640571f2f 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricDustWasher.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricDustWasher.java @@ -48,21 +48,21 @@ protected MachineRecipe findNextRecipe(BlockMenu menu) { for (int slot : getInputSlots()) { ItemStack input = menu.getItemInSlot(slot); MachineRecipe recipe = null; - if (SlimefunUtils.isItemSimilar(input, SlimefunItems.SIFTED_ORE, true, false)) { + if (SlimefunUtils.isItemSimilar(input, SlimefunItems.SIFTED_ORE.item(), true, false)) { if (!legacyMode && !hasFreeSlot(menu)) { return null; } - recipe = new MachineRecipe(4 / getSpeed(), new ItemStack[] { SlimefunItems.SIFTED_ORE }, new ItemStack[] { oreWasher.getRandomDust() }); + recipe = new MachineRecipe(4 / getSpeed(), new ItemStack[] { SlimefunItems.SIFTED_ORE.item() }, new ItemStack[] { oreWasher.getRandomDust() }); if (!legacyMode || menu.fits(recipe.getOutput()[0], getOutputSlots())) { menu.consumeItem(slot); return recipe; } - } else if (SlimefunUtils.isItemSimilar(input, SlimefunItems.PULVERIZED_ORE, true)) { - recipe = new MachineRecipe(4 / getSpeed(), new ItemStack[] { SlimefunItems.PULVERIZED_ORE }, new ItemStack[] { SlimefunItems.PURE_ORE_CLUSTER }); + } else if (SlimefunUtils.isItemSimilar(input, SlimefunItems.PULVERIZED_ORE.item(), true)) { + recipe = new MachineRecipe(4 / getSpeed(), new ItemStack[] { SlimefunItems.PULVERIZED_ORE.item() }, new ItemStack[] { SlimefunItems.PURE_ORE_CLUSTER.item() }); } else if (SlimefunUtils.isItemSimilar(input, new ItemStack(Material.SAND), true)) { - recipe = new MachineRecipe(4 / getSpeed(), new ItemStack[] { new ItemStack(Material.SAND) }, new ItemStack[] { SlimefunItems.SALT }); + recipe = new MachineRecipe(4 / getSpeed(), new ItemStack[] { new ItemStack(Material.SAND) }, new ItemStack[] { SlimefunItems.SALT.item() }); } if (recipe != null && menu.fits(recipe.getOutput()[0], getOutputSlots())) { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricIngotPulverizer.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricIngotPulverizer.java index 28c2638822..12a93cb07b 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricIngotPulverizer.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricIngotPulverizer.java @@ -54,10 +54,10 @@ public List getDisplayRecipes() { protected void registerDefaultRecipes() { // this is an extra recipe on top of PostSetup.loadSmelteryRecipes() for converting // Vanilla Gold Ingot to Slimefun gold dust and Vanilla Copper Ingot into Slimefun copper dust - registerRecipe(3, new ItemStack(Material.GOLD_INGOT), SlimefunItems.GOLD_DUST); + registerRecipe(3, new ItemStack(Material.GOLD_INGOT), SlimefunItems.GOLD_DUST.item()); if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_17)) { - registerRecipe(3, new ItemStack(Material.COPPER_INGOT), SlimefunItems.COPPER_DUST); + registerRecipe(3, new ItemStack(Material.COPPER_INGOT), SlimefunItems.COPPER_DUST.item()); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricPress.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricPress.java index b5cb6f2f4d..93ad03ab5f 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricPress.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricPress.java @@ -19,7 +19,7 @@ /** * The {@link ElectricPress} is a pretty simple electrical machine. * It allows you to compact items into their block variant, e.g. 9 diamonds into a diamond block. - * + * * @author TheBusyBiscuit * */ @@ -32,7 +32,7 @@ public ElectricPress(ItemGroup itemGroup, SlimefunItemStack item, RecipeType rec @Override protected void registerDefaultRecipes() { - addRecipe(4, new SlimefunItemStack(SlimefunItems.STONE_CHUNK, 3), new ItemStack(Material.COBBLESTONE)); + addRecipe(4, new SlimefunItemStack(SlimefunItems.STONE_CHUNK, 3).item(), new ItemStack(Material.COBBLESTONE)); addRecipe(4, new ItemStack(Material.FLINT, 6), new ItemStack(Material.COBBLESTONE)); addRecipe(5, new ItemStack(Material.GLASS), new ItemStack(Material.GLASS_PANE, 3)); addRecipe(4, new ItemStack(Material.SNOWBALL, 4), new ItemStack(Material.SNOW_BLOCK)); @@ -44,15 +44,15 @@ protected void registerDefaultRecipes() { addRecipe(3, new ItemStack(Material.CLAY_BALL, 4), new ItemStack(Material.CLAY)); addRecipe(3, new ItemStack(Material.BRICK, 4), new ItemStack(Material.BRICKS)); - addRecipe(6, SlimefunItems.COPPER_INGOT, new CustomItemStack(SlimefunItems.COPPER_WIRE, 3)); + addRecipe(6, SlimefunItems.COPPER_INGOT.item(), CustomItemStack.create(SlimefunItems.COPPER_WIRE.item(), 3)); addRecipe(16, new SlimefunItemStack(SlimefunItems.STEEL_INGOT, 8), SlimefunItems.STEEL_PLATE); addRecipe(18, new SlimefunItemStack(SlimefunItems.REINFORCED_ALLOY_INGOT, 8), SlimefunItems.REINFORCED_PLATE); - addRecipe(8, new ItemStack(Material.NETHER_WART), new CustomItemStack(SlimefunItems.MAGIC_LUMP_1, 2)); + addRecipe(8, new ItemStack(Material.NETHER_WART), CustomItemStack.create(SlimefunItems.MAGIC_LUMP_1.item(), 2)); addRecipe(10, new SlimefunItemStack(SlimefunItems.MAGIC_LUMP_1, 4), SlimefunItems.MAGIC_LUMP_2); addRecipe(12, new SlimefunItemStack(SlimefunItems.MAGIC_LUMP_2, 4), SlimefunItems.MAGIC_LUMP_3); - addRecipe(10, new ItemStack(Material.ENDER_EYE), new CustomItemStack(SlimefunItems.ENDER_LUMP_1, 2)); + addRecipe(10, new ItemStack(Material.ENDER_EYE), CustomItemStack.create(SlimefunItems.ENDER_LUMP_1.item(), 2)); addRecipe(12, new SlimefunItemStack(SlimefunItems.ENDER_LUMP_1, 4), SlimefunItems.ENDER_LUMP_2); addRecipe(14, new SlimefunItemStack(SlimefunItems.ENDER_LUMP_2, 4), SlimefunItems.ENDER_LUMP_3); @@ -92,6 +92,11 @@ private void addRecipe(int seconds, ItemStack input, ItemStack output) { registerRecipe(seconds, new ItemStack[] { input }, new ItemStack[] { output }); } + @ParametersAreNonnullByDefault + private void addRecipe(int seconds, SlimefunItemStack sfItem1, SlimefunItemStack sfItem2) { + registerRecipe(seconds, sfItem1.item(), sfItem2.item()); + } + @Override public ItemStack getProgressBar() { return new ItemStack(Material.IRON_HOE); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricSmeltery.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricSmeltery.java index 2218339998..0f61a4e8c6 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricSmeltery.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/ElectricSmeltery.java @@ -31,7 +31,7 @@ /** * The {@link ElectricSmeltery} is an electric version of the standard {@link Smeltery}. - * + * * @author TheBusyBiscuit * */ @@ -120,7 +120,7 @@ protected void constructMenu(BlockMenuPreset preset) { preset.addItem(i, ChestMenuUtils.getOutputSlotTexture(), ChestMenuUtils.getEmptyClickHandler()); } - preset.addItem(22, new CustomItemStack(Material.BLACK_STAINED_GLASS_PANE, " "), ChestMenuUtils.getEmptyClickHandler()); + preset.addItem(22, CustomItemStack.create(Material.BLACK_STAINED_GLASS_PANE, " "), ChestMenuUtils.getEmptyClickHandler()); for (int i : getOutputSlots()) { preset.addMenuClickHandler(i, ChestMenuUtils.getDefaultOutputHandler()); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/FoodComposter.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/FoodComposter.java index 04f70d5490..7a2efcb226 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/FoodComposter.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/FoodComposter.java @@ -20,17 +20,17 @@ public FoodComposter(ItemGroup itemGroup, SlimefunItemStack item, RecipeType rec @Override protected void registerDefaultRecipes() { - registerRecipe(30, new ItemStack[] { SlimefunItems.WHEAT_ORGANIC_FOOD }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.WHEAT_FERTILIZER, OrganicFertilizer.OUTPUT) }); - registerRecipe(30, new ItemStack[] { SlimefunItems.CARROT_ORGANIC_FOOD }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.CARROT_FERTILIZER, OrganicFertilizer.OUTPUT) }); - registerRecipe(30, new ItemStack[] { SlimefunItems.POTATO_ORGANIC_FOOD }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.POTATO_FERTILIZER, OrganicFertilizer.OUTPUT) }); - registerRecipe(30, new ItemStack[] { SlimefunItems.SEEDS_ORGANIC_FOOD }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.SEEDS_FERTILIZER, OrganicFertilizer.OUTPUT) }); - registerRecipe(30, new ItemStack[] { SlimefunItems.BEETROOT_ORGANIC_FOOD }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.BEETROOT_FERTILIZER, OrganicFertilizer.OUTPUT) }); - registerRecipe(30, new ItemStack[] { SlimefunItems.MELON_ORGANIC_FOOD }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.MELON_FERTILIZER, OrganicFertilizer.OUTPUT) }); - registerRecipe(30, new ItemStack[] { SlimefunItems.APPLE_ORGANIC_FOOD }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.APPLE_FERTILIZER, OrganicFertilizer.OUTPUT) }); - registerRecipe(30, new ItemStack[] { SlimefunItems.KELP_ORGANIC_FOOD }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.KELP_FERTILIZER, OrganicFertilizer.OUTPUT) }); - registerRecipe(30, new ItemStack[] { SlimefunItems.COCOA_ORGANIC_FOOD }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.COCOA_FERTILIZER, OrganicFertilizer.OUTPUT) }); - registerRecipe(30, new ItemStack[] { SlimefunItems.SWEET_BERRIES_ORGANIC_FOOD }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.SWEET_BERRIES_FERTILIZER, OrganicFertilizer.OUTPUT) }); - registerRecipe(30, new ItemStack[] { SlimefunItems.SEAGRASS_ORGANIC_FOOD }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.SEAGRASS_FERTILIZER, OrganicFertilizer.OUTPUT) }); + registerRecipe(30, SlimefunItems.WHEAT_ORGANIC_FOOD, new SlimefunItemStack(SlimefunItems.WHEAT_FERTILIZER, OrganicFertilizer.OUTPUT)); + registerRecipe(30, SlimefunItems.CARROT_ORGANIC_FOOD, new SlimefunItemStack(SlimefunItems.CARROT_FERTILIZER, OrganicFertilizer.OUTPUT)); + registerRecipe(30, SlimefunItems.POTATO_ORGANIC_FOOD, new SlimefunItemStack(SlimefunItems.POTATO_FERTILIZER, OrganicFertilizer.OUTPUT)); + registerRecipe(30, SlimefunItems.SEEDS_ORGANIC_FOOD, new SlimefunItemStack(SlimefunItems.SEEDS_FERTILIZER, OrganicFertilizer.OUTPUT)); + registerRecipe(30, SlimefunItems.BEETROOT_ORGANIC_FOOD, new SlimefunItemStack(SlimefunItems.BEETROOT_FERTILIZER, OrganicFertilizer.OUTPUT)); + registerRecipe(30, SlimefunItems.MELON_ORGANIC_FOOD, new SlimefunItemStack(SlimefunItems.MELON_FERTILIZER, OrganicFertilizer.OUTPUT)); + registerRecipe(30, SlimefunItems.APPLE_ORGANIC_FOOD, new SlimefunItemStack(SlimefunItems.APPLE_FERTILIZER, OrganicFertilizer.OUTPUT)); + registerRecipe(30, SlimefunItems.KELP_ORGANIC_FOOD, new SlimefunItemStack(SlimefunItems.KELP_FERTILIZER, OrganicFertilizer.OUTPUT)); + registerRecipe(30, SlimefunItems.COCOA_ORGANIC_FOOD, new SlimefunItemStack(SlimefunItems.COCOA_FERTILIZER, OrganicFertilizer.OUTPUT)); + registerRecipe(30, SlimefunItems.SWEET_BERRIES_ORGANIC_FOOD, new SlimefunItemStack(SlimefunItems.SWEET_BERRIES_FERTILIZER, OrganicFertilizer.OUTPUT)); + registerRecipe(30, SlimefunItems.SEAGRASS_ORGANIC_FOOD, new SlimefunItemStack(SlimefunItems.SEAGRASS_FERTILIZER, OrganicFertilizer.OUTPUT)); } @Override diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/FoodFabricator.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/FoodFabricator.java index a22efe9f1a..b03e81cc3e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/FoodFabricator.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/FoodFabricator.java @@ -19,17 +19,17 @@ public FoodFabricator(ItemGroup itemGroup, SlimefunItemStack item, RecipeType re @Override protected void registerDefaultRecipes() { - registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN, new ItemStack(Material.WHEAT) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.WHEAT_ORGANIC_FOOD, OrganicFood.OUTPUT) }); - registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN, new ItemStack(Material.CARROT) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.CARROT_ORGANIC_FOOD, OrganicFood.OUTPUT) }); - registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN, new ItemStack(Material.POTATO) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.POTATO_ORGANIC_FOOD, OrganicFood.OUTPUT) }); - registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN, new ItemStack(Material.WHEAT_SEEDS) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.SEEDS_ORGANIC_FOOD, OrganicFood.OUTPUT) }); - registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN, new ItemStack(Material.BEETROOT) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.BEETROOT_ORGANIC_FOOD, OrganicFood.OUTPUT) }); - registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN, new ItemStack(Material.MELON_SLICE) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.MELON_ORGANIC_FOOD, OrganicFood.OUTPUT) }); - registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN, new ItemStack(Material.APPLE) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.APPLE_ORGANIC_FOOD, OrganicFood.OUTPUT) }); - registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN, new ItemStack(Material.DRIED_KELP) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.KELP_ORGANIC_FOOD, OrganicFood.OUTPUT) }); - registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN, new ItemStack(Material.COCOA_BEANS) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.COCOA_ORGANIC_FOOD, OrganicFood.OUTPUT) }); - registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN, new ItemStack(Material.SWEET_BERRIES) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.SWEET_BERRIES_ORGANIC_FOOD, OrganicFood.OUTPUT) }); - registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN, new ItemStack(Material.SEAGRASS) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.SEAGRASS_ORGANIC_FOOD, OrganicFood.OUTPUT) }); + registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN.item(), new ItemStack(Material.WHEAT) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.WHEAT_ORGANIC_FOOD, OrganicFood.OUTPUT).item() }); + registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN.item(), new ItemStack(Material.CARROT) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.CARROT_ORGANIC_FOOD, OrganicFood.OUTPUT).item() }); + registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN.item(), new ItemStack(Material.POTATO) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.POTATO_ORGANIC_FOOD, OrganicFood.OUTPUT).item() }); + registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN.item(), new ItemStack(Material.WHEAT_SEEDS) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.SEEDS_ORGANIC_FOOD, OrganicFood.OUTPUT).item() }); + registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN.item(), new ItemStack(Material.BEETROOT) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.BEETROOT_ORGANIC_FOOD, OrganicFood.OUTPUT).item() }); + registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN.item(), new ItemStack(Material.MELON_SLICE) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.MELON_ORGANIC_FOOD, OrganicFood.OUTPUT).item() }); + registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN.item(), new ItemStack(Material.APPLE) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.APPLE_ORGANIC_FOOD, OrganicFood.OUTPUT).item() }); + registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN.item(), new ItemStack(Material.DRIED_KELP) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.KELP_ORGANIC_FOOD, OrganicFood.OUTPUT).item() }); + registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN.item(), new ItemStack(Material.COCOA_BEANS) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.COCOA_ORGANIC_FOOD, OrganicFood.OUTPUT).item() }); + registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN.item(), new ItemStack(Material.SWEET_BERRIES) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.SWEET_BERRIES_ORGANIC_FOOD, OrganicFood.OUTPUT).item() }); + registerRecipe(12, new ItemStack[] { SlimefunItems.TIN_CAN.item(), new ItemStack(Material.SEAGRASS) }, new ItemStack[] { new SlimefunItemStack(SlimefunItems.SEAGRASS_ORGANIC_FOOD, OrganicFood.OUTPUT).item() }); } @Override diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/Freezer.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/Freezer.java index c2ad401d80..2da6de3dd8 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/Freezer.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/Freezer.java @@ -48,7 +48,7 @@ protected void registerDefaultRecipes() { registerRecipe(2, new ItemStack[] { new ItemStack(Material.WATER_BUCKET) }, new ItemStack[] { new ItemStack(Material.BUCKET), new ItemStack(Material.ICE) }); registerRecipe(8, new ItemStack[] { new ItemStack(Material.LAVA_BUCKET) }, new ItemStack[] { new ItemStack(Material.BUCKET), new ItemStack(Material.OBSIDIAN) }); - registerRecipe(8, new ItemStack[] { new ItemStack(Material.BLUE_ICE) }, new ItemStack[] { SlimefunItems.REACTOR_COOLANT_CELL }); + registerRecipe(8, new ItemStack[] { new ItemStack(Material.BLUE_ICE) }, new ItemStack[] { SlimefunItems.REACTOR_COOLANT_CELL.item() }); registerRecipe(6, new ItemStack[] { new ItemStack(Material.SNOW_BLOCK, 2) }, new ItemStack[] { new ItemStack(Material.ICE) }); registerRecipe(6, new ItemStack[] { new ItemStack(Material.MAGMA_CREAM) }, new ItemStack[] { new ItemStack(Material.SLIME_BALL) }); registerRecipe(6, new ItemStack[] { new ItemStack(Material.MAGMA_BLOCK, 2) }, new ItemStack[] { new ItemStack(Material.SLIME_BLOCK) }); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/HeatedPressureChamber.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/HeatedPressureChamber.java index 97505f6dd8..b1aacbc8f7 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/HeatedPressureChamber.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/HeatedPressureChamber.java @@ -85,14 +85,14 @@ private Comparator compareSlots(DirtyChestMenu menu) { @Override protected void registerDefaultRecipes() { - registerRecipe(45, new ItemStack[] { SlimefunItems.OIL_BUCKET }, new ItemStack[] { new CustomItemStack(SlimefunItems.PLASTIC_SHEET, 8) }); - registerRecipe(30, new ItemStack[] { SlimefunItems.GOLD_24K, SlimefunItems.URANIUM }, new ItemStack[] { SlimefunItems.BLISTERING_INGOT }); - registerRecipe(30, new ItemStack[] { SlimefunItems.BLISTERING_INGOT, SlimefunItems.CARBONADO }, new ItemStack[] { SlimefunItems.BLISTERING_INGOT_2 }); - registerRecipe(60, new ItemStack[] { SlimefunItems.BLISTERING_INGOT_2, new ItemStack(Material.NETHER_STAR) }, new ItemStack[] { SlimefunItems.BLISTERING_INGOT_3 }); - registerRecipe(90, new ItemStack[] { SlimefunItems.PLUTONIUM, SlimefunItems.URANIUM }, new ItemStack[] { SlimefunItems.BOOSTED_URANIUM }); - registerRecipe(60, new ItemStack[] { SlimefunItems.NETHER_ICE, SlimefunItems.PLUTONIUM }, new ItemStack[] { new CustomItemStack(SlimefunItems.ENRICHED_NETHER_ICE, 4) }); - registerRecipe(45, new ItemStack[] { SlimefunItems.ENRICHED_NETHER_ICE }, new ItemStack[] { new CustomItemStack(SlimefunItems.NETHER_ICE_COOLANT_CELL, 8) }); - registerRecipe(8, new ItemStack[] { SlimefunItems.MAGNESIUM_DUST, SlimefunItems.SALT }, new ItemStack[] { SlimefunItems.MAGNESIUM_SALT }); + registerRecipe(45, new ItemStack[] { SlimefunItems.OIL_BUCKET.item() }, new ItemStack[] { CustomItemStack.create(SlimefunItems.PLASTIC_SHEET.item(), 8) }); + registerRecipe(30, new SlimefunItemStack[] { SlimefunItems.GOLD_24K, SlimefunItems.URANIUM }, new SlimefunItemStack[] { SlimefunItems.BLISTERING_INGOT }); + registerRecipe(30, new SlimefunItemStack[] { SlimefunItems.BLISTERING_INGOT, SlimefunItems.CARBONADO }, new SlimefunItemStack[] { SlimefunItems.BLISTERING_INGOT_2 }); + registerRecipe(60, new ItemStack[] { SlimefunItems.BLISTERING_INGOT_2.item(), new ItemStack(Material.NETHER_STAR) }, new ItemStack[] { SlimefunItems.BLISTERING_INGOT_3.item() }); + registerRecipe(90, new SlimefunItemStack[] { SlimefunItems.PLUTONIUM, SlimefunItems.URANIUM }, new SlimefunItemStack[] { SlimefunItems.BOOSTED_URANIUM }); + registerRecipe(60, new ItemStack[] { SlimefunItems.NETHER_ICE.item(), SlimefunItems.PLUTONIUM.item() }, new ItemStack[] { CustomItemStack.create(SlimefunItems.ENRICHED_NETHER_ICE.item(), 4) }); + registerRecipe(45, new ItemStack[] { SlimefunItems.ENRICHED_NETHER_ICE.item() }, new ItemStack[] { CustomItemStack.create(SlimefunItems.NETHER_ICE_COOLANT_CELL.item(), 8) }); + registerRecipe(8, new SlimefunItemStack[] { SlimefunItems.MAGNESIUM_DUST, SlimefunItems.SALT }, new SlimefunItemStack[] { SlimefunItems.MAGNESIUM_SALT }); } @Override diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/accelerators/AbstractGrowthAccelerator.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/accelerators/AbstractGrowthAccelerator.java index 7136101287..8997df479e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/accelerators/AbstractGrowthAccelerator.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/accelerators/AbstractGrowthAccelerator.java @@ -54,7 +54,7 @@ public void onBlockBreak(Block b) { private void constructMenu(BlockMenuPreset preset) { for (int i : BORDER) { - preset.addItem(i, new CustomItemStack(Material.CYAN_STAINED_GLASS_PANE, " "), ChestMenuUtils.getEmptyClickHandler()); + preset.addItem(i, CustomItemStack.create(Material.CYAN_STAINED_GLASS_PANE, " "), ChestMenuUtils.getEmptyClickHandler()); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/accelerators/AnimalGrowthAccelerator.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/accelerators/AnimalGrowthAccelerator.java index 1da903c425..3bb587f914 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/accelerators/AnimalGrowthAccelerator.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/accelerators/AnimalGrowthAccelerator.java @@ -23,7 +23,7 @@ public class AnimalGrowthAccelerator extends AbstractGrowthAccelerator { private static final double RADIUS = 3.0; // We wanna strip the Slimefun Item id here - private static final ItemStack organicFood = ItemStackWrapper.wrap(SlimefunItems.ORGANIC_FOOD); + private static final ItemStack organicFood = ItemStackWrapper.wrap(SlimefunItems.ORGANIC_FOOD.item()); public AnimalGrowthAccelerator(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { super(itemGroup, item, recipeType, recipe); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/accelerators/CropGrowthAccelerator.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/accelerators/CropGrowthAccelerator.java index 5cf09b31f9..b5d032f459 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/accelerators/CropGrowthAccelerator.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/accelerators/CropGrowthAccelerator.java @@ -19,7 +19,7 @@ public abstract class CropGrowthAccelerator extends AbstractGrowthAccelerator { // We wanna strip the Slimefun Item id here - private static final ItemStack organicFertilizer = ItemStackWrapper.wrap(SlimefunItems.FERTILIZER); + private static final ItemStack organicFertilizer = ItemStackWrapper.wrap(SlimefunItems.FERTILIZER.item()); protected CropGrowthAccelerator(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { super(itemGroup, item, recipeType, recipe); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/accelerators/TreeGrowthAccelerator.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/accelerators/TreeGrowthAccelerator.java index a9332d777e..51d50cde95 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/accelerators/TreeGrowthAccelerator.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/accelerators/TreeGrowthAccelerator.java @@ -39,7 +39,7 @@ public class TreeGrowthAccelerator extends AbstractGrowthAccelerator { private static final int RADIUS = 9; // We wanna strip the Slimefun Item id here - private static final ItemStack organicFertilizer = ItemStackWrapper.wrap(SlimefunItems.FERTILIZER); + private static final ItemStack organicFertilizer = ItemStackWrapper.wrap(SlimefunItems.FERTILIZER.item()); @ParametersAreNonnullByDefault public TreeGrowthAccelerator(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/enchanting/AbstractEnchantmentMachine.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/enchanting/AbstractEnchantmentMachine.java index 5497ddd588..9f4e03f481 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/enchanting/AbstractEnchantmentMachine.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/enchanting/AbstractEnchantmentMachine.java @@ -67,7 +67,7 @@ protected void showEnchantmentLevelWarning(@Nonnull BlockMenu menu) { String notice = ChatColors.color(Slimefun.getLocalization().getMessage("messages.above-limit-level")); notice = notice.replace("%level%", String.valueOf(levelLimit.getValue())); - ItemStack progressBar = new CustomItemStack(Material.BARRIER, " ", notice); + ItemStack progressBar = CustomItemStack.create(Material.BARRIER, " ", notice); menu.replaceExistingItem(22, progressBar); } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/AbstractEntityAssembler.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/AbstractEntityAssembler.java index 338c262da5..4c6be5dc3f 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/AbstractEntityAssembler.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/AbstractEntityAssembler.java @@ -43,9 +43,9 @@ /** * This is an abstract super class for Entity Assemblers. - * + * * @author TheBusyBiscuit - * + * * @see WitherAssembler * @see IronGolemAssembler * @@ -75,8 +75,8 @@ protected AbstractEntityAssembler(ItemGroup itemGroup, SlimefunItemStack item, R @Override public void init() { drawBackground(border); - drawBackground(new CustomItemStack(getHeadBorder(), " "), headBorder); - drawBackground(new CustomItemStack(getBodyBorder(), " "), bodyBorder); + drawBackground(CustomItemStack.create(getHeadBorder(), " "), headBorder); + drawBackground(CustomItemStack.create(getBodyBorder(), " "), bodyBorder); constructMenu(this); } @@ -159,14 +159,14 @@ public void onPlayerBreak(BlockBreakEvent e, ItemStack item, List dro private void updateBlockInventory(BlockMenu menu, Block b) { if (!BlockStorage.hasBlockInfo(b) || BlockStorage.getLocationInfo(b.getLocation(), KEY_ENABLED) == null || BlockStorage.getLocationInfo(b.getLocation(), KEY_ENABLED).equals(String.valueOf(false))) { - menu.replaceExistingItem(22, new CustomItemStack(Material.GUNPOWDER, "&7Enabled: &4\u2718", "", "&e> Click to enable this Machine")); + menu.replaceExistingItem(22, CustomItemStack.create(Material.GUNPOWDER, "&7Enabled: &4\u2718", "", "&e> Click to enable this Machine")); menu.addMenuClickHandler(22, (p, slot, item, action) -> { BlockStorage.addBlockInfo(b, KEY_ENABLED, String.valueOf(true)); updateBlockInventory(menu, b); return false; }); } else { - menu.replaceExistingItem(22, new CustomItemStack(Material.REDSTONE, "&7Enabled: &2\u2714", "", "&e> Click to disable this Machine")); + menu.replaceExistingItem(22, CustomItemStack.create(Material.REDSTONE, "&7Enabled: &2\u2714", "", "&e> Click to disable this Machine")); menu.addMenuClickHandler(22, (p, slot, item, action) -> { BlockStorage.addBlockInfo(b, KEY_ENABLED, String.valueOf(false)); updateBlockInventory(menu, b); @@ -176,7 +176,7 @@ private void updateBlockInventory(BlockMenu menu, Block b) { double offset = (!BlockStorage.hasBlockInfo(b) || BlockStorage.getLocationInfo(b.getLocation(), KEY_OFFSET) == null) ? 3.0F : Double.valueOf(BlockStorage.getLocationInfo(b.getLocation(), KEY_OFFSET)); - menu.replaceExistingItem(31, new CustomItemStack(Material.PISTON, "&7Offset: &3" + offset + " Block(s)", "", "&fLeft Click: &7+0.1", "&fRight Click: &7-0.1")); + menu.replaceExistingItem(31, CustomItemStack.create(Material.PISTON, "&7Offset: &3" + offset + " Block(s)", "", "&fLeft Click: &7+0.1", "&fRight Click: &7-0.1")); menu.addMenuClickHandler(31, (p, slot, item, action) -> { double offsetv = NumberUtils.reparseDouble(Double.valueOf(BlockStorage.getLocationInfo(b.getLocation(), KEY_OFFSET)) + (action.isRightClicked() ? -0.1F : 0.1F)); BlockStorage.addBlockInfo(b, KEY_OFFSET, String.valueOf(offsetv)); @@ -279,9 +279,9 @@ private void consumeResources(BlockMenu inv) { } protected void constructMenu(BlockMenuPreset preset) { - preset.addItem(1, new CustomItemStack(getHead(), "&7Head Slot", "", "&fThis Slot accepts the head type"), ChestMenuUtils.getEmptyClickHandler()); - preset.addItem(7, new CustomItemStack(getBody(), "&7Body Slot", "", "&fThis Slot accepts the body type"), ChestMenuUtils.getEmptyClickHandler()); - preset.addItem(13, new CustomItemStack(Material.CLOCK, "&7Cooldown: &b30 Seconds", "", "&fThis Machine takes up to half a Minute to operate", "&fso give it some Time!"), ChestMenuUtils.getEmptyClickHandler()); + preset.addItem(1, CustomItemStack.create(getHead(), "&7Head Slot", "", "&fThis Slot accepts the head type"), ChestMenuUtils.getEmptyClickHandler()); + preset.addItem(7, CustomItemStack.create(getBody(), "&7Body Slot", "", "&fThis Slot accepts the body type"), ChestMenuUtils.getEmptyClickHandler()); + preset.addItem(13, CustomItemStack.create(Material.CLOCK, "&7Cooldown: &b30 Seconds", "", "&fThis Machine takes up to half a Minute to operate", "&fso give it some Time!"), ChestMenuUtils.getEmptyClickHandler()); } @Override diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/AutoBreeder.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/AutoBreeder.java index e62fd7951d..072b69f968 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/AutoBreeder.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/AutoBreeder.java @@ -38,7 +38,7 @@ public class AutoBreeder extends SlimefunItem implements InventoryBlock, EnergyN private static final int ENERGY_CONSUMPTION = 60; // We wanna strip the Slimefun Item id here - private static final ItemStack organicFood = ItemStackWrapper.wrap(SlimefunItems.ORGANIC_FOOD); + private static final ItemStack organicFood = ItemStackWrapper.wrap(SlimefunItems.ORGANIC_FOOD.item()); @ParametersAreNonnullByDefault public AutoBreeder(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { @@ -65,7 +65,7 @@ public void onBlockBreak(Block b) { protected void constructMenu(BlockMenuPreset preset) { for (int i : border) { - preset.addItem(i, new CustomItemStack(new ItemStack(Material.CYAN_STAINED_GLASS_PANE), " "), (p, slot, item, action) -> false); + preset.addItem(i, CustomItemStack.create(new ItemStack(Material.CYAN_STAINED_GLASS_PANE), " "), (p, slot, item, action) -> false); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/ExpCollector.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/ExpCollector.java index 3a6cb6d857..bff5364220 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/ExpCollector.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/ExpCollector.java @@ -36,7 +36,7 @@ /** * The {@link ExpCollector} is a machine which picks up any nearby {@link ExperienceOrb} * and produces a {@link KnowledgeFlask}. - * + * * @author TheBusyBiscuit * */ @@ -44,35 +44,43 @@ public class ExpCollector extends SlimefunItem implements InventoryBlock, Energy private final int[] border = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 }; - private static final int ENERGY_CONSUMPTION = 10; private static final String DATA_KEY = "stored-exp"; + private final double range; + private int energyConsumedPerTick = -1; + private int energyCapacity = -1; + + @Deprecated(since = "RC-38", forRemoval = true) @ParametersAreNonnullByDefault public ExpCollector(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { + this(itemGroup, item, recipeType, recipe, 4.0); + } + + @ParametersAreNonnullByDefault + public ExpCollector(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe, double range) { super(itemGroup, item, recipeType, recipe); + this.range = range; createPreset(this, this::constructMenu); - addItemHandler(onPlace(), onBreak()); } - @Nonnull - private BlockPlaceHandler onPlace() { + + private @Nonnull BlockPlaceHandler onPlace() { return new BlockPlaceHandler(false) { @Override - public void onPlayerPlace(BlockPlaceEvent e) { + public void onPlayerPlace(@Nonnull BlockPlaceEvent e) { BlockStorage.addBlockInfo(e.getBlock(), "owner", e.getPlayer().getUniqueId().toString()); } }; } - @Nonnull - private ItemHandler onBreak() { + private @Nonnull ItemHandler onBreak() { return new SimpleBlockBreakHandler() { @Override - public void onBlockBreak(Block b) { + public void onBlockBreak(@Nonnull Block b) { BlockMenu inv = BlockStorage.getInventory(b); if (inv != null) { @@ -97,14 +105,9 @@ public EnergyNetComponentType getEnergyComponentType() { return EnergyNetComponentType.CONSUMER; } - @Override - public int getCapacity() { - return 1024; - } - protected void constructMenu(BlockMenuPreset preset) { for (int slot : border) { - preset.addItem(slot, new CustomItemStack(Material.PURPLE_STAINED_GLASS_PANE, " "), (p, s, item, action) -> false); + preset.addItem(slot, CustomItemStack.create(Material.PURPLE_STAINED_GLASS_PANE, " "), (p, s, item, action) -> false); } } @@ -126,19 +129,19 @@ public boolean isSynchronized() { protected void tick(Block block) { Location location = block.getLocation(); - Iterator iterator = block.getWorld().getNearbyEntities(location, 4.0, 4.0, 4.0, n -> n instanceof ExperienceOrb && n.isValid()).iterator(); + Iterator iterator = block.getWorld().getNearbyEntities(location, range, range, range, n -> n instanceof ExperienceOrb && n.isValid()).iterator(); int experiencePoints = 0; while (iterator.hasNext() && experiencePoints == 0) { ExperienceOrb orb = (ExperienceOrb) iterator.next(); - if (getCharge(location) < ENERGY_CONSUMPTION) { + if (getCharge(location) < getEnergyConsumption()) { return; } experiencePoints = getStoredExperience(location) + orb.getExperience(); - removeCharge(location, ENERGY_CONSUMPTION); + removeCharge(location, getEnergyConsumption()); orb.remove(); produceFlasks(location, experiencePoints); } @@ -157,9 +160,9 @@ private void produceFlasks(@Nonnull Location location, int experiencePoints) { int withdrawn = 0; BlockMenu menu = BlockStorage.getInventory(location); for (int level = 0; level < getStoredExperience(location); level = level + 10) { - if (menu.fits(SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE, getOutputSlots())) { + if (menu.fits(SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE.item(), getOutputSlots())) { withdrawn = withdrawn + 10; - menu.pushItem(SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE.clone(), getOutputSlots()); + menu.pushItem(SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE.item(), getOutputSlots()); } else { // There is no room for more bottles, so lets stop checking if more will fit. break; @@ -179,4 +182,23 @@ private int getStoredExperience(Location location) { return 0; } } + + public int getEnergyConsumption() { + return energyConsumedPerTick; + } + + public ExpCollector setEnergyConsumption(int energyConsumedPerTick) { + this.energyConsumedPerTick = energyConsumedPerTick; + return this; + } + + @Override + public int getCapacity() { + return energyCapacity; + } + + public ExpCollector setCapacity(int energyCapacity) { + this.energyCapacity = energyCapacity; + return this; + } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/IronGolemAssembler.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/IronGolemAssembler.java index c38602e441..727dc342d1 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/IronGolemAssembler.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/IronGolemAssembler.java @@ -20,9 +20,9 @@ /** * The {@link IronGolemAssembler} is an electrical machine that can automatically spawn * a {@link IronGolem} if the required ingredients have been provided. - * + * * @author TheBusyBiscuit - * + * * @see WitherAssembler * */ @@ -65,9 +65,9 @@ public Material getBodyBorder() { @Override protected void constructMenu(BlockMenuPreset preset) { - preset.addItem(1, new CustomItemStack(getHead(), "&7Pumpkin Slot", "", "&fThis Slot accepts Pumpkins"), ChestMenuUtils.getEmptyClickHandler()); - preset.addItem(7, new CustomItemStack(getBody(), "&7Iron Block Slot", "", "&fThis Slot accepts Iron Blocks"), ChestMenuUtils.getEmptyClickHandler()); - preset.addItem(13, new CustomItemStack(Material.CLOCK, "&7Cooldown: &b30 Seconds", "", "&fThis Machine takes up to half a Minute to operate", "&fso give it some Time!"), ChestMenuUtils.getEmptyClickHandler()); + preset.addItem(1, CustomItemStack.create(getHead(), "&7Pumpkin Slot", "", "&fThis Slot accepts Pumpkins"), ChestMenuUtils.getEmptyClickHandler()); + preset.addItem(7, CustomItemStack.create(getBody(), "&7Iron Block Slot", "", "&fThis Slot accepts Iron Blocks"), ChestMenuUtils.getEmptyClickHandler()); + preset.addItem(13, CustomItemStack.create(Material.CLOCK, "&7Cooldown: &b30 Seconds", "", "&fThis Machine takes up to half a Minute to operate", "&fso give it some Time!"), ChestMenuUtils.getEmptyClickHandler()); } @Override diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/ProduceCollector.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/ProduceCollector.java index 24ecf5d86d..e1d5e1f4e3 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/ProduceCollector.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/ProduceCollector.java @@ -43,7 +43,7 @@ /** * The {@link ProduceCollector} allows you to collect produce from animals. * Providing it with a bucket and a nearby {@link Cow} will allow you to obtain milk. - * + * * @author TheBusyBiscuit * @author Walshy * @@ -85,7 +85,7 @@ protected void registerDefaultRecipes() { /** * This method adds a new {@link AnimalProduce} to this machine. - * + * * @param produce * The {@link AnimalProduce} to add */ @@ -116,15 +116,15 @@ public boolean isSynchronized() { public @Nonnull List getDisplayRecipes() { List displayRecipes = new ArrayList<>(); - displayRecipes.add(new CustomItemStack(Material.BUCKET, null, "&fRequires &bCow &fnearby")); + displayRecipes.add(CustomItemStack.create(Material.BUCKET, null, "&fRequires &bCow &fnearby")); displayRecipes.add(new ItemStack(Material.MILK_BUCKET)); if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_17)) { - displayRecipes.add(new CustomItemStack(Material.BUCKET, null, "&fRequires &bGoat &fnearby")); + displayRecipes.add(CustomItemStack.create(Material.BUCKET, null, "&fRequires &bGoat &fnearby")); displayRecipes.add(new ItemStack(Material.MILK_BUCKET)); } - displayRecipes.add(new CustomItemStack(Material.BOWL, null, "&fRequires &bMooshroom &fnearby")); + displayRecipes.add(CustomItemStack.create(Material.BOWL, null, "&fRequires &bMooshroom &fnearby")); displayRecipes.add(new ItemStack(Material.MUSHROOM_STEW)); return displayRecipes; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/WitherAssembler.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/WitherAssembler.java index cc2c336672..9ebb73f8b2 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/WitherAssembler.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/entities/WitherAssembler.java @@ -18,9 +18,9 @@ /** * The {@link WitherAssembler} is an electrical machine that can automatically spawn * a {@link Wither} if the required ingredients have been provided. - * + * * @author TheBusyBiscuit - * + * * @see IronGolemAssembler * */ @@ -63,9 +63,9 @@ public Material getBodyBorder() { @Override protected void constructMenu(BlockMenuPreset preset) { - preset.addItem(1, new CustomItemStack(getHead(), "&7Wither Skeleton Skull Slot", "", "&fThis Slot accepts Wither Skeleton Skulls"), ChestMenuUtils.getEmptyClickHandler()); - preset.addItem(7, new CustomItemStack(getBody(), "&7Soul Sand Slot", "", "&fThis Slot accepts Soul Sand"), ChestMenuUtils.getEmptyClickHandler()); - preset.addItem(13, new CustomItemStack(Material.CLOCK, "&7Cooldown: &b30 Seconds", "", "&fThis Machine takes up to half a Minute to operate", "&fso give it some Time!"), ChestMenuUtils.getEmptyClickHandler()); + preset.addItem(1, CustomItemStack.create(getHead(), "&7Wither Skeleton Skull Slot", "", "&fThis Slot accepts Wither Skeleton Skulls"), ChestMenuUtils.getEmptyClickHandler()); + preset.addItem(7, CustomItemStack.create(getBody(), "&7Soul Sand Slot", "", "&fThis Slot accepts Soul Sand"), ChestMenuUtils.getEmptyClickHandler()); + preset.addItem(13, CustomItemStack.create(Material.CLOCK, "&7Cooldown: &b30 Seconds", "", "&fThis Machine takes up to half a Minute to operate", "&fso give it some Time!"), ChestMenuUtils.getEmptyClickHandler()); } @Override diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/reactors/NetherStarReactor.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/reactors/NetherStarReactor.java index 47f671ac83..56ece1a036 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/reactors/NetherStarReactor.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/reactors/NetherStarReactor.java @@ -53,7 +53,7 @@ public void extraTick(@Nonnull Location l) { @Override public ItemStack getCoolant() { - return SlimefunItems.NETHER_ICE_COOLANT_CELL; + return SlimefunItems.NETHER_ICE_COOLANT_CELL.item(); } @Override diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/reactors/NuclearReactor.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/reactors/NuclearReactor.java index 8e66c165d8..7e30bf7e93 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/reactors/NuclearReactor.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/reactors/NuclearReactor.java @@ -40,17 +40,17 @@ protected void registerDefaultFuelTypes() { @Override public ItemStack getProgressBar() { - return SlimefunItems.LAVA_CRYSTAL; + return SlimefunItems.LAVA_CRYSTAL.item(); } @Override public ItemStack getCoolant() { - return SlimefunItems.REACTOR_COOLANT_CELL; + return SlimefunItems.REACTOR_COOLANT_CELL.item(); } @Override public ItemStack getFuelIcon() { - return SlimefunItems.URANIUM; + return SlimefunItems.URANIUM.item(); } @Override diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/reactors/Reactor.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/reactors/Reactor.java index 47b524616f..aeb3477799 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/reactors/Reactor.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/reactors/Reactor.java @@ -50,11 +50,11 @@ /** * The abstract {@link Reactor} class is very similar to {@link AGenerator} but is * exclusively used for Reactors. - * + * * @author John000708 * @author AlexLander123 * @author TheBusyBiscuit - * + * * @see AGenerator * @see NuclearReactor * @see NetherStarReactor @@ -145,7 +145,7 @@ protected void updateInventory(@Nonnull BlockMenu menu, @Nonnull Block b) { switch (mode) { case GENERATOR: - menu.replaceExistingItem(4, new CustomItemStack(SlimefunItems.NUCLEAR_REACTOR, "&7Focus: &eElectricity", "", "&6Your Reactor will focus on Power Generation", "&6If your Energy Network doesn't need Power", "&6it will not produce any either", "", "&7\u21E8 Click to change the Focus to &eProduction")); + menu.replaceExistingItem(4, CustomItemStack.create(SlimefunItems.NUCLEAR_REACTOR.item(), "&7Focus: &eElectricity", "", "&6Your Reactor will focus on Power Generation", "&6If your Energy Network doesn't need Power", "&6it will not produce any either", "", "&7\u21E8 Click to change the Focus to &eProduction")); menu.addMenuClickHandler(4, (p, slot, item, action) -> { BlockStorage.addBlockInfo(b, MODE, ReactorMode.PRODUCTION.toString()); updateInventory(menu, b); @@ -153,7 +153,7 @@ protected void updateInventory(@Nonnull BlockMenu menu, @Nonnull Block b) { }); break; case PRODUCTION: - menu.replaceExistingItem(4, new CustomItemStack(SlimefunItems.PLUTONIUM, "&7Focus: &eProduction", "", "&6Your Reactor will focus on producing goods", "&6If your Energy Network doesn't need Power", "&6it will continue to run and simply will", "&6not generate any Power in the mean time", "", "&7\u21E8 Click to change the Focus to &ePower Generation")); + menu.replaceExistingItem(4, CustomItemStack.create(SlimefunItems.PLUTONIUM.item(), "&7Focus: &eProduction", "", "&6Your Reactor will focus on producing goods", "&6If your Energy Network doesn't need Power", "&6it will continue to run and simply will", "&6not generate any Power in the mean time", "", "&7\u21E8 Click to change the Focus to &ePower Generation")); menu.addMenuClickHandler(4, (p, slot, item, action) -> { BlockStorage.addBlockInfo(b, MODE, ReactorMode.GENERATOR.toString()); updateInventory(menu, b); @@ -167,7 +167,7 @@ protected void updateInventory(@Nonnull BlockMenu menu, @Nonnull Block b) { BlockMenu port = getAccessPort(b.getLocation()); if (port != null) { - menu.replaceExistingItem(INFO_SLOT, new CustomItemStack(Material.GREEN_WOOL, "&7Access Port", "", "&6Detected", "", "&7> Click to view Access Port")); + menu.replaceExistingItem(INFO_SLOT, CustomItemStack.create(Material.GREEN_WOOL, "&7Access Port", "", "&6Detected", "", "&7> Click to view Access Port")); menu.addMenuClickHandler(INFO_SLOT, (p, slot, item, action) -> { port.open(p); updateInventory(menu, b); @@ -175,7 +175,7 @@ protected void updateInventory(@Nonnull BlockMenu menu, @Nonnull Block b) { return false; }); } else { - menu.replaceExistingItem(INFO_SLOT, new CustomItemStack(Material.RED_WOOL, "&7Access Port", "", "&cNot detected", "", "&7Access Port must be", "&7placed 3 blocks above", "&7a reactor!")); + menu.replaceExistingItem(INFO_SLOT, CustomItemStack.create(Material.RED_WOOL, "&7Access Port", "", "&cNot detected", "", "&7Access Port must be", "&7placed 3 blocks above", "&7a reactor!")); menu.addMenuClickHandler(INFO_SLOT, (p, slot, item, action) -> { updateInventory(menu, b); menu.open(p); @@ -190,28 +190,28 @@ private void constructMenu(@Nonnull BlockMenuPreset preset) { } for (int i : border_1) { - preset.addItem(i, new CustomItemStack(Material.LIME_STAINED_GLASS_PANE, " "), ChestMenuUtils.getEmptyClickHandler()); + preset.addItem(i, CustomItemStack.create(Material.LIME_STAINED_GLASS_PANE, " "), ChestMenuUtils.getEmptyClickHandler()); } for (int i : border_3) { - preset.addItem(i, new CustomItemStack(Material.GREEN_STAINED_GLASS_PANE, " "), ChestMenuUtils.getEmptyClickHandler()); + preset.addItem(i, CustomItemStack.create(Material.GREEN_STAINED_GLASS_PANE, " "), ChestMenuUtils.getEmptyClickHandler()); } - preset.addItem(22, new CustomItemStack(Material.BLACK_STAINED_GLASS_PANE, " "), ChestMenuUtils.getEmptyClickHandler()); + preset.addItem(22, CustomItemStack.create(Material.BLACK_STAINED_GLASS_PANE, " "), ChestMenuUtils.getEmptyClickHandler()); - preset.addItem(1, new CustomItemStack(getFuelIcon(), "&7Fuel Slot", "", "&fThis Slot accepts radioactive Fuel such as:", "&2Uranium &for &aNeptunium"), ChestMenuUtils.getEmptyClickHandler()); + preset.addItem(1, CustomItemStack.create(getFuelIcon(), "&7Fuel Slot", "", "&fThis Slot accepts radioactive Fuel such as:", "&2Uranium &for &aNeptunium"), ChestMenuUtils.getEmptyClickHandler()); for (int i : border_2) { - preset.addItem(i, new CustomItemStack(Material.CYAN_STAINED_GLASS_PANE, " "), ChestMenuUtils.getEmptyClickHandler()); + preset.addItem(i, CustomItemStack.create(Material.CYAN_STAINED_GLASS_PANE, " "), ChestMenuUtils.getEmptyClickHandler()); } if (needsCooling()) { - preset.addItem(7, new CustomItemStack(getCoolant(), "&bCoolant Slot", "", "&fThis Slot accepts Coolant Cells", "&4Without any Coolant Cells, your Reactor", "&4will explode")); + preset.addItem(7, CustomItemStack.create(getCoolant(), "&bCoolant Slot", "", "&fThis Slot accepts Coolant Cells", "&4Without any Coolant Cells, your Reactor", "&4will explode")); } else { - preset.addItem(7, new CustomItemStack(Material.BARRIER, "&bCoolant Slot", "", "&fThis Slot accepts Coolant Cells")); + preset.addItem(7, CustomItemStack.create(Material.BARRIER, "&bCoolant Slot", "", "&fThis Slot accepts Coolant Cells")); for (int i : border_4) { - preset.addItem(i, new CustomItemStack(Material.BARRIER, "&cNo Coolant Required"), ChestMenuUtils.getEmptyClickHandler()); + preset.addItem(i, CustomItemStack.create(Material.BARRIER, "&cNo Coolant Required"), ChestMenuUtils.getEmptyClickHandler()); } } } @@ -232,7 +232,7 @@ protected ReactorMode getReactorMode(@Nonnull Location l) { /** * This method returns the {@link ItemStack} that is required to cool this {@link Reactor}. * If it returns null, then no cooling is required. - * + * * @return The {@link ItemStack} required to cool this {@link Reactor} */ @Nullable @@ -242,7 +242,7 @@ protected ReactorMode getReactorMode(@Nonnull Location l) { * This method returns the displayed icon above the fuel input slot. * It should reflect the {@link ItemStack} used to power the reactor. * This method does not determine the fuel input, only the icon. - * + * * @return The {@link ItemStack} used as the fuel icon for this {@link Reactor}. */ @Nonnull @@ -252,7 +252,7 @@ protected ReactorMode getReactorMode(@Nonnull Location l) { * This method returns whether this {@link Reactor} requires as some form of * coolant. * It is a not-null check performed on {@link #getCoolant()} - * + * * @return Whether this {@link Reactor} requires cooling */ protected final boolean needsCooling() { @@ -364,7 +364,7 @@ private void checkForWaterBlocks(Location l) { } private void createByproduct(@Nonnull Location l, @Nonnull BlockMenu inv, @Nullable BlockMenu accessPort, @Nonnull FuelOperation operation) { - inv.replaceExistingItem(22, new CustomItemStack(Material.BLACK_STAINED_GLASS_PANE, " ")); + inv.replaceExistingItem(22, CustomItemStack.create(Material.BLACK_STAINED_GLASS_PANE, " ")); ItemStack result = operation.getResult(); if (result != null) { @@ -401,7 +401,7 @@ private void burnNextFuel(Location l, BlockMenu inv, BlockMenu accessPort) { /** * This method cools the given {@link Reactor}. - * + * * @param reactor * The {@link Location} of this {@link Reactor} * @param menu @@ -410,7 +410,7 @@ private void burnNextFuel(Location l, BlockMenu inv, BlockMenu accessPort) { * The {@link ReactorAccessPort}, if available * @param operation * The {@link FuelOperation} of this {@link Reactor} - * + * * @return Whether the {@link Reactor} was successfully cooled, if not it should explode */ private boolean hasEnoughCoolant(@Nonnull Location reactor, @Nonnull BlockMenu menu, @Nullable BlockMenu accessPort, @Nonnull FuelOperation operation) { @@ -453,7 +453,7 @@ private float getPercentage(int time, int total) { private void restockFuel(BlockMenu menu, BlockMenu port) { for (int slot : getFuelSlots()) { for (MachineFuel fuelType : fuelTypes) { - if (fuelType.test(port.getItemInSlot(slot)) && menu.fits(new CustomItemStack(port.getItemInSlot(slot), 1), getFuelSlots())) { + if (fuelType.test(port.getItemInSlot(slot)) && menu.fits(CustomItemStack.create(port.getItemInSlot(slot), 1), getFuelSlots())) { port.replaceExistingItem(slot, menu.pushItem(port.getItemInSlot(slot), getFuelSlots())); return; } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/elevator/ElevatorPlate.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/elevator/ElevatorPlate.java index e73e3633e0..44fde1a2b8 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/elevator/ElevatorPlate.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/elevator/ElevatorPlate.java @@ -141,17 +141,13 @@ private void openFloorSelector(Block b, List floors, Player p, in // @formatter:off if (floor.getAltitude() == b.getY()) { - menu.addItem(i, new CustomItemStack( - Material.COMPASS, + menu.addItem(i, CustomItemStack.create(Material.COMPASS, ChatColor.GRAY.toString() + floor.getNumber() + ". " + ChatColor.BLACK + floor.getName(), - Slimefun.getLocalization().getMessage(p, "machines.ELEVATOR.current-floor") + ' ' + ChatColor.WHITE + floor.getName() - ), ChestMenuUtils.getEmptyClickHandler()); + Slimefun.getLocalization().getMessage(p, "machines.ELEVATOR.current-floor") + ' ' + ChatColor.WHITE + floor.getName()), ChestMenuUtils.getEmptyClickHandler()); } else { - menu.addItem(i, new CustomItemStack( - Material.PAPER, + menu.addItem(i, CustomItemStack.create(Material.PAPER, ChatColor.GRAY.toString() + floor.getNumber() + ". " + ChatColor.BLACK + floor.getName(), - Slimefun.getLocalization().getMessage(p, "machines.ELEVATOR.click-to-teleport") + ' ' + ChatColor.WHITE + floor.getName() - ), (player, slot, itemStack, clickAction) -> { + Slimefun.getLocalization().getMessage(p, "machines.ELEVATOR.click-to-teleport") + ' ' + ChatColor.WHITE + floor.getName()), (player, slot, itemStack, clickAction) -> { teleport(player, floor); return false; }); @@ -207,7 +203,7 @@ private void teleport(Player player, ElevatorFloor floor) { public void openEditor(Player p, Block b) { ChestMenu menu = new ChestMenu(Slimefun.getLocalization().getMessage(p, "machines.ELEVATOR.editor-title")); - menu.addItem(4, new CustomItemStack(Material.NAME_TAG, "&7Floor Name &e(Click to edit)", "", ChatColor.WHITE + ChatColors.color(BlockStorage.getLocationInfo(b.getLocation(), DATA_KEY)))); + menu.addItem(4, CustomItemStack.create(Material.NAME_TAG, "&7Floor Name &e(Click to edit)", "", ChatColor.WHITE + ChatColors.color(BlockStorage.getLocationInfo(b.getLocation(), DATA_KEY)))); menu.addMenuClickHandler(4, (pl, slot, item, action) -> { pl.closeInventory(); pl.sendMessage(""); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/geo/GEOMiner.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/geo/GEOMiner.java index d21815533b..f7975920ae 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/geo/GEOMiner.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/geo/GEOMiner.java @@ -44,7 +44,7 @@ /** * The {@link GEOMiner} is an electrical machine that allows you to obtain a {@link GEOResource}. - * + * * @author TheBusyBiscuit * * @see GEOResource @@ -79,7 +79,7 @@ public GEOMiner(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeTy /** * This method returns the max amount of electricity this machine can hold. - * + * * @return The max amount of electricity this Block can store. */ @Override @@ -89,7 +89,7 @@ public int getCapacity() { /** * This method returns the amount of energy that is consumed per operation. - * + * * @return The rate of energy consumption */ public int getEnergyConsumption() { @@ -100,7 +100,7 @@ public int getEnergyConsumption() { * This method returns the speed at which this machine will operate. * This can be implemented on an instantiation-level to create different tiers * of machines. - * + * * @return The speed of this machine */ public int getSpeed() { @@ -111,10 +111,10 @@ public int getSpeed() { * This sets the energy capacity for this machine. * This method must be called before registering the item * and only before registering. - * + * * @param capacity * The amount of energy this machine can store - * + * * @return This method will return the current instance of {@link GEOMiner}, so that can be chained. */ public final GEOMiner setCapacity(int capacity) { @@ -130,10 +130,10 @@ public final GEOMiner setCapacity(int capacity) { /** * This sets the speed of this machine. - * + * * @param speed * The speed multiplier for this machine, must be above zero - * + * * @return This method will return the current instance of {@link GEOMiner}, so that can be chained. */ public final GEOMiner setProcessingSpeed(int speed) { @@ -145,10 +145,10 @@ public final GEOMiner setProcessingSpeed(int speed) { /** * This method sets the energy consumed by this machine per tick. - * + * * @param energyConsumption * The energy consumed per tick - * + * * @return This method will return the current instance of {@link GEOMiner}, so that can be chained. */ public final GEOMiner setEnergyConsumption(int energyConsumption) { @@ -232,7 +232,7 @@ public List getDisplayRecipes() { for (GEOResource resource : Slimefun.getRegistry().getGEOResources().values()) { if (resource.isObtainableFromGEOMiner()) { - displayRecipes.add(new CustomItemStack(resource.getItem(), ChatColor.RESET + resource.getName())); + displayRecipes.add(CustomItemStack.create(resource.getItem(), ChatColor.RESET + resource.getName())); } } @@ -258,7 +258,7 @@ protected void constructMenu(@Nonnull BlockMenuPreset preset) { preset.addItem(i, ChestMenuUtils.getOutputSlotTexture(), ChestMenuUtils.getEmptyClickHandler()); } - preset.addItem(4, new CustomItemStack(Material.BLACK_STAINED_GLASS_PANE, " "), ChestMenuUtils.getEmptyClickHandler()); + preset.addItem(4, CustomItemStack.create(Material.BLACK_STAINED_GLASS_PANE, " "), ChestMenuUtils.getEmptyClickHandler()); for (int i : OUTPUT_SLOTS) { preset.addMenuClickHandler(i, ChestMenuUtils.getDefaultOutputHandler()); @@ -296,7 +296,7 @@ protected void tick(@Nonnull Block b) { removeCharge(b.getLocation(), getEnergyConsumption()); operation.addProgress(getSpeed()); } else { - inv.replaceExistingItem(4, new CustomItemStack(Material.BLACK_STAINED_GLASS_PANE, " ")); + inv.replaceExistingItem(4, CustomItemStack.create(Material.BLACK_STAINED_GLASS_PANE, " ")); inv.pushItem(operation.getResult(), OUTPUT_SLOTS); processor.endOperation(b); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/geo/OilPump.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/geo/OilPump.java index 4422117526..412a65ad7b 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/geo/OilPump.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/geo/OilPump.java @@ -74,7 +74,7 @@ public int[] getSlotsAccessedByItemTransport(ItemTransportFlow flow) { @Override public List getDisplayRecipes() { - return Arrays.asList(emptyBucket, SlimefunItems.OIL_BUCKET); + return Arrays.asList(emptyBucket, SlimefunItems.OIL_BUCKET.item()); } @Override @@ -89,7 +89,7 @@ public ItemStack getProgressBar() { @Override protected MachineRecipe findNextRecipe(BlockMenu inv) { - if (inv.fits(SlimefunItems.OIL_BUCKET, getOutputSlots())) { + if (inv.fits(SlimefunItems.OIL_BUCKET.item(), getOutputSlots())) { Block b = inv.getBlock(); for (int slot : getInputSlots()) { @@ -97,7 +97,7 @@ protected MachineRecipe findNextRecipe(BlockMenu inv) { OptionalInt supplies = Slimefun.getGPSNetwork().getResourceManager().getSupplies(oil, b.getWorld(), b.getX() >> 4, b.getZ() >> 4); if (supplies.isPresent() && supplies.getAsInt() > 0) { - MachineRecipe recipe = new MachineRecipe(26, new ItemStack[] { emptyBucket }, new ItemStack[] { SlimefunItems.OIL_BUCKET }); + MachineRecipe recipe = new MachineRecipe(26, new ItemStack[] { emptyBucket }, new ItemStack[] { SlimefunItems.OIL_BUCKET.item() }); inv.consumeItem(slot); Slimefun.getGPSNetwork().getResourceManager().setSupplies(oil, b.getWorld(), b.getX() >> 4, b.getZ() >> 4, supplies.getAsInt() - 1); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/KnowledgeFlask.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/KnowledgeFlask.java index eaf2f8fb96..6efdebe787 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/KnowledgeFlask.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/KnowledgeFlask.java @@ -39,7 +39,7 @@ public KnowledgeFlask(ItemGroup itemGroup, SlimefunItemStack item, RecipeType re if (p.getLevel() >= 1 && (e.getClickedBlock().isEmpty() || !(e.getClickedBlock().get().getType().isInteractable()))) { p.setLevel(p.getLevel() - 1); - ItemStack item = SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE.clone(); + ItemStack item = SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE.item(); if (!p.getInventory().addItem(item).isEmpty()) { // The Item could not be added, let's drop it to the ground (fixes #2728) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/MagicEyeOfEnder.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/MagicEyeOfEnder.java index 302029c59d..9475a0cc01 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/MagicEyeOfEnder.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/MagicEyeOfEnder.java @@ -47,10 +47,10 @@ public MagicEyeOfEnder(ItemGroup itemGroup, SlimefunItemStack item, RecipeType r private boolean hasArmor(@Nonnull PlayerInventory inv) { // @formatter:off - return SlimefunUtils.isItemSimilar(inv.getHelmet(), SlimefunItems.ENDER_HELMET, true) - && SlimefunUtils.isItemSimilar(inv.getChestplate(), SlimefunItems.ENDER_CHESTPLATE, true) - && SlimefunUtils.isItemSimilar(inv.getLeggings(), SlimefunItems.ENDER_LEGGINGS, true) - && SlimefunUtils.isItemSimilar(inv.getBoots(), SlimefunItems.ENDER_BOOTS, true); + return SlimefunUtils.isItemSimilar(inv.getHelmet(), SlimefunItems.ENDER_HELMET.item(), true) + && SlimefunUtils.isItemSimilar(inv.getChestplate(), SlimefunItems.ENDER_CHESTPLATE.item(), true) + && SlimefunUtils.isItemSimilar(inv.getLeggings(), SlimefunItems.ENDER_LEGGINGS.item(), true) + && SlimefunUtils.isItemSimilar(inv.getBoots(), SlimefunItems.ENDER_BOOTS.item(), true); // @formatter:on } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/runes/EnchantmentRune.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/runes/EnchantmentRune.java index 33e54e7544..40b1a9e24e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/runes/EnchantmentRune.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/runes/EnchantmentRune.java @@ -2,7 +2,7 @@ import java.util.ArrayList; import java.util.Collection; -import java.util.EnumMap; +import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; @@ -43,14 +43,14 @@ public class EnchantmentRune extends SimpleSlimefunItem { private static final double RANGE = 1.5; - private final Map> applicableEnchantments = new EnumMap<>(Material.class); + private final Map> applicableEnchantments = new HashMap<>(); @ParametersAreNonnullByDefault public EnchantmentRune(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { super(itemGroup, item, recipeType, recipe); for (Material mat : Material.values()) { - if (Slimefun.instance().isUnitTest() && mat.isLegacy()) continue; + if (mat.isLegacy() || !mat.isItem()) continue; List enchantments = new ArrayList<>(); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/talismans/EnderTalisman.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/talismans/EnderTalisman.java index 0119c94882..96db7a6b53 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/talismans/EnderTalisman.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/talismans/EnderTalisman.java @@ -21,11 +21,11 @@ */ class EnderTalisman extends Talisman { - private static final LockedItemGroup ENDER_TALISMANS_ITEMGROUP = new LockedItemGroup(new NamespacedKey(Slimefun.instance(), "ender_talismans"), new CustomItemStack(SlimefunItems.ENDER_TALISMAN, "&7Talismans - &aTier II"), 3, Talisman.TALISMANS_ITEMGROUP.getKey()); + private static final LockedItemGroup ENDER_TALISMANS_ITEMGROUP = new LockedItemGroup(new NamespacedKey(Slimefun.instance(), "ender_talismans"), CustomItemStack.create(SlimefunItems.ENDER_TALISMAN.item(), "&7Talismans - &aTier II"), 3, Talisman.TALISMANS_ITEMGROUP.getKey()); @ParametersAreNonnullByDefault public EnderTalisman(Talisman parent, SlimefunItemStack item) { - super(ENDER_TALISMANS_ITEMGROUP, item, new ItemStack[] { SlimefunItems.ENDER_LUMP_3, null, SlimefunItems.ENDER_LUMP_3, null, parent.getItem(), null, SlimefunItems.ENDER_LUMP_3, null, SlimefunItems.ENDER_LUMP_3 }, parent.isConsumable(), parent.isEventCancelled(), parent.getMessageSuffix(), parent.getChance(), parent.getEffects()); + super(ENDER_TALISMANS_ITEMGROUP, item, new ItemStack[] { SlimefunItems.ENDER_LUMP_3.item(), null, SlimefunItems.ENDER_LUMP_3.item(), null, parent.getItem(), null, SlimefunItems.ENDER_LUMP_3.item(), null, SlimefunItems.ENDER_LUMP_3.item() }, parent.isConsumable(), parent.isEventCancelled(), parent.getMessageSuffix(), parent.getChance(), parent.getEffects()); } @Override diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/talismans/Talisman.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/talismans/Talisman.java index 9f97f19892..fe06a0aafe 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/talismans/Talisman.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/talismans/Talisman.java @@ -40,7 +40,7 @@ public class Talisman extends SlimefunItem { - protected static final ItemGroup TALISMANS_ITEMGROUP = new ItemGroup(new NamespacedKey(Slimefun.instance(), "talismans"), new CustomItemStack(SlimefunItems.COMMON_TALISMAN, "&7Talismans - &aTier I"), 2); + protected static final ItemGroup TALISMANS_ITEMGROUP = new ItemGroup(new NamespacedKey(Slimefun.instance(), "talismans"), CustomItemStack.create(SlimefunItems.COMMON_TALISMAN.item(), "&7Talismans - &aTier I"), 2); private static final String WIKI_PAGE = "Talismans"; private final SlimefunItemStack enderTalisman; @@ -68,7 +68,7 @@ public Talisman(SlimefunItemStack item, ItemStack[] recipe, boolean consumable, @ParametersAreNonnullByDefault protected Talisman(ItemGroup itemGroup, SlimefunItemStack item, ItemStack[] recipe, boolean consumable, boolean cancelEvent, @Nullable String messageSuffix, int chance, PotionEffect... effects) { - super(itemGroup, item, RecipeType.MAGIC_WORKBENCH, recipe, new CustomItemStack(item, consumable ? 4 : 1)); + super(itemGroup, item, RecipeType.MAGIC_WORKBENCH, recipe, CustomItemStack.create(item.item(), consumable ? 4 : 1)); this.consumable = consumable; this.cancel = cancelEvent; @@ -95,7 +95,7 @@ protected Talisman(ItemGroup itemGroup, SlimefunItemStack item, ItemStack[] reci /** * This returns whether the {@link Talisman} will be consumed upon use. - * + * * @return Whether this {@link Talisman} is consumed on use. */ public boolean isConsumable() { @@ -105,7 +105,7 @@ public boolean isConsumable() { /** * This returns the chance of this {@link Talisman} activating. * The chance will be between 1 and 100. - * + * * @return The chance of this {@link Talisman} activating. */ public int getChance() { @@ -194,9 +194,9 @@ public static boolean trigger(Event e, SlimefunItem item, boolean sendMessage) { } EnderTalisman enderTalisman = enderTalismanItem.getItem(EnderTalisman.class); - if (enderTalisman != null && SlimefunUtils.containsSimilarItem(p.getEnderChest(), enderTalismanItem, true)) { + if (enderTalisman != null && SlimefunUtils.containsSimilarItem(p.getEnderChest(), enderTalismanItem.item(), true)) { if (talisman.canUse(p, true)) { - activateTalisman(e, p, p.getEnderChest(), enderTalisman, enderTalismanItem, sendMessage); + activateTalisman(e, p, p.getEnderChest(), enderTalisman, enderTalismanItem.item(), sendMessage); return true; } else { return false; @@ -259,7 +259,7 @@ private static void cancelEvent(Event e, Talisman talisman) { * This returns whether the {@link Talisman} is silent. * A silent {@link Talisman} will not send a message to a {@link Player} * when activated. - * + * * @return Whether this {@link Talisman} is silent */ public boolean isSilent() { @@ -275,7 +275,7 @@ protected final String getMessageSuffix() { * This method sends the given {@link Player} the message of this {@link Talisman}. * Dependent on the selected config setting, the message will be sent via the actionbar * or in the chat window. - * + * * @param p * The {@link Player} who shall receive the message */ diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/misc/OrganicFertilizer.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/misc/OrganicFertilizer.java index b78520ffe0..d3a156b741 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/misc/OrganicFertilizer.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/misc/OrganicFertilizer.java @@ -28,7 +28,7 @@ public class OrganicFertilizer extends SlimefunItem { @ParametersAreNonnullByDefault public OrganicFertilizer(ItemGroup itemGroup, SlimefunItemStack item, SlimefunItemStack ingredient) { - super(itemGroup, item, RecipeType.FOOD_COMPOSTER, new ItemStack[] { ingredient, null, null, null, null, null, null, null, null }, new SlimefunItemStack(item, OUTPUT)); + super(itemGroup, item, RecipeType.FOOD_COMPOSTER, new ItemStack[] { ingredient.item(), null, null, null, null, null, null, null, null }, new SlimefunItemStack(item, OUTPUT).item()); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/misc/OrganicFood.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/misc/OrganicFood.java index ac46b6e356..a9471d0968 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/misc/OrganicFood.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/misc/OrganicFood.java @@ -28,6 +28,6 @@ public class OrganicFood extends SlimefunItem { @ParametersAreNonnullByDefault public OrganicFood(ItemGroup itemGroup, SlimefunItemStack item, Material ingredient) { - super(itemGroup, item, RecipeType.FOOD_FABRICATOR, new ItemStack[] { SlimefunItems.TIN_CAN, new ItemStack(ingredient), null, null, null, null, null, null, null }, new SlimefunItemStack(item, OUTPUT)); + super(itemGroup, item, RecipeType.FOOD_FABRICATOR, new ItemStack[] { SlimefunItems.TIN_CAN.item(), new ItemStack(ingredient), null, null, null, null, null, null, null }, new SlimefunItemStack(item, OUTPUT).item()); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/ArmorForge.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/ArmorForge.java index 4ee70ac722..4a86c04ce3 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/ArmorForge.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/ArmorForge.java @@ -29,7 +29,7 @@ public class ArmorForge extends AbstractCraftingTable { @ParametersAreNonnullByDefault public ArmorForge(ItemGroup itemGroup, SlimefunItemStack item) { - super(itemGroup, item, new ItemStack[] { null, null, null, null, new ItemStack(Material.ANVIL), null, null, new CustomItemStack(Material.DISPENSER, "Dispenser (Facing up)"), null }, BlockFace.SELF); + super(itemGroup, item, new ItemStack[] { null, null, null, null, new ItemStack(Material.ANVIL), null, null, CustomItemStack.create(Material.DISPENSER, "Dispenser (Facing up)"), null }, BlockFace.SELF); } @Override diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/Compressor.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/Compressor.java index f0b48882e6..555c215dad 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/Compressor.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/Compressor.java @@ -32,19 +32,19 @@ public class Compressor extends MultiBlockMachine { @ParametersAreNonnullByDefault public Compressor(ItemGroup itemGroup, SlimefunItemStack item) { - super(itemGroup, item, new ItemStack[] { null, null, null, null, new ItemStack(Material.NETHER_BRICK_FENCE), null, new ItemStack(Material.PISTON), new CustomItemStack(Material.DISPENSER, "Dispenser (Facing up)"), new ItemStack(Material.PISTON) }, BlockFace.SELF); + super(itemGroup, item, new ItemStack[] { null, null, null, null, new ItemStack(Material.NETHER_BRICK_FENCE), null, new ItemStack(Material.PISTON), CustomItemStack.create(Material.DISPENSER, "Dispenser (Facing up)"), new ItemStack(Material.PISTON) }, BlockFace.SELF); } @Override protected void registerDefaultRecipes(List recipes) { - recipes.add(new SlimefunItemStack(SlimefunItems.STONE_CHUNK, 4)); + recipes.add(new SlimefunItemStack(SlimefunItems.STONE_CHUNK, 4).item()); recipes.add(new ItemStack(Material.COBBLESTONE)); recipes.add(new ItemStack(Material.FLINT, 8)); recipes.add(new ItemStack(Material.COBBLESTONE)); recipes.add(new ItemStack(Material.COAL_BLOCK, 8)); - recipes.add(new SlimefunItemStack(SlimefunItems.CARBON, 9)); + recipes.add(new SlimefunItemStack(SlimefunItems.CARBON, 9).item()); recipes.add(new ItemStack(Material.CHARCOAL, 4)); recipes.add(new ItemStack(Material.COAL)); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/GrindStone.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/GrindStone.java index f149093042..754585d8d5 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/GrindStone.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/GrindStone.java @@ -33,7 +33,7 @@ public class GrindStone extends MultiBlockMachine { @ParametersAreNonnullByDefault public GrindStone(ItemGroup itemGroup, SlimefunItemStack item) { - super(itemGroup, item, new ItemStack[] { null, null, null, null, new ItemStack(Material.OAK_FENCE), null, null, new CustomItemStack(Material.DISPENSER, "Dispenser (Facing up)"), null }, BlockFace.SELF); + super(itemGroup, item, new ItemStack[] { null, null, null, null, new ItemStack(Material.OAK_FENCE), null, null, CustomItemStack.create(Material.DISPENSER, "Dispenser (Facing up)"), null }, BlockFace.SELF); } @Override @@ -63,7 +63,7 @@ protected void registerDefaultRecipes(@Nonnull List recipes) { recipes.add(new ItemStack(Material.GRAVEL)); recipes.add(new ItemStack(Material.DIRT)); - recipes.add(SlimefunItems.STONE_CHUNK); + recipes.add(SlimefunItems.STONE_CHUNK.item()); recipes.add(new ItemStack(Material.SANDSTONE)); recipes.add(new ItemStack(Material.SAND, 4)); @@ -94,20 +94,20 @@ protected void registerDefaultRecipes(@Nonnull List recipes) { recipes.add(new ItemStack(Material.GRAVEL)); } - recipes.add(SlimefunItems.MAGIC_LUMP_2); - recipes.add(new SlimefunItemStack(SlimefunItems.MAGIC_LUMP_1, 4)); + recipes.add(SlimefunItems.MAGIC_LUMP_2.item()); + recipes.add(new SlimefunItemStack(SlimefunItems.MAGIC_LUMP_1, 4).item()); - recipes.add(SlimefunItems.MAGIC_LUMP_3); - recipes.add(new SlimefunItemStack(SlimefunItems.MAGIC_LUMP_2, 4)); + recipes.add(SlimefunItems.MAGIC_LUMP_3.item()); + recipes.add(new SlimefunItemStack(SlimefunItems.MAGIC_LUMP_2, 4).item()); - recipes.add(SlimefunItems.ENDER_LUMP_2); - recipes.add(new SlimefunItemStack(SlimefunItems.ENDER_LUMP_1, 4)); + recipes.add(SlimefunItems.ENDER_LUMP_2.item()); + recipes.add(new SlimefunItemStack(SlimefunItems.ENDER_LUMP_1, 4).item()); - recipes.add(SlimefunItems.ENDER_LUMP_3); - recipes.add(new SlimefunItemStack(SlimefunItems.ENDER_LUMP_2, 4)); + recipes.add(SlimefunItems.ENDER_LUMP_3.item()); + recipes.add(new SlimefunItemStack(SlimefunItems.ENDER_LUMP_2, 4).item()); recipes.add(new ItemStack(Material.DIAMOND)); - recipes.add(new SlimefunItemStack(SlimefunItems.CARBON, 4)); + recipes.add(new SlimefunItemStack(SlimefunItems.CARBON, 4).item()); } @Override diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/Juicer.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/Juicer.java index a81c731434..da99ce748f 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/Juicer.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/Juicer.java @@ -32,10 +32,10 @@ /** * The {@link Juicer} is a {@link MultiBlockMachine} which can be used to * craft {@link Juice}. - * + * * @author TheBusyBiscuit * @author Liruxo - * + * * @see Juice * */ @@ -43,7 +43,7 @@ public class Juicer extends MultiBlockMachine { @ParametersAreNonnullByDefault public Juicer(ItemGroup itemGroup, SlimefunItemStack item) { - super(itemGroup, item, new ItemStack[] { null, new ItemStack(Material.GLASS), null, null, new ItemStack(Material.NETHER_BRICK_FENCE), null, null, new CustomItemStack(Material.DISPENSER, "Dispenser (Facing up)"), null }, BlockFace.SELF); + super(itemGroup, item, new ItemStack[] { null, new ItemStack(Material.GLASS), null, null, new ItemStack(Material.NETHER_BRICK_FENCE), null, null, CustomItemStack.create(Material.DISPENSER, "Dispenser (Facing up)"), null }, BlockFace.SELF); } @Override diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/MagicWorkbench.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/MagicWorkbench.java index 25ce8cdcc8..cd2e0a86ec 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/MagicWorkbench.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/MagicWorkbench.java @@ -86,7 +86,7 @@ private void craft(Inventory inv, Block dispenser, Player p, Block b, ItemStack for (int j = 0; j < 9; j++) { if (inv.getContents()[j] != null && inv.getContents()[j].getType() != Material.AIR) { if (inv.getContents()[j].getAmount() > 1) { - inv.setItem(j, new CustomItemStack(inv.getContents()[j], inv.getContents()[j].getAmount() - 1)); + inv.setItem(j, CustomItemStack.create(inv.getContents()[j], inv.getContents()[j].getAmount() - 1)); } else { inv.setItem(j, null); } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/MakeshiftSmeltery.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/MakeshiftSmeltery.java index a46b27f2d8..7405a0694c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/MakeshiftSmeltery.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/MakeshiftSmeltery.java @@ -20,9 +20,9 @@ /** * The {@link MakeshiftSmeltery} is a simpler version of the {@link Smeltery}. * Its functionality is very limited and it cannot be used to smelt alloys. - * + * * @author TheBusyBiscuit - * + * * @see Smeltery * */ @@ -30,7 +30,7 @@ public class MakeshiftSmeltery extends AbstractSmeltery { @ParametersAreNonnullByDefault public MakeshiftSmeltery(ItemGroup itemGroup, SlimefunItemStack item) { - super(itemGroup, item, new ItemStack[] { null, new ItemStack(Material.OAK_FENCE), null, new ItemStack(Material.BRICKS), new CustomItemStack(Material.DISPENSER, "Dispenser (Facing up)"), new ItemStack(Material.BRICKS), null, new ItemStack(Material.FLINT_AND_STEEL), null }, BlockFace.DOWN); + super(itemGroup, item, new ItemStack[] { null, new ItemStack(Material.OAK_FENCE), null, new ItemStack(Material.BRICKS), CustomItemStack.create(Material.DISPENSER, "Dispenser (Facing up)"), new ItemStack(Material.BRICKS), null, new ItemStack(Material.FLINT_AND_STEEL), null }, BlockFace.DOWN); } @Override diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/OreCrusher.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/OreCrusher.java index ea5141f099..07e5df7735 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/OreCrusher.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/OreCrusher.java @@ -35,7 +35,7 @@ /** * The {@link OreCrusher} is a {@link MultiBlockMachine} which allows you to double ores * and crush some other {@link Material Materials} into various resources. - * + * * @author TheBusyBiscuit * */ @@ -45,7 +45,7 @@ public class OreCrusher extends MultiBlockMachine { @ParametersAreNonnullByDefault public OreCrusher(ItemGroup itemGroup, SlimefunItemStack item) { - super(itemGroup, item, new ItemStack[] { null, null, null, null, new ItemStack(Material.NETHER_BRICK_FENCE), null, new ItemStack(Material.IRON_BARS), new CustomItemStack(Material.DISPENSER, "Dispenser (Facing up)"), new ItemStack(Material.IRON_BARS) }, BlockFace.SELF); + super(itemGroup, item, new ItemStack[] { null, null, null, null, new ItemStack(Material.NETHER_BRICK_FENCE), null, new ItemStack(Material.IRON_BARS), CustomItemStack.create(Material.DISPENSER, "Dispenser (Facing up)"), new ItemStack(Material.IRON_BARS) }, BlockFace.SELF); addItemSetting(doubleOres); } @@ -58,50 +58,50 @@ protected void registerDefaultRecipes(List recipes) { recipes.add(new ItemStack(Material.COBBLESTONE, 8)); recipes.add(new ItemStack(Material.SAND, 1)); - recipes.add(SlimefunItems.GOLD_4K); - recipes.add(SlimefunItems.GOLD_DUST); + recipes.add(SlimefunItems.GOLD_4K.item()); + recipes.add(SlimefunItems.GOLD_DUST.item()); - recipes.add(SlimefunItems.GOLD_6K); - recipes.add(new SlimefunItemStack(SlimefunItems.GOLD_DUST, 2)); + recipes.add(SlimefunItems.GOLD_6K.item()); + recipes.add(new SlimefunItemStack(SlimefunItems.GOLD_DUST, 2).item()); - recipes.add(SlimefunItems.GOLD_8K); - recipes.add(new SlimefunItemStack(SlimefunItems.GOLD_DUST, 2)); + recipes.add(SlimefunItems.GOLD_8K.item()); + recipes.add(new SlimefunItemStack(SlimefunItems.GOLD_DUST, 2).item()); - recipes.add(SlimefunItems.GOLD_10K); - recipes.add(new SlimefunItemStack(SlimefunItems.GOLD_DUST, 3)); + recipes.add(SlimefunItems.GOLD_10K.item()); + recipes.add(new SlimefunItemStack(SlimefunItems.GOLD_DUST, 3).item()); - recipes.add(SlimefunItems.GOLD_12K); - recipes.add(new SlimefunItemStack(SlimefunItems.GOLD_DUST, 3)); + recipes.add(SlimefunItems.GOLD_12K.item()); + recipes.add(new SlimefunItemStack(SlimefunItems.GOLD_DUST, 3).item()); - recipes.add(SlimefunItems.GOLD_14K); - recipes.add(new SlimefunItemStack(SlimefunItems.GOLD_DUST, 4)); + recipes.add(SlimefunItems.GOLD_14K.item()); + recipes.add(new SlimefunItemStack(SlimefunItems.GOLD_DUST, 4).item()); - recipes.add(SlimefunItems.GOLD_16K); - recipes.add(new SlimefunItemStack(SlimefunItems.GOLD_DUST, 4)); + recipes.add(SlimefunItems.GOLD_16K.item()); + recipes.add(new SlimefunItemStack(SlimefunItems.GOLD_DUST, 4).item()); - recipes.add(SlimefunItems.GOLD_18K); - recipes.add(new SlimefunItemStack(SlimefunItems.GOLD_DUST, 5)); + recipes.add(SlimefunItems.GOLD_18K.item()); + recipes.add(new SlimefunItemStack(SlimefunItems.GOLD_DUST, 5).item()); - recipes.add(SlimefunItems.GOLD_20K); - recipes.add(new SlimefunItemStack(SlimefunItems.GOLD_DUST, 5)); + recipes.add(SlimefunItems.GOLD_20K.item()); + recipes.add(new SlimefunItemStack(SlimefunItems.GOLD_DUST, 5).item()); - recipes.add(SlimefunItems.GOLD_22K); - recipes.add(new SlimefunItemStack(SlimefunItems.GOLD_DUST, 6)); + recipes.add(SlimefunItems.GOLD_22K.item()); + recipes.add(new SlimefunItemStack(SlimefunItems.GOLD_DUST, 6).item()); - recipes.add(SlimefunItems.GOLD_24K); - recipes.add(new SlimefunItemStack(SlimefunItems.GOLD_DUST, 6)); + recipes.add(SlimefunItems.GOLD_24K.item()); + recipes.add(new SlimefunItemStack(SlimefunItems.GOLD_DUST, 6).item()); recipes.add(new ItemStack(Material.GRAVEL)); recipes.add(new ItemStack(Material.SAND)); recipes.add(new ItemStack(Material.MAGMA_BLOCK)); - recipes.add(SlimefunItems.SULFATE); + recipes.add(SlimefunItems.SULFATE.item()); - recipes.add(SlimefunItems.CARBON); + recipes.add(SlimefunItems.CARBON.item()); recipes.add(new ItemStack(Material.COAL, 8)); - recipes.add(SlimefunItems.COMPRESSED_CARBON); - recipes.add(new SlimefunItemStack(SlimefunItems.CARBON, 4)); + recipes.add(SlimefunItems.COMPRESSED_CARBON.item()); + recipes.add(new SlimefunItemStack(SlimefunItems.CARBON, 4).item()); if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_17)) { recipes.add(new ItemStack(Material.COBBLED_DEEPSLATE, 8)); @@ -138,13 +138,13 @@ public void postRegister() { // Raw metal ores (1.17+) if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_17)) { displayRecipes.add(new ItemStack(Material.RAW_IRON)); - displayRecipes.add(SlimefunItems.IRON_DUST); + displayRecipes.add(SlimefunItems.IRON_DUST.item()); displayRecipes.add(new ItemStack(Material.RAW_COPPER)); - displayRecipes.add(SlimefunItems.COPPER_DUST); + displayRecipes.add(SlimefunItems.COPPER_DUST.item()); displayRecipes.add(new ItemStack(Material.RAW_GOLD)); - displayRecipes.add(SlimefunItems.GOLD_DUST); + displayRecipes.add(SlimefunItems.GOLD_DUST.item()); } // Deepslate Ores (1.17+) @@ -161,16 +161,16 @@ public void postRegister() { // More deepslate ores and copper ore displayRecipes.add(new ItemStack(Material.DEEPSLATE_IRON_ORE)); - displayRecipes.add(new SlimefunItemStack(SlimefunItems.IRON_DUST, isOreDoublingEnabled() ? 2 : 1)); + displayRecipes.add(new SlimefunItemStack(SlimefunItems.IRON_DUST, isOreDoublingEnabled() ? 2 : 1).item()); displayRecipes.add(new ItemStack(Material.DEEPSLATE_GOLD_ORE)); - displayRecipes.add(new SlimefunItemStack(SlimefunItems.GOLD_DUST, isOreDoublingEnabled() ? 2 : 1)); + displayRecipes.add(new SlimefunItemStack(SlimefunItems.GOLD_DUST, isOreDoublingEnabled() ? 2 : 1).item()); displayRecipes.add(new ItemStack(Material.DEEPSLATE_COPPER_ORE)); - displayRecipes.add(new SlimefunItemStack(SlimefunItems.COPPER_DUST, isOreDoublingEnabled() ? 2 : 1)); + displayRecipes.add(new SlimefunItemStack(SlimefunItems.COPPER_DUST, isOreDoublingEnabled() ? 2 : 1).item()); displayRecipes.add(new ItemStack(Material.COPPER_ORE)); - displayRecipes.add(new SlimefunItemStack(SlimefunItems.COPPER_DUST, isOreDoublingEnabled() ? 2 : 1)); + displayRecipes.add(new SlimefunItemStack(SlimefunItems.COPPER_DUST, isOreDoublingEnabled() ? 2 : 1).item()); } } @@ -241,12 +241,12 @@ private void apply(boolean value) { SlimefunItem ironDust = SlimefunItem.getById("IRON_DUST"); if (ironDust != null) { - ironDust.setRecipeOutput(new SlimefunItemStack(SlimefunItems.IRON_DUST, value ? 2 : 1)); + ironDust.setRecipeOutput(new SlimefunItemStack(SlimefunItems.IRON_DUST, value ? 2 : 1).item()); } SlimefunItem goldDust = SlimefunItem.getById("GOLD_DUST"); if (goldDust != null) { - goldDust.setRecipeOutput(new SlimefunItemStack(SlimefunItems.GOLD_DUST, value ? 2 : 1)); + goldDust.setRecipeOutput(new SlimefunItemStack(SlimefunItems.GOLD_DUST, value ? 2 : 1).item()); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/OreWasher.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/OreWasher.java index 25a3282369..b8b7bcae6f 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/OreWasher.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/OreWasher.java @@ -39,7 +39,7 @@ public class OreWasher extends MultiBlockMachine { // @formatter:off - private final ItemStack[] dusts = new ItemStack[] { + private final SlimefunItemStack[] dusts = new SlimefunItemStack[] { SlimefunItems.IRON_DUST, SlimefunItems.GOLD_DUST, SlimefunItems.COPPER_DUST, @@ -74,14 +74,14 @@ protected void registerDefaultRecipes(List recipes) { * way of obtaining them. But we also wanna display them here, so we just * add these two recipes manually */ - recipes.add(SlimefunItems.SIFTED_ORE); - recipes.add(SlimefunItems.IRON_DUST); + recipes.add(SlimefunItems.SIFTED_ORE.item()); + recipes.add(SlimefunItems.IRON_DUST.item()); - recipes.add(SlimefunItems.SIFTED_ORE); - recipes.add(SlimefunItems.GOLD_DUST); + recipes.add(SlimefunItems.SIFTED_ORE.item()); + recipes.add(SlimefunItems.GOLD_DUST.item()); recipes.add(new ItemStack(Material.SAND)); - recipes.add(SlimefunItems.SALT); + recipes.add(SlimefunItems.SALT.item()); } @Override @@ -99,7 +99,7 @@ public void onInteract(Player p, Block b) { for (ItemStack input : inv.getContents()) { if (input != null) { - if (SlimefunUtils.isItemSimilar(input, SlimefunItems.SIFTED_ORE, true)) { + if (SlimefunUtils.isItemSimilar(input, SlimefunItems.SIFTED_ORE.item(), true)) { ItemStack output = getRandomDust(); Inventory outputInv; @@ -113,7 +113,7 @@ public void onInteract(Player p, Block b) { * SlimefunItems.DEBUG_FISH however, signals that it's not supposed * to be given to the player. */ - ItemStack dummyAdding = SlimefunItems.DEBUG_FISH; + ItemStack dummyAdding = SlimefunItems.DEBUG_FISH.item(); outputInv = findOutputInventory(dummyAdding, dispBlock, inv); } else { outputInv = findOutputInventory(output, dispBlock, inv); @@ -127,12 +127,12 @@ public void onInteract(Player p, Block b) { removeItem(p, b, inv, outputInv, input, event.getOutput(), 1); if (outputInv != null) { - outputInv.addItem(SlimefunItems.STONE_CHUNK); + outputInv.addItem(SlimefunItems.STONE_CHUNK.item()); } return; } else if (SlimefunUtils.isItemSimilar(input, new ItemStack(Material.SAND, 2), false)) { - ItemStack output = SlimefunItems.SALT; + ItemStack output = SlimefunItems.SALT.item(); Inventory outputInv = findOutputInventory(output, dispBlock, inv); MultiBlockCraftEvent event = new MultiBlockCraftEvent(p, this, input, output); @@ -143,8 +143,8 @@ public void onInteract(Player p, Block b) { removeItem(p, b, inv, outputInv, input, event.getOutput(), 2); return; - } else if (SlimefunUtils.isItemSimilar(input, SlimefunItems.PULVERIZED_ORE, true)) { - ItemStack output = SlimefunItems.PURE_ORE_CLUSTER; + } else if (SlimefunUtils.isItemSimilar(input, SlimefunItems.PULVERIZED_ORE.item(), true)) { + ItemStack output = SlimefunItems.PURE_ORE_CLUSTER.item(); Inventory outputInv = findOutputInventory(output, dispBlock, inv); MultiBlockCraftEvent event = new MultiBlockCraftEvent(p, this, input, output); @@ -185,7 +185,7 @@ private void removeItem(Player p, Block b, Inventory inputInv, @Nullable Invento */ public @Nonnull ItemStack getRandomDust() { int index = ThreadLocalRandom.current().nextInt(dusts.length); - return dusts[index].clone(); + return dusts[index].item(); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/PressureChamber.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/PressureChamber.java index c8b75de5a3..50f42828bb 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/PressureChamber.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/PressureChamber.java @@ -32,7 +32,7 @@ public class PressureChamber extends MultiBlockMachine { @ParametersAreNonnullByDefault public PressureChamber(ItemGroup itemGroup, SlimefunItemStack item) { - super(itemGroup, item, new ItemStack[] { new ItemStack(Material.SMOOTH_STONE_SLAB), new CustomItemStack(Material.DISPENSER, "Dispenser (Facing down)"), new ItemStack(Material.SMOOTH_STONE_SLAB), new ItemStack(Material.PISTON), new ItemStack(Material.GLASS), new ItemStack(Material.PISTON), new ItemStack(Material.PISTON), new ItemStack(Material.CAULDRON), new ItemStack(Material.PISTON) }, BlockFace.UP); + super(itemGroup, item, new ItemStack[] { new ItemStack(Material.SMOOTH_STONE_SLAB), CustomItemStack.create(Material.DISPENSER, "Dispenser (Facing down)"), new ItemStack(Material.SMOOTH_STONE_SLAB), new ItemStack(Material.PISTON), new ItemStack(Material.GLASS), new ItemStack(Material.PISTON), new ItemStack(Material.PISTON), new ItemStack(Material.CAULDRON), new ItemStack(Material.PISTON) }, BlockFace.UP); } @Override diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/Smeltery.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/Smeltery.java index a55abe12ff..6140929b93 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/Smeltery.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/Smeltery.java @@ -30,7 +30,7 @@ * The {@link Smeltery} is an upgraded version of the {@link MakeshiftSmeltery} * with the additional capabilities to create {@link AlloyIngot}s and utilise an * {@link IgnitionChamber}. - * + * * @author TheBusyBiscuit * @author AtomicScience * @author Sfiguz7 @@ -38,7 +38,7 @@ * @author emanueljg * @author SoSeDiK * @author Redemption198 - * + * * @see AbstractSmeltery * @see MakeshiftSmeltery * @see IgnitionChamber @@ -50,14 +50,14 @@ public class Smeltery extends AbstractSmeltery { @ParametersAreNonnullByDefault public Smeltery(ItemGroup itemGroup, SlimefunItemStack item) { - super(itemGroup, item, new ItemStack[] { null, new ItemStack(Material.NETHER_BRICK_FENCE), null, new ItemStack(Material.NETHER_BRICKS), new CustomItemStack(Material.DISPENSER, "Dispenser (Facing up)"), new ItemStack(Material.NETHER_BRICKS), null, new ItemStack(Material.FLINT_AND_STEEL), null }, BlockFace.DOWN); + super(itemGroup, item, new ItemStack[] { null, new ItemStack(Material.NETHER_BRICK_FENCE), null, new ItemStack(Material.NETHER_BRICKS), CustomItemStack.create(Material.DISPENSER, "Dispenser (Facing up)"), new ItemStack(Material.NETHER_BRICKS), null, new ItemStack(Material.FLINT_AND_STEEL), null }, BlockFace.DOWN); addItemSetting(fireBreakingChance); } @Override protected void registerDefaultRecipes(@Nonnull List recipes) { - recipes.add(SlimefunItems.IRON_DUST); + recipes.add(SlimefunItems.IRON_DUST.item()); recipes.add(new ItemStack(Material.IRON_INGOT)); } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/IndustrialMiner.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/IndustrialMiner.java index 3ad9381c6c..77c61ff7b4 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/IndustrialMiner.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/IndustrialMiner.java @@ -37,12 +37,12 @@ /** * The {@link IndustrialMiner} is a {@link MultiBlockMachine} that can mine any * ores it finds in a given range underneath where it was placed. - * + * * And for those of you who are wondering... yes this is the replacement for the * long-time deprecated Digital Miner. - * + * * @author TheBusyBiscuit - * + * * @see AdvancedIndustrialMiner * @see MiningTask * @@ -63,7 +63,7 @@ public IndustrialMiner(ItemGroup itemGroup, SlimefunItemStack item, Material bas // @formatter:off super(itemGroup, item, new ItemStack[] { null, null, null, - new CustomItemStack(Material.PISTON, "Piston (facing up)"), new ItemStack(Material.CHEST), new CustomItemStack(Material.PISTON, "Piston (facing up)"), + CustomItemStack.create(Material.PISTON, "Piston (facing up)"), new ItemStack(Material.CHEST), CustomItemStack.create(Material.PISTON, "Piston (facing up)"), new ItemStack(baseMaterial), new ItemStack(Material.BLAST_FURNACE), new ItemStack(baseMaterial) }, BlockFace.UP); // @formatter:on @@ -80,7 +80,7 @@ public IndustrialMiner(ItemGroup itemGroup, SlimefunItemStack item, Material bas /** * This returns whether this {@link IndustrialMiner} will output ores as they are. * Similar to the Silk Touch {@link Enchantment}. - * + * * @return Whether to treat ores with Silk Touch */ public boolean hasSilkTouch() { @@ -91,10 +91,10 @@ public boolean hasSilkTouch() { * This method returns the range of the {@link IndustrialMiner}. * The total area will be determined by the range multiplied by 2 plus the actual center * of the machine. - * + * * So a range of 3 will make the {@link IndustrialMiner} affect an area of 7x7 blocks. * 3 on all axis, plus the center of the machine itself. - * + * * @return The range of this {@link IndustrialMiner} */ public int getRange() { @@ -122,10 +122,10 @@ protected void registerDefaultFuelTypes() { /** * This method returns the outcome that mining certain ores yields. - * + * * @param material * The {@link Material} of the ore that was mined - * + * * @return The outcome when mining this ore */ public @Nonnull ItemStack getOutcome(@Nonnull Material material) { @@ -139,7 +139,7 @@ protected void registerDefaultFuelTypes() { /** * This registers a new fuel type for this {@link IndustrialMiner}. - * + * * @param ores * The amount of ores this allows you to mine * @param item @@ -207,7 +207,7 @@ public void onInteract(Player p, Block b) { * * @param block * The {@link Block} to check - * + * * @return Whether this {@link IndustrialMiner} is capable of mining this {@link Block} */ public boolean canMine(@Nonnull Block block) { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ClimbingPick.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ClimbingPick.java index 265db240ed..dbd9cdad9a 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ClimbingPick.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ClimbingPick.java @@ -2,7 +2,7 @@ import java.util.ArrayList; import java.util.Collection; -import java.util.EnumMap; +import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; @@ -62,7 +62,7 @@ public class ClimbingPick extends SimpleSlimefunItem implements private final ItemSetting dualWielding = new ItemSetting<>(this, "dual-wielding", true); private final ItemSetting damageOnUse = new ItemSetting<>(this, "damage-on-use", true); - private final Map surfaces = new EnumMap<>(Material.class); + private final Map surfaces = new HashMap<>(); private final Set users = new HashSet<>(); @ParametersAreNonnullByDefault @@ -97,7 +97,7 @@ protected void addSurface(@Nonnull Material type, double defaultValue) { /** * This returns whether the {@link ClimbingPick} needs to be held in both * arms to work. - * + * * @return Whether dual wielding is enabled */ public boolean isDualWieldingEnabled() { @@ -107,7 +107,7 @@ public boolean isDualWieldingEnabled() { /** * This method returns a {@link Collection} of every {@link ClimbableSurface} the * {@link ClimbingPick} can climb. - * + * * @return A {@link Collection} of every {@link ClimbableSurface} */ @Nonnull @@ -117,10 +117,10 @@ public Collection getClimbableSurfaces() { /** * This returns the climbing speed for a given {@link Material}. - * + * * @param type * The {@link Material} - * + * * @return The climbing speed for this {@link Material} or 0. */ public double getClimbingSpeed(@Nonnull Material type) { @@ -136,12 +136,12 @@ public double getClimbingSpeed(@Nonnull Material type) { /** * This returns the climbing speed for a given {@link Material} and the used {@link ItemStack}. - * + * * @param item * the {@link ClimbingPick}'s {@link ItemStack} * @param type * The {@link Material} - * + * * @return The climbing speed or 0. */ public double getClimbingSpeed(@Nonnull ItemStack item, @Nonnull Material type) { @@ -268,7 +268,9 @@ public List getDisplayRecipes() { List display = new ArrayList<>(); for (Material mat : surfaces.keySet()) { - display.add(new ItemStack(mat)); + if (mat.isItem()) { + display.add(new ItemStack(mat)); + } } return display; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosiveTool.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosiveTool.java index 6fe1174e4f..59fcd86d00 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosiveTool.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosiveTool.java @@ -1,7 +1,9 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.tools; +import java.lang.reflect.Constructor; import java.util.ArrayList; import java.util.List; +import java.util.logging.Level; import javax.annotation.Nonnull; import javax.annotation.ParametersAreNonnullByDefault; @@ -9,6 +11,7 @@ import dev.lone.itemsadder.api.CustomBlock; import org.bukkit.Bukkit; import org.bukkit.Effect; +import org.bukkit.ExplosionResult; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.entity.Player; @@ -17,6 +20,7 @@ import org.bukkit.inventory.ItemStack; import io.github.bakedlibs.dough.protection.Interaction; +import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.api.events.ExplosiveToolBreakBlocksEvent; import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup; import io.github.thebusybiscuit.slimefun4.api.items.ItemSetting; @@ -48,6 +52,17 @@ public class ExplosiveTool extends SimpleSlimefunItem implements private final ItemSetting damageOnUse = new ItemSetting<>(this, "damage-on-use", true); private final ItemSetting callExplosionEvent = new ItemSetting<>(this, "call-explosion-event", false); + private static Constructor pre21ExplodeEventConstructor; + static { + if (Slimefun.getMinecraftVersion().isBefore(MinecraftVersion.MINECRAFT_1_21)) { + try { + pre21ExplodeEventConstructor = BlockExplodeEvent.class.getConstructor(Block.class, List.class, float.class); + } catch (Exception e) { + Slimefun.logger().log(Level.SEVERE, "Could not find constructor for BlockExplodeEvent", e); + } + } + } + @ParametersAreNonnullByDefault public ExplosiveTool(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { super(itemGroup, item, recipeType, recipe); @@ -78,7 +93,7 @@ private void breakBlocks(BlockBreakEvent e, Player p, ItemStack item, Block b, L List blocksToDestroy = new ArrayList<>(); if (callExplosionEvent.getValue()) { - BlockExplodeEvent blockExplodeEvent = new BlockExplodeEvent(b, blocks, 0); + BlockExplodeEvent blockExplodeEvent = createNewBlockExplodeEvent(b, blocks, 0); Bukkit.getServer().getPluginManager().callEvent(blockExplodeEvent); if (!blockExplodeEvent.isCancelled()) { @@ -186,4 +201,24 @@ private void breakBlock(BlockBreakEvent e, Player p, ItemStack item, Block b, Li damageItem(p, item); } + private BlockExplodeEvent createNewBlockExplodeEvent( + Block block, + List blocks, + float yield + ) { + var version = Slimefun.getMinecraftVersion(); + if (version.isAtLeast(MinecraftVersion.MINECRAFT_1_21)) { + return new BlockExplodeEvent(block, block.getState(), blocks, yield, ExplosionResult.DESTROY); + } else if (pre21ExplodeEventConstructor != null) { + try { + return (BlockExplodeEvent) pre21ExplodeEventConstructor.newInstance(block, blocks, yield); + } catch (Exception e) { + Slimefun.logger().log(Level.SEVERE, "Could not find constructor for BlockExplodeEvent", e); + } + + return null; + } else { + throw new IllegalStateException("BlockExplodeEvent constructor not found"); + } + } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/GoldPan.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/GoldPan.java index 08f69ec27a..e8bd5c99d6 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/GoldPan.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/GoldPan.java @@ -91,7 +91,7 @@ public Material getInputMaterial() { settings.add(new GoldPanDrop(this, "chance.FLINT", 40, new ItemStack(Material.FLINT))); settings.add(new GoldPanDrop(this, "chance.CLAY", 20, new ItemStack(Material.CLAY_BALL))); - settings.add(new GoldPanDrop(this, "chance.SIFTED_ORE", 35, SlimefunItems.SIFTED_ORE)); + settings.add(new GoldPanDrop(this, "chance.SIFTED_ORE", 35, SlimefunItems.SIFTED_ORE.item())); settings.add(new GoldPanDrop(this, "chance.IRON_NUGGET", 5, new ItemStack(Material.IRON_NUGGET))); return settings; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/PickaxeOfVeinMining.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/PickaxeOfVeinMining.java index 4cae8ed99d..41a293a7f3 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/PickaxeOfVeinMining.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/PickaxeOfVeinMining.java @@ -28,7 +28,7 @@ /** * The {@link PickaxeOfVeinMining} is a powerful tool which allows you to mine an entire vein of ores * at once. It even works with the fortune {@link Enchantment}. - * + * * @author TheBusyBiscuit * @author Linox * @@ -63,7 +63,7 @@ private void breakBlocks(Player p, List blocks, int fortune, ItemStack to b.getWorld().dropItemNaturally(b.getLocation(), new ItemStack(b.getType())); } else { for (ItemStack drop : b.getDrops(tool)) { - b.getWorld().dropItemNaturally(b.getLocation(), drop.getType().isBlock() ? drop : new CustomItemStack(drop, fortune)); + b.getWorld().dropItemNaturally(b.getLocation(), drop.getType().isBlock() ? drop : CustomItemStack.create(drop, fortune)); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/AncientAltarListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/AncientAltarListener.java index bf06243d86..81b66442a3 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/AncientAltarListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/AncientAltarListener.java @@ -48,7 +48,7 @@ /** * This {@link Listener} is responsible for providing the core mechanics of the {@link AncientAltar} * and the {@link AncientPedestal}, it also handles the crafting of items using the Altar. - * + * * @author Redemption198 * @author TheBusyBiscuit * @@ -73,7 +73,7 @@ public AncientAltarListener(Slimefun plugin, AncientAltar altar, AncientPedestal /** * This returns all {@link AncientAltar Altars} that are currently in use. - * + * * @return A {@link Set} of every {@link AncientAltar} currently in use */ public @Nonnull Set getAltarsInUse() { @@ -179,7 +179,7 @@ private void useAltar(@Nonnull Block altar, @Nonnull Player p) { return; } - ItemStack catalyst = new CustomItemStack(p.getInventory().getItemInMainHand(), 1); + ItemStack catalyst = CustomItemStack.create(p.getInventory().getItemInMainHand(), 1); List pedestals = getPedestals(altar); if (!altars.contains(altar)) { @@ -316,8 +316,8 @@ public void onBlockPlace(BlockPlaceEvent e) { ItemStackWrapper wrapper = ItemStackWrapper.wrap(catalyst); List items = ItemStackWrapper.wrapList(inputs); - if (SlimefunUtils.isItemSimilar(wrapper, SlimefunItems.BROKEN_SPAWNER, false, false)) { - if (!checkRecipe(SlimefunItems.BROKEN_SPAWNER, items).isPresent()) { + if (SlimefunUtils.isItemSimilar(wrapper, SlimefunItems.BROKEN_SPAWNER.item(), false, false)) { + if (!checkRecipe(SlimefunItems.BROKEN_SPAWNER.item(), items).isPresent()) { return Optional.empty(); } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BackpackListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BackpackListener.java index 135d2682c2..cb6b5ce070 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BackpackListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BackpackListener.java @@ -1,5 +1,6 @@ package io.github.thebusybiscuit.slimefun4.implementation.listeners; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/DeathpointListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/DeathpointListener.java index 200c24b9e2..fe81796953 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/DeathpointListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/DeathpointListener.java @@ -35,7 +35,7 @@ public DeathpointListener(@Nonnull Slimefun plugin) { public void onDeath(PlayerDeathEvent e) { Player p = e.getEntity(); - if (SlimefunUtils.containsSimilarItem(p.getInventory(), SlimefunItems.GPS_EMERGENCY_TRANSMITTER, true)) { + if (SlimefunUtils.containsSimilarItem(p.getInventory(), SlimefunItems.GPS_EMERGENCY_TRANSMITTER.item(), true)) { Slimefun.getGPSNetwork().addWaypoint(p, "player:death " + Slimefun.getLocalization().getMessage(p, "gps.deathpoint").replace("%date%", format.format(LocalDateTime.now())), p.getLocation().getBlock().getLocation()); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/DebugFishListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/DebugFishListener.java index 37cb3116d6..6bcbffd93b 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/DebugFishListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/DebugFishListener.java @@ -61,7 +61,7 @@ public void onDebug(PlayerInteractEvent e) { Player p = e.getPlayer(); - if (SlimefunUtils.isItemSimilar(e.getItem(), SlimefunItems.DEBUG_FISH, true, false)) { + if (SlimefunUtils.isItemSimilar(e.getItem(), SlimefunItems.DEBUG_FISH.item(), true, false)) { e.setCancelled(true); if (p.hasPermission("slimefun.debugging")) { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/GadgetsListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/GadgetsListener.java index 784f520245..2b38db7769 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/GadgetsListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/GadgetsListener.java @@ -55,7 +55,7 @@ public void onToggleSneak(PlayerToggleSneakEvent e) { handleBoots(p, boots); } - if (SlimefunUtils.containsSimilarItem(p.getInventory(), SlimefunItems.INFUSED_MAGNET, true)) { + if (SlimefunUtils.containsSimilarItem(p.getInventory(), SlimefunItems.INFUSED_MAGNET.item(), true)) { InfusedMagnet magnet = (InfusedMagnet) SlimefunItems.INFUSED_MAGNET.getItem(); if (magnet.canUse(p, true)) { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/GrapplingHookEntity.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/GrapplingHookEntity.java index f4572f3a45..13aac08291 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/GrapplingHookEntity.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/GrapplingHookEntity.java @@ -35,7 +35,7 @@ public Arrow getArrow() { public void drop(@Nonnull Location l) { // If a grappling hook was consumed, drop one grappling hook on the floor if (dropItem && wasConsumed) { - Item item = l.getWorld().dropItem(l, SlimefunItems.GRAPPLING_HOOK.clone()); + Item item = l.getWorld().dropItem(l, SlimefunItems.GRAPPLING_HOOK.item()); item.setPickupDelay(16); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/SlimefunItemInteractListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/SlimefunItemInteractListener.java index fd776e1baa..ce3f951743 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/SlimefunItemInteractListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/SlimefunItemInteractListener.java @@ -53,7 +53,7 @@ public SlimefunItemInteractListener(@Nonnull Slimefun plugin) { public void onRightClick(PlayerInteractEvent e) { if (e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK) { // Exclude the Debug Fish here because it is handled in a seperate Listener - if (SlimefunUtils.isItemSimilar(e.getItem(), SlimefunItems.DEBUG_FISH, true)) { + if (SlimefunUtils.isItemSimilar(e.getItem(), SlimefunItems.DEBUG_FISH.item(), true)) { return; } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TalismanListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TalismanListener.java index 7a8b29c0df..893fb0ab75 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TalismanListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TalismanListener.java @@ -55,13 +55,13 @@ /** * This {@link Listener} is responsible for handling any {@link Event} * that is required for activating a {@link Talisman}. - * + * * @author TheBusyBiscuit * @author StarWishsama * @author svr333 * @author martinbrom * @author Sfiguz7 - * + * * @see Talisman * */ @@ -124,7 +124,7 @@ private void onProjectileDamage(@Nonnull EntityDamageByEntityEvent e) { /** * This method is used for the {@link Talisman} of the whirlwind, it returns a copy * of a {@link Projectile} that was fired at a {@link Player}. - * + * * @param p * The {@link Player} who was hit * @param projectile @@ -210,7 +210,7 @@ private Collection getExtraDrops(LivingEntity entity, Collection biomes; NetherIceResource() { - super("nether_ice", "Nether Ice", SlimefunItems.NETHER_ICE, 6, true); + super("nether_ice", "Nether Ice", SlimefunItems.NETHER_ICE.item(), 6, true); biomes = getBiomeMap(this, "/biome-maps/nether_ice_v1.16.json"); } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/OilResource.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/OilResource.java index 55e5bbd117..0407e65ec8 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/OilResource.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/OilResource.java @@ -28,7 +28,7 @@ class OilResource extends AbstractResource { private final BiomeMap biomes; OilResource() { - super("oil", "Oil", SlimefunItems.OIL_BUCKET, 8, false); + super("oil", "Oil", SlimefunItems.OIL_BUCKET.item(), 8, false); MinecraftVersion version = Slimefun.getMinecraftVersion(); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/SaltResource.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/SaltResource.java index 0d6f1630a2..32a6294885 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/SaltResource.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/SaltResource.java @@ -23,7 +23,7 @@ class SaltResource extends AbstractResource { private final BiomeMap biomes; SaltResource() { - super("salt", "Salt", SlimefunItems.SALT, 18, true); + super("salt", "Salt", SlimefunItems.SALT.item(), 18, true); MinecraftVersion version = Slimefun.getMinecraftVersion(); if (version.isAtLeast(MinecraftVersion.MINECRAFT_1_18)) { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/UraniumResource.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/UraniumResource.java index ef4ffba76e..9791258c20 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/UraniumResource.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/resources/UraniumResource.java @@ -22,7 +22,7 @@ class UraniumResource extends AbstractResource { private final BiomeMap biomes; UraniumResource() { - super("uranium", "Small Chunks of Uranium", SlimefunItems.SMALL_URANIUM, 2, true); + super("uranium", "Small Chunks of Uranium", SlimefunItems.SMALL_URANIUM.item(), 2, true); MinecraftVersion version = Slimefun.getMinecraftVersion(); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/DefaultItemGroups.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/DefaultItemGroups.java index 3dd32ac4e9..3d23b19dce 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/DefaultItemGroups.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/DefaultItemGroups.java @@ -33,36 +33,36 @@ class DefaultItemGroups { // Standard Item Groups - protected final ItemGroup weapons = new ItemGroup(new NamespacedKey(Slimefun.instance(), "weapons"), new CustomItemStack(SlimefunItems.BLADE_OF_VAMPIRES, "&7Weapons"), 1); - protected final ItemGroup tools = new ItemGroup(new NamespacedKey(Slimefun.instance(), "tools"), new CustomItemStack(SlimefunItems.SMELTERS_PICKAXE, "&7Tools"), 1); - protected final ItemGroup usefulItems = new ItemGroup(new NamespacedKey(Slimefun.instance(), "items"), new CustomItemStack(SlimefunItems.BACKPACK_MEDIUM, "&7Useful Items"), 1); - protected final ItemGroup basicMachines = new ItemGroup(new NamespacedKey(Slimefun.instance(), "basic_machines"), new CustomItemStack(SlimefunItems.ENHANCED_CRAFTING_TABLE, "&7Basic Machines"), 1); - protected final ItemGroup food = new ItemGroup(new NamespacedKey(Slimefun.instance(), "food"), new CustomItemStack(SlimefunItems.FORTUNE_COOKIE, "&7Food"), 2); - protected final ItemGroup armor = new ItemGroup(new NamespacedKey(Slimefun.instance(), "armor"), new CustomItemStack(SlimefunItems.DAMASCUS_STEEL_CHESTPLATE, "&7Armor"), 2); + protected final ItemGroup weapons = new ItemGroup(new NamespacedKey(Slimefun.instance(), "weapons"), CustomItemStack.create(SlimefunItems.BLADE_OF_VAMPIRES.item(), "&7Weapons"), 1); + protected final ItemGroup tools = new ItemGroup(new NamespacedKey(Slimefun.instance(), "tools"), CustomItemStack.create(SlimefunItems.SMELTERS_PICKAXE.item(), "&7Tools"), 1); + protected final ItemGroup usefulItems = new ItemGroup(new NamespacedKey(Slimefun.instance(), "items"), CustomItemStack.create(SlimefunItems.BACKPACK_MEDIUM.item(), "&7Useful Items"), 1); + protected final ItemGroup basicMachines = new ItemGroup(new NamespacedKey(Slimefun.instance(), "basic_machines"), CustomItemStack.create(SlimefunItems.ENHANCED_CRAFTING_TABLE.item(), "&7Basic Machines"), 1); + protected final ItemGroup food = new ItemGroup(new NamespacedKey(Slimefun.instance(), "food"), CustomItemStack.create(SlimefunItems.FORTUNE_COOKIE.item(), "&7Food"), 2); + protected final ItemGroup armor = new ItemGroup(new NamespacedKey(Slimefun.instance(), "armor"), CustomItemStack.create(SlimefunItems.DAMASCUS_STEEL_CHESTPLATE.item(), "&7Armor"), 2); // Magical - protected final ItemGroup magicalResources = new ItemGroup(new NamespacedKey(Slimefun.instance(), "magical_items"), new CustomItemStack(SlimefunItems.ENDER_RUNE, "&7Magical Items"), 2); - protected final ItemGroup magicalGadgets = new ItemGroup(new NamespacedKey(Slimefun.instance(), "magical_gadgets"), new CustomItemStack(SlimefunItems.INFUSED_ELYTRA, "&7Magical Gadgets"), 3); - protected final ItemGroup magicalArmor = new ItemGroup(new NamespacedKey(Slimefun.instance(), "magical_armor"), new CustomItemStack(SlimefunItems.ENDER_HELMET, "&7Magical Armor"), 2); + protected final ItemGroup magicalResources = new ItemGroup(new NamespacedKey(Slimefun.instance(), "magical_items"), CustomItemStack.create(SlimefunItems.ENDER_RUNE.item(), "&7Magical Items"), 2); + protected final ItemGroup magicalGadgets = new ItemGroup(new NamespacedKey(Slimefun.instance(), "magical_gadgets"), CustomItemStack.create(SlimefunItems.INFUSED_ELYTRA.item(), "&7Magical Gadgets"), 3); + protected final ItemGroup magicalArmor = new ItemGroup(new NamespacedKey(Slimefun.instance(), "magical_armor"), CustomItemStack.create(SlimefunItems.ENDER_HELMET.item(), "&7Magical Armor"), 2); // Resources and tech stuff - protected final ItemGroup misc = new ItemGroup(new NamespacedKey(Slimefun.instance(), "misc"), new CustomItemStack(SlimefunItems.TIN_CAN, "&7Miscellaneous"), 2); - protected final ItemGroup technicalComponents = new ItemGroup(new NamespacedKey(Slimefun.instance(), "tech_misc"), new CustomItemStack(SlimefunItems.HEATING_COIL, "&7Technical Components"), 2); - protected final ItemGroup technicalGadgets = new ItemGroup(new NamespacedKey(Slimefun.instance(), "technical_gadgets"), new CustomItemStack(SlimefunItems.STEEL_JETPACK, "&7Technical Gadgets"), 3); - protected final ItemGroup resources = new ItemGroup(new NamespacedKey(Slimefun.instance(), "resources"), new CustomItemStack(SlimefunItems.SYNTHETIC_SAPPHIRE, "&7Resources"), 1); + protected final ItemGroup misc = new ItemGroup(new NamespacedKey(Slimefun.instance(), "misc"), CustomItemStack.create(SlimefunItems.TIN_CAN.item(), "&7Miscellaneous"), 2); + protected final ItemGroup technicalComponents = new ItemGroup(new NamespacedKey(Slimefun.instance(), "tech_misc"), CustomItemStack.create(SlimefunItems.HEATING_COIL.item(), "&7Technical Components"), 2); + protected final ItemGroup technicalGadgets = new ItemGroup(new NamespacedKey(Slimefun.instance(), "technical_gadgets"), CustomItemStack.create(SlimefunItems.STEEL_JETPACK.item(), "&7Technical Gadgets"), 3); + protected final ItemGroup resources = new ItemGroup(new NamespacedKey(Slimefun.instance(), "resources"), CustomItemStack.create(SlimefunItems.SYNTHETIC_SAPPHIRE.item(), "&7Resources"), 1); // Locked Item Groups - protected final LockedItemGroup electricity = new LockedItemGroup(new NamespacedKey(Slimefun.instance(), "electricity"), new CustomItemStack(SlimefunItems.NUCLEAR_REACTOR, "&bEnergy and Electricity"), 4, basicMachines.getKey()); - protected final LockedItemGroup androids = new LockedItemGroup(new NamespacedKey(Slimefun.instance(), "androids"), new CustomItemStack(SlimefunItems.PROGRAMMABLE_ANDROID, "&cProgrammable Androids"), 4, basicMachines.getKey()); - protected final ItemGroup cargo = new LockedItemGroup(new NamespacedKey(Slimefun.instance(), "cargo"), new CustomItemStack(SlimefunItems.CARGO_MANAGER, "&cCargo Management"), 4, basicMachines.getKey()); - protected final LockedItemGroup gps = new LockedItemGroup(new NamespacedKey(Slimefun.instance(), "gps"), new CustomItemStack(SlimefunItems.GPS_TRANSMITTER, "&bGPS-based Machines"), 4, basicMachines.getKey()); + protected final LockedItemGroup electricity = new LockedItemGroup(new NamespacedKey(Slimefun.instance(), "electricity"), CustomItemStack.create(SlimefunItems.NUCLEAR_REACTOR.item(), "&bEnergy and Electricity"), 4, basicMachines.getKey()); + protected final LockedItemGroup androids = new LockedItemGroup(new NamespacedKey(Slimefun.instance(), "androids"), CustomItemStack.create(SlimefunItems.PROGRAMMABLE_ANDROID.item(), "&cProgrammable Androids"), 4, basicMachines.getKey()); + protected final ItemGroup cargo = new LockedItemGroup(new NamespacedKey(Slimefun.instance(), "cargo"), CustomItemStack.create(SlimefunItems.CARGO_MANAGER.item(), "&cCargo Management"), 4, basicMachines.getKey()); + protected final LockedItemGroup gps = new LockedItemGroup(new NamespacedKey(Slimefun.instance(), "gps"), CustomItemStack.create(SlimefunItems.GPS_TRANSMITTER.item(), "&bGPS-based Machines"), 4, basicMachines.getKey()); // Seasonal Item Groups - protected final SeasonalItemGroup christmas = new SeasonalItemGroup(new NamespacedKey(Slimefun.instance(), "christmas"), Month.DECEMBER, 1, new CustomItemStack(SlimefunUtils.getCustomHead("215ba31cde2671b8f176de6a9ffd008035f0590d63ee240be6e8921cd2037a45"), ChatUtils.christmas("Christmas") + " &7(December only)")); - protected final SeasonalItemGroup valentinesDay = new SeasonalItemGroup(new NamespacedKey(Slimefun.instance(), "valentines_day"), Month.FEBRUARY, 2, new CustomItemStack(SlimefunUtils.getCustomHead("55d89431d14bfef2060461b4a3565614dc51115c001fae2508e8684bc0ae6a80"), "&dValentine's Day" + " &7(14th February)")); - protected final SeasonalItemGroup easter = new SeasonalItemGroup(new NamespacedKey(Slimefun.instance(), "easter"), Month.APRIL, 2, new CustomItemStack(HeadTexture.EASTER_EGG.getAsItemStack(), "&6Easter" + " &7(April)")); - protected final SeasonalItemGroup birthday = new SeasonalItemGroup(new NamespacedKey(Slimefun.instance(), "birthday"), Month.OCTOBER, 1, new CustomItemStack(Material.FIREWORK_ROCKET, "&a&lTheBusyBiscuit's Birthday &7(26th October)")); - protected final SeasonalItemGroup halloween = new SeasonalItemGroup(new NamespacedKey(Slimefun.instance(), "halloween"), Month.OCTOBER, 1, new CustomItemStack(Material.JACK_O_LANTERN, "&6&lHalloween &7(31st October)")); + protected final SeasonalItemGroup christmas = new SeasonalItemGroup(new NamespacedKey(Slimefun.instance(), "christmas"), Month.DECEMBER, 1, CustomItemStack.create(SlimefunUtils.getCustomHead("215ba31cde2671b8f176de6a9ffd008035f0590d63ee240be6e8921cd2037a45"), ChatUtils.christmas("Christmas") + " &7(December only)")); + protected final SeasonalItemGroup valentinesDay = new SeasonalItemGroup(new NamespacedKey(Slimefun.instance(), "valentines_day"), Month.FEBRUARY, 2, CustomItemStack.create(SlimefunUtils.getCustomHead("55d89431d14bfef2060461b4a3565614dc51115c001fae2508e8684bc0ae6a80"), "&dValentine's Day" + " &7(14th February)")); + protected final SeasonalItemGroup easter = new SeasonalItemGroup(new NamespacedKey(Slimefun.instance(), "easter"), Month.APRIL, 2, CustomItemStack.create(HeadTexture.EASTER_EGG.getAsItemStack(), "&6Easter" + " &7(April)")); + protected final SeasonalItemGroup birthday = new SeasonalItemGroup(new NamespacedKey(Slimefun.instance(), "birthday"), Month.OCTOBER, 1, CustomItemStack.create(Material.FIREWORK_ROCKET, "&a&lTheBusyBiscuit's Birthday &7(26th October)")); + protected final SeasonalItemGroup halloween = new SeasonalItemGroup(new NamespacedKey(Slimefun.instance(), "halloween"), Month.OCTOBER, 1, CustomItemStack.create(Material.JACK_O_LANTERN, "&6&lHalloween &7(31st October)")); // Flex Item Groups protected final FlexItemGroup rickFlexGroup = new RickFlexGroup(new NamespacedKey(Slimefun.instance(), "rick")); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/ResearchSetup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/ResearchSetup.java index a3e3948837..0ad68ea14e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/ResearchSetup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/ResearchSetup.java @@ -2,6 +2,7 @@ import javax.annotation.ParametersAreNonnullByDefault; +import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack; import org.bukkit.NamespacedKey; import org.bukkit.inventory.ItemStack; @@ -10,6 +11,8 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import java.util.Arrays; + /** * This static setup class is used to register all default implementations of * {@link Research} on startup. @@ -291,6 +294,11 @@ public static void setupResearches() { register("rainbow_armor", 281, "I wanna see the rainbow high in the sky", 22, SlimefunItems.RAINBOW_HELMET, SlimefunItems.RAINBOW_CHESTPLATE, SlimefunItems.RAINBOW_LEGGINGS, SlimefunItems.RAINBOW_BOOTS); } + private static void register(String key, int id, String name, int defaultCost, SlimefunItemStack... items) { + ItemStack[] array = Arrays.stream(items).map(SlimefunItemStack::item).toArray(ItemStack[]::new); + register(key, id, name, defaultCost, array); + } + @ParametersAreNonnullByDefault private static void register(String key, int id, String name, int defaultCost, ItemStack... items) { Research research = new Research(new NamespacedKey(Slimefun.instance(), key), id, name, defaultCost); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/RickFlexGroup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/RickFlexGroup.java index 79949369cc..914a7b517f 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/RickFlexGroup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/RickFlexGroup.java @@ -17,7 +17,7 @@ /** * A super ordinary class. - * + * * @author TheBusyBiscuit * */ @@ -25,7 +25,7 @@ class RickFlexGroup extends FlexItemGroup { // Never instantiate more than once. RickFlexGroup(@Nonnull NamespacedKey key) { - super(key, new CustomItemStack(Material.NETHER_STAR, "&6&lSuper secret items"), 1); + super(key, CustomItemStack.create(Material.NETHER_STAR, "&6&lSuper secret items"), 1); } // Gonna override this method 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 16bfdc85a0..2448331bec 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 @@ -240,63 +240,63 @@ public static void setup(@Nonnull Slimefun plugin) { // @formatter:off (We will need to refactor this one day) new SlimefunItem(itemGroups.weapons, SlimefunItems.GRANDMAS_WALKING_STICK, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.OAK_LOG), null, null, new ItemStack(Material.OAK_LOG), null, null, new ItemStack(Material.OAK_LOG), null}) - .register(plugin); + new ItemStack[] {null, new ItemStack(Material.OAK_LOG), null, null, new ItemStack(Material.OAK_LOG), null, null, new ItemStack(Material.OAK_LOG), null}) + .register(plugin); new SlimefunItem(itemGroups.weapons, SlimefunItems.GRANDPAS_WALKING_STICK, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.LEATHER), new ItemStack(Material.OAK_LOG), new ItemStack(Material.LEATHER), null, new ItemStack(Material.OAK_LOG), null, null, new ItemStack(Material.OAK_LOG), null}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.LEATHER), new ItemStack(Material.OAK_LOG), new ItemStack(Material.LEATHER), null, new ItemStack(Material.OAK_LOG), null, null, new ItemStack(Material.OAK_LOG), null}) + .register(plugin); new PortableCrafter(itemGroups.usefulItems, SlimefunItems.PORTABLE_CRAFTER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.BOOK), new ItemStack(Material.CRAFTING_TABLE), null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.BOOK), new ItemStack(Material.CRAFTING_TABLE), null, null, null, null, null, null, null}) + .register(plugin); new FortuneCookie(itemGroups.food, SlimefunItems.FORTUNE_COOKIE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.COOKIE), new ItemStack(Material.PAPER), null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.COOKIE), new ItemStack(Material.PAPER), null, null, null, null, null, null, null}) + .register(plugin); new DietCookie(itemGroups.food, SlimefunItems.DIET_COOKIE, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {new ItemStack(Material.COOKIE), SlimefunItems.ELYTRA_SCALE, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.COOKIE), SlimefunItems.ELYTRA_SCALE.item(), null, null, null, null, null, null, null}) + .register(plugin); new OutputChest(itemGroups.basicMachines, SlimefunItems.OUTPUT_CHEST, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.LEAD_INGOT, new ItemStack(Material.HOPPER), SlimefunItems.LEAD_INGOT, SlimefunItems.LEAD_INGOT, new ItemStack(Material.CHEST), SlimefunItems.LEAD_INGOT, null, SlimefunItems.LEAD_INGOT, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.LEAD_INGOT.item(), new ItemStack(Material.HOPPER), SlimefunItems.LEAD_INGOT.item(), SlimefunItems.LEAD_INGOT.item(), new ItemStack(Material.CHEST), SlimefunItems.LEAD_INGOT.item(), null, SlimefunItems.LEAD_INGOT.item(), null}) + .register(plugin); new EnhancedCraftingTable(itemGroups.basicMachines, SlimefunItems.ENHANCED_CRAFTING_TABLE).register(plugin); new PortableDustbin(itemGroups.usefulItems, SlimefunItems.PORTABLE_DUSTBIN, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT), null, new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT)}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT), null, new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT)}) + .register(plugin); new MeatJerky(itemGroups.food, SlimefunItems.BEEF_JERKY, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.SALT, new ItemStack(Material.COOKED_BEEF), null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.SALT.item(), new ItemStack(Material.COOKED_BEEF), null, null, null, null, null, null, null}) + .register(plugin); new MeatJerky(itemGroups.food, SlimefunItems.PORK_JERKY, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.SALT, new ItemStack(Material.COOKED_PORKCHOP), null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.SALT.item(), new ItemStack(Material.COOKED_PORKCHOP), null, null, null, null, null, null, null}) + .register(plugin); new MeatJerky(itemGroups.food, SlimefunItems.CHICKEN_JERKY, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.SALT, new ItemStack(Material.COOKED_CHICKEN), null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.SALT.item(), new ItemStack(Material.COOKED_CHICKEN), null, null, null, null, null, null, null}) + .register(plugin); new MeatJerky(itemGroups.food, SlimefunItems.MUTTON_JERKY, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.SALT, new ItemStack(Material.COOKED_MUTTON), null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.SALT.item(), new ItemStack(Material.COOKED_MUTTON), null, null, null, null, null, null, null}) + .register(plugin); new MeatJerky(itemGroups.food, SlimefunItems.RABBIT_JERKY, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.SALT, new ItemStack(Material.COOKED_RABBIT), null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.SALT.item(), new ItemStack(Material.COOKED_RABBIT), null, null, null, null, null, null, null}) + .register(plugin); new MeatJerky(itemGroups.food, SlimefunItems.FISH_JERKY, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.SALT, new ItemStack(Material.COOKED_COD), null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.SALT.item(), new ItemStack(Material.COOKED_COD), null, null, null, null, null, null, null}) + .register(plugin); new SlimefunItem(itemGroups.food, SlimefunItems.KELP_COOKIE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.DRIED_KELP), null, new ItemStack(Material.DRIED_KELP), new ItemStack(Material.SUGAR), new ItemStack(Material.DRIED_KELP), null, new ItemStack(Material.DRIED_KELP), null}, - new SlimefunItemStack(SlimefunItems.KELP_COOKIE, 2)) - .register(plugin); + new ItemStack[] {null, new ItemStack(Material.DRIED_KELP), null, new ItemStack(Material.DRIED_KELP), new ItemStack(Material.SUGAR), new ItemStack(Material.DRIED_KELP), null, new ItemStack(Material.DRIED_KELP), null}, + new SlimefunItemStack(SlimefunItems.KELP_COOKIE, 2).item()) + .register(plugin); new GrindStone(itemGroups.basicMachines, SlimefunItems.GRIND_STONE).register(plugin); new ArmorForge(itemGroups.basicMachines, SlimefunItems.ARMOR_FORGE).register(plugin); @@ -307,536 +307,536 @@ public static void setup(@Nonnull Slimefun plugin) { new Compressor(itemGroups.basicMachines, SlimefunItems.COMPRESSOR).register(plugin); new SlimefunItem(itemGroups.magicalResources, SlimefunItems.MAGIC_LUMP_1, RecipeType.GRIND_STONE, - new ItemStack[] {new ItemStack(Material.NETHER_WART), null, null, null, null, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.MAGIC_LUMP_1, 2)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.NETHER_WART), null, null, null, null, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.MAGIC_LUMP_1, 2).item()) + .register(plugin); new SlimefunItem(itemGroups.magicalResources, SlimefunItems.MAGIC_LUMP_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_1, SlimefunItems.MAGIC_LUMP_1, null, SlimefunItems.MAGIC_LUMP_1, SlimefunItems.MAGIC_LUMP_1, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.MAGIC_LUMP_1.item(), SlimefunItems.MAGIC_LUMP_1.item(), null, SlimefunItems.MAGIC_LUMP_1.item(), SlimefunItems.MAGIC_LUMP_1.item(), null, null, null, null}) + .register(plugin); new SlimefunItem(itemGroups.magicalResources, SlimefunItems.MAGIC_LUMP_3, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_2, SlimefunItems.MAGIC_LUMP_2, null, SlimefunItems.MAGIC_LUMP_2, SlimefunItems.MAGIC_LUMP_2, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.MAGIC_LUMP_2.item(), SlimefunItems.MAGIC_LUMP_2.item(), null, SlimefunItems.MAGIC_LUMP_2.item(), SlimefunItems.MAGIC_LUMP_2.item(), null, null, null, null}) + .register(plugin); new SlimefunItem(itemGroups.magicalResources, SlimefunItems.ENDER_LUMP_1, RecipeType.GRIND_STONE, - new ItemStack[] {new ItemStack(Material.ENDER_EYE), null, null, null, null, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.ENDER_LUMP_1, 2)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.ENDER_EYE), null, null, null, null, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.ENDER_LUMP_1, 2).item()) + .register(plugin); new SlimefunItem(itemGroups.magicalResources, SlimefunItems.ENDER_LUMP_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.ENDER_LUMP_1, SlimefunItems.ENDER_LUMP_1, null, SlimefunItems.ENDER_LUMP_1, SlimefunItems.ENDER_LUMP_1, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.ENDER_LUMP_1.item(), SlimefunItems.ENDER_LUMP_1.item(), null, SlimefunItems.ENDER_LUMP_1.item(), SlimefunItems.ENDER_LUMP_1.item(), null, null, null, null}) + .register(plugin); new SlimefunItem(itemGroups.magicalResources, SlimefunItems.ENDER_LUMP_3, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.ENDER_LUMP_2, SlimefunItems.ENDER_LUMP_2, null, SlimefunItems.ENDER_LUMP_2, SlimefunItems.ENDER_LUMP_2, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.ENDER_LUMP_2.item(), SlimefunItems.ENDER_LUMP_2.item(), null, SlimefunItems.ENDER_LUMP_2.item(), SlimefunItems.ENDER_LUMP_2.item(), null, null, null, null}) + .register(plugin); new EnderBackpack(itemGroups.magicalGadgets, SlimefunItems.ENDER_BACKPACK, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {SlimefunItems.ENDER_LUMP_2, new ItemStack(Material.LEATHER), SlimefunItems.ENDER_LUMP_2, new ItemStack(Material.LEATHER), new ItemStack(Material.CHEST), new ItemStack(Material.LEATHER), SlimefunItems.ENDER_LUMP_2, new ItemStack(Material.LEATHER), SlimefunItems.ENDER_LUMP_2}) - .register(plugin); + new ItemStack[] {SlimefunItems.ENDER_LUMP_2.item(), new ItemStack(Material.LEATHER), SlimefunItems.ENDER_LUMP_2.item(), new ItemStack(Material.LEATHER), new ItemStack(Material.CHEST), new ItemStack(Material.LEATHER), SlimefunItems.ENDER_LUMP_2.item(), new ItemStack(Material.LEATHER), SlimefunItems.ENDER_LUMP_2.item()}) + .register(plugin); new SlimefunItem(itemGroups.magicalArmor, SlimefunItems.ENDER_HELMET, RecipeType.ARMOR_FORGE, - new ItemStack[] {SlimefunItems.ENDER_LUMP_1, new ItemStack(Material.ENDER_EYE), SlimefunItems.ENDER_LUMP_1, new ItemStack(Material.OBSIDIAN), null, new ItemStack(Material.OBSIDIAN), null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.ENDER_LUMP_1.item(), new ItemStack(Material.ENDER_EYE), SlimefunItems.ENDER_LUMP_1.item(), new ItemStack(Material.OBSIDIAN), null, new ItemStack(Material.OBSIDIAN), null, null, null}) + .register(plugin); new SlimefunItem(itemGroups.magicalArmor, SlimefunItems.ENDER_CHESTPLATE, RecipeType.ARMOR_FORGE, - new ItemStack[] {SlimefunItems.ENDER_LUMP_1, null, SlimefunItems.ENDER_LUMP_1, new ItemStack(Material.OBSIDIAN), new ItemStack(Material.ENDER_EYE), new ItemStack(Material.OBSIDIAN), new ItemStack(Material.OBSIDIAN), new ItemStack(Material.OBSIDIAN), new ItemStack(Material.OBSIDIAN)}) - .register(plugin); + new ItemStack[] {SlimefunItems.ENDER_LUMP_1.item(), null, SlimefunItems.ENDER_LUMP_1.item(), new ItemStack(Material.OBSIDIAN), new ItemStack(Material.ENDER_EYE), new ItemStack(Material.OBSIDIAN), new ItemStack(Material.OBSIDIAN), new ItemStack(Material.OBSIDIAN), new ItemStack(Material.OBSIDIAN)}) + .register(plugin); new SlimefunItem(itemGroups.magicalArmor, SlimefunItems.ENDER_LEGGINGS, RecipeType.ARMOR_FORGE, - new ItemStack[] {SlimefunItems.ENDER_LUMP_1, new ItemStack(Material.ENDER_EYE), SlimefunItems.ENDER_LUMP_1, new ItemStack(Material.OBSIDIAN), null, new ItemStack(Material.OBSIDIAN), new ItemStack(Material.OBSIDIAN), null, new ItemStack(Material.OBSIDIAN)}) - .register(plugin); + new ItemStack[] {SlimefunItems.ENDER_LUMP_1.item(), new ItemStack(Material.ENDER_EYE), SlimefunItems.ENDER_LUMP_1.item(), new ItemStack(Material.OBSIDIAN), null, new ItemStack(Material.OBSIDIAN), new ItemStack(Material.OBSIDIAN), null, new ItemStack(Material.OBSIDIAN)}) + .register(plugin); new EnderBoots(itemGroups.magicalArmor, SlimefunItems.ENDER_BOOTS, RecipeType.ARMOR_FORGE, - new ItemStack[] {null, null, null, SlimefunItems.ENDER_LUMP_1, null, SlimefunItems.ENDER_LUMP_1, new ItemStack(Material.OBSIDIAN), null, new ItemStack(Material.OBSIDIAN)}) - .register(plugin); + new ItemStack[] {null, null, null, SlimefunItems.ENDER_LUMP_1.item(), null, SlimefunItems.ENDER_LUMP_1.item(), new ItemStack(Material.OBSIDIAN), null, new ItemStack(Material.OBSIDIAN)}) + .register(plugin); new MagicEyeOfEnder(itemGroups.magicalGadgets, SlimefunItems.MAGIC_EYE_OF_ENDER, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {SlimefunItems.ENDER_LUMP_2, new ItemStack(Material.ENDER_PEARL), SlimefunItems.ENDER_LUMP_2, new ItemStack(Material.ENDER_PEARL), new ItemStack(Material.ENDER_EYE), new ItemStack(Material.ENDER_PEARL), SlimefunItems.ENDER_LUMP_2, new ItemStack(Material.ENDER_PEARL), SlimefunItems.ENDER_LUMP_2}) - .register(plugin); + new ItemStack[] {SlimefunItems.ENDER_LUMP_2.item(), new ItemStack(Material.ENDER_PEARL), SlimefunItems.ENDER_LUMP_2.item(), new ItemStack(Material.ENDER_PEARL), new ItemStack(Material.ENDER_EYE), new ItemStack(Material.ENDER_PEARL), SlimefunItems.ENDER_LUMP_2.item(), new ItemStack(Material.ENDER_PEARL), SlimefunItems.ENDER_LUMP_2.item()}) + .register(plugin); new MagicSugar(itemGroups.food, SlimefunItems.MAGIC_SUGAR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.SUGAR), new ItemStack(Material.REDSTONE), new ItemStack(Material.GLOWSTONE_DUST), null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.SUGAR), new ItemStack(Material.REDSTONE), new ItemStack(Material.GLOWSTONE_DUST), null, null, null, null, null, null}) + .register(plugin); new MonsterJerky(itemGroups.food, SlimefunItems.MONSTER_JERKY, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.SALT, new ItemStack(Material.ROTTEN_FLESH), null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.SALT.item(), new ItemStack(Material.ROTTEN_FLESH), null, null, null, null, null, null, null}) + .register(plugin); new SlimefunArmorPiece(itemGroups.magicalArmor, SlimefunItems.SLIME_HELMET, RecipeType.ARMOR_FORGE, - new ItemStack[] {new ItemStack(Material.SLIME_BALL), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.SLIME_BALL), new ItemStack(Material.IRON_INGOT), null, new ItemStack(Material.IRON_INGOT), null, null, null}, null) - .register(plugin); + new ItemStack[] {new ItemStack(Material.SLIME_BALL), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.SLIME_BALL), new ItemStack(Material.IRON_INGOT), null, new ItemStack(Material.IRON_INGOT), null, null, null}, null) + .register(plugin); new SlimefunArmorPiece(itemGroups.magicalArmor, SlimefunItems.SLIME_CHESTPLATE, RecipeType.ARMOR_FORGE, - new ItemStack[] {new ItemStack(Material.SLIME_BALL), null, new ItemStack(Material.SLIME_BALL), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.SLIME_BALL), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.SLIME_BALL), new ItemStack(Material.IRON_INGOT)}, null) - .register(plugin); + new ItemStack[] {new ItemStack(Material.SLIME_BALL), null, new ItemStack(Material.SLIME_BALL), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.SLIME_BALL), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.SLIME_BALL), new ItemStack(Material.IRON_INGOT)}, null) + .register(plugin); new SlimefunArmorPiece(itemGroups.magicalArmor, SlimefunItems.SLIME_LEGGINGS, RecipeType.ARMOR_FORGE, - new ItemStack[] {new ItemStack(Material.SLIME_BALL), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.SLIME_BALL), new ItemStack(Material.IRON_INGOT), null, new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT), null, new ItemStack(Material.IRON_INGOT)}, - new PotionEffect[] {new PotionEffect(PotionEffectType.SPEED, 300, 2)}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.SLIME_BALL), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.SLIME_BALL), new ItemStack(Material.IRON_INGOT), null, new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT), null, new ItemStack(Material.IRON_INGOT)}, + new PotionEffect[] {new PotionEffect(PotionEffectType.SPEED, 300, 2)}) + .register(plugin); new LongFallBoots(itemGroups.magicalArmor, SlimefunItems.SLIME_BOOTS, RecipeType.ARMOR_FORGE, - new ItemStack[] {null, null, null, new ItemStack(Material.SLIME_BALL), null, new ItemStack(Material.SLIME_BALL), new ItemStack(Material.IRON_INGOT), null, new ItemStack(Material.IRON_INGOT)}, - new PotionEffect[] {new PotionEffect(VersionedPotionEffectType.JUMP_BOOST, 300, 5)}, - SoundEffect.SLIME_BOOTS_FALL_SOUND) - .register(plugin); + new ItemStack[] {null, null, null, new ItemStack(Material.SLIME_BALL), null, new ItemStack(Material.SLIME_BALL), new ItemStack(Material.IRON_INGOT), null, new ItemStack(Material.IRON_INGOT)}, + new PotionEffect[] {new PotionEffect(VersionedPotionEffectType.JUMP_BOOST, 300, 5)}, + SoundEffect.SLIME_BOOTS_FALL_SOUND) + .register(plugin); new SwordOfBeheading(itemGroups.weapons, SlimefunItems.SWORD_OF_BEHEADING, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.EMERALD), null, SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.EMERALD), SlimefunItems.MAGIC_LUMP_2, null, new ItemStack(Material.BLAZE_ROD), null}) - .register(plugin); + new ItemStack[] {null, new ItemStack(Material.EMERALD), null, SlimefunItems.MAGIC_LUMP_2.item(), new ItemStack(Material.EMERALD), SlimefunItems.MAGIC_LUMP_2.item(), null, new ItemStack(Material.BLAZE_ROD), null}) + .register(plugin); new SlimefunItem(itemGroups.magicalResources, SlimefunItems.MAGICAL_BOOK_COVER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.MAGIC_LUMP_2, null, SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.BOOK), SlimefunItems.MAGIC_LUMP_2, null, SlimefunItems.MAGIC_LUMP_2, null}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.MAGIC_LUMP_2.item(), null, SlimefunItems.MAGIC_LUMP_2.item(), new ItemStack(Material.BOOK), SlimefunItems.MAGIC_LUMP_2.item(), null, SlimefunItems.MAGIC_LUMP_2.item(), null}) + .register(plugin); new UnplaceableBlock(itemGroups.magicalResources, SlimefunItems.MAGICAL_GLASS, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_2, SlimefunItems.GOLD_DUST, SlimefunItems.MAGIC_LUMP_2, SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE, new ItemStack(Material.GLASS_PANE), SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE, SlimefunItems.MAGIC_LUMP_2, SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE, SlimefunItems.MAGIC_LUMP_2}) - .register(plugin); + new ItemStack[] {SlimefunItems.MAGIC_LUMP_2.item(), SlimefunItems.GOLD_DUST.item(), SlimefunItems.MAGIC_LUMP_2.item(), SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE.item(), new ItemStack(Material.GLASS_PANE), SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE.item(), SlimefunItems.MAGIC_LUMP_2.item(), SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE.item(), SlimefunItems.MAGIC_LUMP_2.item()}) + .register(plugin); new BasicCircuitBoard(itemGroups.technicalComponents, SlimefunItems.BASIC_CIRCUIT_BOARD, RecipeType.MOB_DROP, - new ItemStack[] {null, null, null, null, new CustomItemStack(SlimefunUtils.getCustomHead(HeadTexture.IRON_GOLEM.getTexture()), "&aIron Golem"), null, null, null, null}) - .register(plugin); + new ItemStack[] {null, null, null, null, CustomItemStack.create(SlimefunUtils.getCustomHead(HeadTexture.IRON_GOLEM.getTexture()), "&aIron Golem"), null, null, null, null}) + .register(plugin); new UnplaceableBlock(itemGroups.technicalComponents, SlimefunItems.ADVANCED_CIRCUIT_BOARD, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.LAPIS_BLOCK), new ItemStack(Material.LAPIS_BLOCK), new ItemStack(Material.LAPIS_BLOCK), new ItemStack(Material.REDSTONE_BLOCK), SlimefunItems.BASIC_CIRCUIT_BOARD, new ItemStack(Material.REDSTONE_BLOCK), new ItemStack(Material.LAPIS_BLOCK), new ItemStack(Material.LAPIS_BLOCK), new ItemStack(Material.LAPIS_BLOCK)}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.LAPIS_BLOCK), new ItemStack(Material.LAPIS_BLOCK), new ItemStack(Material.LAPIS_BLOCK), new ItemStack(Material.REDSTONE_BLOCK), SlimefunItems.BASIC_CIRCUIT_BOARD.item(), new ItemStack(Material.REDSTONE_BLOCK), new ItemStack(Material.LAPIS_BLOCK), new ItemStack(Material.LAPIS_BLOCK), new ItemStack(Material.LAPIS_BLOCK)}) + .register(plugin); new GoldPan(itemGroups.tools, SlimefunItems.GOLD_PAN, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, null, null, new ItemStack(Material.STONE), new ItemStack(Material.BOWL), new ItemStack(Material.STONE), new ItemStack(Material.STONE), new ItemStack(Material.STONE), new ItemStack(Material.STONE)}) - .register(plugin); + new ItemStack[] {null, null, null, new ItemStack(Material.STONE), new ItemStack(Material.BOWL), new ItemStack(Material.STONE), new ItemStack(Material.STONE), new ItemStack(Material.STONE), new ItemStack(Material.STONE)}) + .register(plugin); new NetherGoldPan(itemGroups.tools, SlimefunItems.NETHER_GOLD_PAN, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, null, null, new ItemStack(Material.NETHER_BRICK), SlimefunItems.GOLD_PAN, new ItemStack(Material.NETHER_BRICK), new ItemStack(Material.NETHER_BRICK), new ItemStack(Material.NETHER_BRICK), new ItemStack(Material.NETHER_BRICK)}) - .register(plugin); + new ItemStack[] {null, null, null, new ItemStack(Material.NETHER_BRICK), SlimefunItems.GOLD_PAN.item(), new ItemStack(Material.NETHER_BRICK), new ItemStack(Material.NETHER_BRICK), new ItemStack(Material.NETHER_BRICK), new ItemStack(Material.NETHER_BRICK)}) + .register(plugin); new SlimefunItem(itemGroups.misc, SlimefunItems.SIFTED_ORE, RecipeType.GOLD_PAN, - new ItemStack[] {new ItemStack(Material.GRAVEL), null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.GRAVEL), null, null, null, null, null, null, null, null}) + .register(plugin); new MakeshiftSmeltery(itemGroups.basicMachines, SlimefunItems.MAKESHIFT_SMELTERY).register(plugin); new Smeltery(itemGroups.basicMachines, SlimefunItems.SMELTERY).register(plugin); new IgnitionChamber(itemGroups.basicMachines, SlimefunItems.IGNITION_CHAMBER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.IRON_INGOT), new ItemStack(Material.FLINT_AND_STEEL), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT), SlimefunItems.BASIC_CIRCUIT_BOARD, new ItemStack(Material.IRON_INGOT), null, new ItemStack(Material.OBSERVER), null}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.IRON_INGOT), new ItemStack(Material.FLINT_AND_STEEL), new ItemStack(Material.IRON_INGOT), new ItemStack(Material.IRON_INGOT), SlimefunItems.BASIC_CIRCUIT_BOARD.item(), new ItemStack(Material.IRON_INGOT), null, new ItemStack(Material.OBSERVER), null}) + .register(plugin); new PressureChamber(itemGroups.basicMachines, SlimefunItems.PRESSURE_CHAMBER).register(plugin); new UnplaceableBlock(itemGroups.technicalComponents, SlimefunItems.BATTERY, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.REDSTONE), null, SlimefunItems.ZINC_INGOT, SlimefunItems.SULFATE, SlimefunItems.COPPER_INGOT, SlimefunItems.ZINC_INGOT, SlimefunItems.SULFATE, SlimefunItems.COPPER_INGOT}) - .register(plugin); + new ItemStack[] {null, new ItemStack(Material.REDSTONE), null, SlimefunItems.ZINC_INGOT.item(), SlimefunItems.SULFATE.item(), SlimefunItems.COPPER_INGOT.item(), SlimefunItems.ZINC_INGOT.item(), SlimefunItems.SULFATE.item(), SlimefunItems.COPPER_INGOT.item()}) + .register(plugin); - registerArmorSet(itemGroups.magicalArmor, new ItemStack(Material.GLOWSTONE), new ItemStack[] {SlimefunItems.GLOWSTONE_HELMET, SlimefunItems.GLOWSTONE_CHESTPLATE, SlimefunItems.GLOWSTONE_LEGGINGS, SlimefunItems.GLOWSTONE_BOOTS}, "GLOWSTONE", false, - new PotionEffect[][] { - new PotionEffect[] {new PotionEffect(PotionEffectType.NIGHT_VISION, 600, 0)}, - new PotionEffect[] {new PotionEffect(PotionEffectType.NIGHT_VISION, 600, 0)}, - new PotionEffect[] {new PotionEffect(PotionEffectType.NIGHT_VISION, 600, 0)}, - new PotionEffect[] {new PotionEffect(PotionEffectType.NIGHT_VISION, 600, 0)} - }, plugin); + registerArmorSet(itemGroups.magicalArmor, new ItemStack(Material.GLOWSTONE), new ItemStack[] {SlimefunItems.GLOWSTONE_HELMET.item(), SlimefunItems.GLOWSTONE_CHESTPLATE.item(), SlimefunItems.GLOWSTONE_LEGGINGS.item(), SlimefunItems.GLOWSTONE_BOOTS.item()}, "GLOWSTONE", false, + new PotionEffect[][] { + new PotionEffect[] {new PotionEffect(PotionEffectType.NIGHT_VISION, 600, 0)}, + new PotionEffect[] {new PotionEffect(PotionEffectType.NIGHT_VISION, 600, 0)}, + new PotionEffect[] {new PotionEffect(PotionEffectType.NIGHT_VISION, 600, 0)}, + new PotionEffect[] {new PotionEffect(PotionEffectType.NIGHT_VISION, 600, 0)} + }, plugin); DyeColor[] rainbowArmorColors = { - DyeColor.RED, - DyeColor.ORANGE, - DyeColor.YELLOW, - DyeColor.LIME, - DyeColor.LIGHT_BLUE, - DyeColor.PURPLE, - DyeColor.MAGENTA + DyeColor.RED, + DyeColor.ORANGE, + DyeColor.YELLOW, + DyeColor.LIME, + DyeColor.LIGHT_BLUE, + DyeColor.PURPLE, + DyeColor.MAGENTA }; new RainbowArmorPiece(itemGroups.magicalArmor, SlimefunItems.RAINBOW_HELMET, RecipeType.ARMOR_FORGE, - new ItemStack[] { SlimefunItems.RAINBOW_LEATHER, SlimefunItems.RAINBOW_LEATHER, SlimefunItems.RAINBOW_LEATHER, SlimefunItems.RAINBOW_LEATHER, null, SlimefunItems.RAINBOW_LEATHER, null, null, null }, + new ItemStack[] { SlimefunItems.RAINBOW_LEATHER.item(), SlimefunItems.RAINBOW_LEATHER.item(), SlimefunItems.RAINBOW_LEATHER.item(), SlimefunItems.RAINBOW_LEATHER.item(), null, SlimefunItems.RAINBOW_LEATHER.item(), null, null, null }, rainbowArmorColors) .register(plugin); new RainbowArmorPiece(itemGroups.magicalArmor, SlimefunItems.RAINBOW_CHESTPLATE, RecipeType.ARMOR_FORGE, - new ItemStack[] { SlimefunItems.RAINBOW_LEATHER, null, SlimefunItems.RAINBOW_LEATHER, SlimefunItems.RAINBOW_LEATHER, SlimefunItems.RAINBOW_LEATHER, SlimefunItems.RAINBOW_LEATHER, SlimefunItems.RAINBOW_LEATHER, SlimefunItems.RAINBOW_LEATHER, SlimefunItems.RAINBOW_LEATHER }, + new ItemStack[] { SlimefunItems.RAINBOW_LEATHER.item(), null, SlimefunItems.RAINBOW_LEATHER.item(), SlimefunItems.RAINBOW_LEATHER.item(), SlimefunItems.RAINBOW_LEATHER.item(), SlimefunItems.RAINBOW_LEATHER.item(), SlimefunItems.RAINBOW_LEATHER.item(), SlimefunItems.RAINBOW_LEATHER.item(), SlimefunItems.RAINBOW_LEATHER.item() }, rainbowArmorColors) .register(plugin); new RainbowArmorPiece(itemGroups.magicalArmor, SlimefunItems.RAINBOW_LEGGINGS, RecipeType.ARMOR_FORGE, - new ItemStack[] { SlimefunItems.RAINBOW_LEATHER, SlimefunItems.RAINBOW_LEATHER, SlimefunItems.RAINBOW_LEATHER, SlimefunItems.RAINBOW_LEATHER, null, SlimefunItems.RAINBOW_LEATHER, SlimefunItems.RAINBOW_LEATHER, null, SlimefunItems.RAINBOW_LEATHER }, + new ItemStack[] { SlimefunItems.RAINBOW_LEATHER.item(), SlimefunItems.RAINBOW_LEATHER.item(), SlimefunItems.RAINBOW_LEATHER.item(), SlimefunItems.RAINBOW_LEATHER.item(), null, SlimefunItems.RAINBOW_LEATHER.item(), SlimefunItems.RAINBOW_LEATHER.item(), null, SlimefunItems.RAINBOW_LEATHER.item() }, rainbowArmorColors) .register(plugin); new RainbowArmorPiece(itemGroups.magicalArmor, SlimefunItems.RAINBOW_BOOTS, RecipeType.ARMOR_FORGE, - new ItemStack[] { null, null, null, SlimefunItems.RAINBOW_LEATHER, null, SlimefunItems.RAINBOW_LEATHER, SlimefunItems.RAINBOW_LEATHER, null, SlimefunItems.RAINBOW_LEATHER }, + new ItemStack[] { null, null, null, SlimefunItems.RAINBOW_LEATHER.item(), null, SlimefunItems.RAINBOW_LEATHER.item(), SlimefunItems.RAINBOW_LEATHER.item(), null, SlimefunItems.RAINBOW_LEATHER.item() }, rainbowArmorColors) .register(plugin); - registerArmorSet(itemGroups.armor, SlimefunItems.DAMASCUS_STEEL_INGOT, new ItemStack[] {SlimefunItems.DAMASCUS_STEEL_HELMET, SlimefunItems.DAMASCUS_STEEL_CHESTPLATE, SlimefunItems.DAMASCUS_STEEL_LEGGINGS, SlimefunItems.DAMASCUS_STEEL_BOOTS}, "DAMASCUS_STEEL", false, new PotionEffect[0][0], plugin); + registerArmorSet(itemGroups.armor, SlimefunItems.DAMASCUS_STEEL_INGOT, new ItemStack[] {SlimefunItems.DAMASCUS_STEEL_HELMET.item(), SlimefunItems.DAMASCUS_STEEL_CHESTPLATE.item(), SlimefunItems.DAMASCUS_STEEL_LEGGINGS.item(), SlimefunItems.DAMASCUS_STEEL_BOOTS.item()}, "DAMASCUS_STEEL", false, new PotionEffect[0][0], plugin); - registerArmorSet(itemGroups.armor, SlimefunItems.REINFORCED_ALLOY_INGOT, new ItemStack[] {SlimefunItems.REINFORCED_ALLOY_HELMET, SlimefunItems.REINFORCED_ALLOY_CHESTPLATE, SlimefunItems.REINFORCED_ALLOY_LEGGINGS, SlimefunItems.REINFORCED_ALLOY_BOOTS}, "REINFORCED_ALLOY", false, new PotionEffect[0][0], plugin); + registerArmorSet(itemGroups.armor, SlimefunItems.REINFORCED_ALLOY_INGOT, new ItemStack[] {SlimefunItems.REINFORCED_ALLOY_HELMET.item(), SlimefunItems.REINFORCED_ALLOY_CHESTPLATE.item(), SlimefunItems.REINFORCED_ALLOY_LEGGINGS.item(), SlimefunItems.REINFORCED_ALLOY_BOOTS.item()}, "REINFORCED_ALLOY", false, new PotionEffect[0][0], plugin); - registerArmorSet(itemGroups.armor, new ItemStack(Material.CACTUS), new ItemStack[] {SlimefunItems.CACTUS_HELMET, SlimefunItems.CACTUS_CHESTPLATE, SlimefunItems.CACTUS_LEGGINGS, SlimefunItems.CACTUS_BOOTS}, "CACTUS", false, new PotionEffect[0][0], plugin); + registerArmorSet(itemGroups.armor, new ItemStack(Material.CACTUS), new ItemStack[] {SlimefunItems.CACTUS_HELMET.item(), SlimefunItems.CACTUS_CHESTPLATE.item(), SlimefunItems.CACTUS_LEGGINGS.item(), SlimefunItems.CACTUS_BOOTS.item()}, "CACTUS", false, new PotionEffect[0][0], plugin); new AlloyIngot(itemGroups.resources, SlimefunItems.REINFORCED_ALLOY_INGOT, - new ItemStack[] {SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.HARDENED_METAL_INGOT, SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.SOLDER_INGOT, SlimefunItems.BILLON_INGOT, SlimefunItems.GOLD_24K, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.DAMASCUS_STEEL_INGOT.item(), SlimefunItems.HARDENED_METAL_INGOT.item(), SlimefunItems.CORINTHIAN_BRONZE_INGOT.item(), SlimefunItems.SOLDER_INGOT.item(), SlimefunItems.BILLON_INGOT.item(), SlimefunItems.GOLD_24K.item(), null, null, null}) + .register(plugin); new AlloyIngot(itemGroups.resources, SlimefunItems.HARDENED_METAL_INGOT, - new ItemStack[] {SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.DURALUMIN_INGOT, SlimefunItems.COMPRESSED_CARBON, SlimefunItems.ALUMINUM_BRONZE_INGOT, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.DAMASCUS_STEEL_INGOT.item(), SlimefunItems.DURALUMIN_INGOT.item(), SlimefunItems.COMPRESSED_CARBON.item(), SlimefunItems.ALUMINUM_BRONZE_INGOT.item(), null, null, null, null, null}) + .register(plugin); new AlloyIngot(itemGroups.resources, SlimefunItems.DAMASCUS_STEEL_INGOT, - new ItemStack[] {SlimefunItems.STEEL_INGOT, SlimefunItems.IRON_DUST, SlimefunItems.CARBON, new ItemStack(Material.IRON_INGOT), null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.STEEL_INGOT.item(), SlimefunItems.IRON_DUST.item(), SlimefunItems.CARBON.item(), new ItemStack(Material.IRON_INGOT), null, null, null, null, null}) + .register(plugin); new AlloyIngot(itemGroups.resources, SlimefunItems.STEEL_INGOT, - new ItemStack[] {SlimefunItems.IRON_DUST, SlimefunItems.CARBON, new ItemStack(Material.IRON_INGOT), null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.IRON_DUST.item(), SlimefunItems.CARBON.item(), new ItemStack(Material.IRON_INGOT), null, null, null, null, null, null}) + .register(plugin); new AlloyIngot(itemGroups.resources, SlimefunItems.BRONZE_INGOT, - new ItemStack[] {SlimefunItems.COPPER_DUST, SlimefunItems.TIN_DUST, SlimefunItems.COPPER_INGOT, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.COPPER_DUST.item(), SlimefunItems.TIN_DUST.item(), SlimefunItems.COPPER_INGOT.item(), null, null, null, null, null, null}) + .register(plugin); new AlloyIngot(itemGroups.resources, SlimefunItems.DURALUMIN_INGOT, - new ItemStack[] {SlimefunItems.ALUMINUM_DUST, SlimefunItems.COPPER_DUST, SlimefunItems.ALUMINUM_INGOT, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.ALUMINUM_DUST.item(), SlimefunItems.COPPER_DUST.item(), SlimefunItems.ALUMINUM_INGOT.item(), null, null, null, null, null, null}) + .register(plugin); new AlloyIngot(itemGroups.resources, SlimefunItems.BILLON_INGOT, - new ItemStack[] {SlimefunItems.SILVER_DUST, SlimefunItems.COPPER_DUST, SlimefunItems.SILVER_INGOT, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.SILVER_DUST.item(), SlimefunItems.COPPER_DUST.item(), SlimefunItems.SILVER_INGOT.item(), null, null, null, null, null, null}) + .register(plugin); new AlloyIngot(itemGroups.resources, SlimefunItems.BRASS_INGOT, - new ItemStack[] {SlimefunItems.COPPER_DUST, SlimefunItems.ZINC_DUST, SlimefunItems.COPPER_INGOT, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.COPPER_DUST.item(), SlimefunItems.ZINC_DUST.item(), SlimefunItems.COPPER_INGOT.item(), null, null, null, null, null, null}) + .register(plugin); new AlloyIngot(itemGroups.resources, SlimefunItems.ALUMINUM_BRASS_INGOT, - new ItemStack[] {SlimefunItems.ALUMINUM_DUST, SlimefunItems.BRASS_INGOT, SlimefunItems.ALUMINUM_INGOT, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.ALUMINUM_DUST.item(), SlimefunItems.BRASS_INGOT.item(), SlimefunItems.ALUMINUM_INGOT.item(), null, null, null, null, null, null}) + .register(plugin); new AlloyIngot(itemGroups.resources, SlimefunItems.ALUMINUM_BRONZE_INGOT, - new ItemStack[] {SlimefunItems.ALUMINUM_DUST, SlimefunItems.BRONZE_INGOT, SlimefunItems.ALUMINUM_INGOT, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.ALUMINUM_DUST.item(), SlimefunItems.BRONZE_INGOT.item(), SlimefunItems.ALUMINUM_INGOT.item(), null, null, null, null, null, null}) + .register(plugin); new AlloyIngot(itemGroups.resources, SlimefunItems.CORINTHIAN_BRONZE_INGOT, - new ItemStack[] {SlimefunItems.SILVER_DUST, SlimefunItems.GOLD_DUST, SlimefunItems.COPPER_DUST, SlimefunItems.BRONZE_INGOT, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.SILVER_DUST.item(), SlimefunItems.GOLD_DUST.item(), SlimefunItems.COPPER_DUST.item(), SlimefunItems.BRONZE_INGOT.item(), null, null, null, null, null}) + .register(plugin); new AlloyIngot(itemGroups.resources, SlimefunItems.SOLDER_INGOT, - new ItemStack[] {SlimefunItems.LEAD_DUST, SlimefunItems.TIN_DUST, SlimefunItems.LEAD_INGOT, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.LEAD_DUST.item(), SlimefunItems.TIN_DUST.item(), SlimefunItems.LEAD_INGOT.item(), null, null, null, null, null, null}) + .register(plugin); new SlimefunItem(itemGroups.resources, SlimefunItems.SYNTHETIC_SAPPHIRE, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.ALUMINUM_DUST, new ItemStack(Material.GLASS), new ItemStack(Material.GLASS_PANE), SlimefunItems.ALUMINUM_INGOT, new ItemStack(Material.LAPIS_LAZULI), null, null, null, null}) - .setUseableInWorkbench(true) - .register(plugin); + new ItemStack[] {SlimefunItems.ALUMINUM_DUST.item(), new ItemStack(Material.GLASS), new ItemStack(Material.GLASS_PANE), SlimefunItems.ALUMINUM_INGOT.item(), new ItemStack(Material.LAPIS_LAZULI), null, null, null, null}) + .setUseableInWorkbench(true) + .register(plugin); new SlimefunItem(itemGroups.resources, SlimefunItems.SYNTHETIC_DIAMOND, RecipeType.PRESSURE_CHAMBER, - new ItemStack[] {SlimefunItems.CARBON_CHUNK, null, null, null, null, null, null, null, null}) - .setUseableInWorkbench(true) - .register(plugin); + new ItemStack[] {SlimefunItems.CARBON_CHUNK.item(), null, null, null, null, null, null, null, null}) + .setUseableInWorkbench(true) + .register(plugin); new SlimefunItem(itemGroups.resources, SlimefunItems.RAW_CARBONADO, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.SYNTHETIC_DIAMOND, SlimefunItems.CARBON_CHUNK, new ItemStack(Material.GLASS_PANE), null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.SYNTHETIC_DIAMOND.item(), SlimefunItems.CARBON_CHUNK.item(), new ItemStack(Material.GLASS_PANE), null, null, null, null, null, null}) + .register(plugin); new AlloyIngot(itemGroups.resources, SlimefunItems.NICKEL_INGOT, - new ItemStack[] {SlimefunItems.IRON_DUST, new ItemStack(Material.IRON_INGOT), SlimefunItems.COPPER_DUST, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.IRON_DUST.item(), new ItemStack(Material.IRON_INGOT), SlimefunItems.COPPER_DUST.item(), null, null, null, null, null, null}) + .register(plugin); new AlloyIngot(itemGroups.resources, SlimefunItems.COBALT_INGOT, - new ItemStack[] {SlimefunItems.IRON_DUST, SlimefunItems.COPPER_DUST, SlimefunItems.NICKEL_INGOT, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.IRON_DUST.item(), SlimefunItems.COPPER_DUST.item(), SlimefunItems.NICKEL_INGOT.item(), null, null, null, null, null, null}) + .register(plugin); new SlimefunItem(itemGroups.resources, SlimefunItems.CARBONADO, RecipeType.PRESSURE_CHAMBER, - new ItemStack[] {SlimefunItems.RAW_CARBONADO, null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.RAW_CARBONADO.item(), null, null, null, null, null, null, null, null}) + .register(plugin); new SlimefunItem(itemGroups.resources, SlimefunItems.FERROSILICON, RecipeType.SMELTERY, - new ItemStack[] {new ItemStack(Material.IRON_INGOT), SlimefunItems.IRON_DUST, SlimefunItems.SILICON, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.IRON_INGOT), SlimefunItems.IRON_DUST.item(), SlimefunItems.SILICON.item(), null, null, null, null, null, null}) + .register(plugin); new SlimefunItem(itemGroups.resources, SlimefunItems.IRON_DUST, RecipeType.ORE_CRUSHER, - new ItemStack[] {new ItemStack(Material.IRON_ORE), null, null, null, null, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.IRON_DUST, oreCrusher.isOreDoublingEnabled() ? 2 : 1)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.IRON_ORE), null, null, null, null, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.IRON_DUST, oreCrusher.isOreDoublingEnabled() ? 2 : 1).item()) + .register(plugin); new SlimefunItem(itemGroups.resources, SlimefunItems.GOLD_DUST, RecipeType.ORE_CRUSHER, - new ItemStack[] {new ItemStack(Material.GOLD_ORE), null, null, null, null, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.GOLD_DUST, oreCrusher.isOreDoublingEnabled() ? 2 : 1)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.GOLD_ORE), null, null, null, null, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.GOLD_DUST, oreCrusher.isOreDoublingEnabled() ? 2 : 1).item()) + .register(plugin); new SlimefunItem(itemGroups.resources, SlimefunItems.COPPER_DUST, RecipeType.ORE_WASHER, - new ItemStack[] {SlimefunItems.SIFTED_ORE, null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.SIFTED_ORE.item(), null, null, null, null, null, null, null, null}) + .register(plugin); new SlimefunItem(itemGroups.resources, SlimefunItems.TIN_DUST, RecipeType.ORE_WASHER, - new ItemStack[] {SlimefunItems.SIFTED_ORE, null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.SIFTED_ORE.item(), null, null, null, null, null, null, null, null}) + .register(plugin); new SlimefunItem(itemGroups.resources, SlimefunItems.SILVER_DUST, RecipeType.ORE_WASHER, - new ItemStack[] {SlimefunItems.SIFTED_ORE, null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.SIFTED_ORE.item(), null, null, null, null, null, null, null, null}) + .register(plugin); new SlimefunItem(itemGroups.resources, SlimefunItems.LEAD_DUST, RecipeType.ORE_WASHER, - new ItemStack[] {SlimefunItems.SIFTED_ORE, null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.SIFTED_ORE.item(), null, null, null, null, null, null, null, null}) + .register(plugin); new SlimefunItem(itemGroups.resources, SlimefunItems.ALUMINUM_DUST, RecipeType.ORE_WASHER, - new ItemStack[] {SlimefunItems.SIFTED_ORE, null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.SIFTED_ORE.item(), null, null, null, null, null, null, null, null}) + .register(plugin); new SlimefunItem(itemGroups.resources, SlimefunItems.ZINC_DUST, RecipeType.ORE_WASHER, - new ItemStack[] {SlimefunItems.SIFTED_ORE, null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.SIFTED_ORE.item(), null, null, null, null, null, null, null, null}) + .register(plugin); new SlimefunItem(itemGroups.resources, SlimefunItems.MAGNESIUM_DUST, RecipeType.ORE_WASHER, - new ItemStack[] {SlimefunItems.SIFTED_ORE, null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.SIFTED_ORE.item(), null, null, null, null, null, null, null, null}) + .register(plugin); new SlimefunItem(itemGroups.resources, SlimefunItems.COPPER_INGOT, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.COPPER_DUST, null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.COPPER_DUST.item(), null, null, null, null, null, null, null, null}) + .register(plugin); new SlimefunItem(itemGroups.resources, SlimefunItems.TIN_INGOT, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.TIN_DUST, null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.TIN_DUST.item(), null, null, null, null, null, null, null, null}) + .register(plugin); new SlimefunItem(itemGroups.resources, SlimefunItems.SILVER_INGOT, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.SILVER_DUST, null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.SILVER_DUST.item(), null, null, null, null, null, null, null, null}) + .register(plugin); new SlimefunItem(itemGroups.resources, SlimefunItems.LEAD_INGOT, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.LEAD_DUST, null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.LEAD_DUST.item(), null, null, null, null, null, null, null, null}) + .register(plugin); new SlimefunItem(itemGroups.resources, SlimefunItems.ALUMINUM_INGOT, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.ALUMINUM_DUST, null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.ALUMINUM_DUST.item(), null, null, null, null, null, null, null, null}) + .register(plugin); new SlimefunItem(itemGroups.resources, SlimefunItems.ZINC_INGOT, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.ZINC_DUST, null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.ZINC_DUST.item(), null, null, null, null, null, null, null, null}) + .register(plugin); new SlimefunItem(itemGroups.resources, SlimefunItems.MAGNESIUM_INGOT, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.MAGNESIUM_DUST, null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.MAGNESIUM_DUST.item(), null, null, null, null, null, null, null, null}) + .register(plugin); new SlimefunItem(itemGroups.resources, SlimefunItems.SULFATE, RecipeType.ORE_CRUSHER, - new ItemStack[] {new ItemStack(Material.NETHERRACK, 16), null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.NETHERRACK, 16), null, null, null, null, null, null, null, null}) + .register(plugin); new UnplaceableBlock(itemGroups.resources, SlimefunItems.CARBON, RecipeType.COMPRESSOR, - new ItemStack[] {new ItemStack(Material.COAL, 8), null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.COAL, 8), null, null, null, null, null, null, null, null}) + .register(plugin); new SlimefunItem(itemGroups.misc, SlimefunItems.WHEAT_FLOUR, RecipeType.GRIND_STONE, - new ItemStack[] {new ItemStack(Material.WHEAT), null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.WHEAT), null, null, null, null, null, null, null, null}) + .register(plugin); new SlimefunItem(itemGroups.misc, SlimefunItems.STEEL_PLATE, RecipeType.COMPRESSOR, - new ItemStack[] {new SlimefunItemStack(SlimefunItems.STEEL_INGOT, 8), null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {new SlimefunItemStack(SlimefunItems.STEEL_INGOT, 8).item(), null, null, null, null, null, null, null, null}) + .register(plugin); new UnplaceableBlock(itemGroups.resources, SlimefunItems.COMPRESSED_CARBON, RecipeType.COMPRESSOR, - new ItemStack[] {new SlimefunItemStack(SlimefunItems.CARBON, 4), null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {new SlimefunItemStack(SlimefunItems.CARBON, 4).item(), null, null, null, null, null, null, null, null}) + .register(plugin); new UnplaceableBlock(itemGroups.resources, SlimefunItems.CARBON_CHUNK, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.COMPRESSED_CARBON, SlimefunItems.COMPRESSED_CARBON, SlimefunItems.COMPRESSED_CARBON, SlimefunItems.COMPRESSED_CARBON, new ItemStack(Material.FLINT), SlimefunItems.COMPRESSED_CARBON, SlimefunItems.COMPRESSED_CARBON, SlimefunItems.COMPRESSED_CARBON, SlimefunItems.COMPRESSED_CARBON}) - .register(plugin); + new ItemStack[] {SlimefunItems.COMPRESSED_CARBON.item(), SlimefunItems.COMPRESSED_CARBON.item(), SlimefunItems.COMPRESSED_CARBON.item(), SlimefunItems.COMPRESSED_CARBON.item(), new ItemStack(Material.FLINT), SlimefunItems.COMPRESSED_CARBON.item(), SlimefunItems.COMPRESSED_CARBON.item(), SlimefunItems.COMPRESSED_CARBON.item(), SlimefunItems.COMPRESSED_CARBON.item()}) + .register(plugin); new SteelThruster(itemGroups.technicalComponents, SlimefunItems.STEEL_THRUSTER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.REDSTONE), null, SlimefunItems.ALUMINUM_BRONZE_INGOT, SlimefunItems.ALUMINUM_BRONZE_INGOT, SlimefunItems.ALUMINUM_BRONZE_INGOT, SlimefunItems.STEEL_PLATE, new ItemStack(Material.FIRE_CHARGE), SlimefunItems.STEEL_PLATE}) - .register(plugin); + new ItemStack[] {null, new ItemStack(Material.REDSTONE), null, SlimefunItems.ALUMINUM_BRONZE_INGOT.item(), SlimefunItems.ALUMINUM_BRONZE_INGOT.item(), SlimefunItems.ALUMINUM_BRONZE_INGOT.item(), SlimefunItems.STEEL_PLATE.item(), new ItemStack(Material.FIRE_CHARGE), SlimefunItems.STEEL_PLATE.item()}) + .register(plugin); new SlimefunItem(itemGroups.technicalComponents, SlimefunItems.POWER_CRYSTAL, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.REDSTONE), SlimefunItems.SYNTHETIC_SAPPHIRE, new ItemStack(Material.REDSTONE), SlimefunItems.SYNTHETIC_SAPPHIRE, SlimefunItems.SYNTHETIC_DIAMOND, SlimefunItems.SYNTHETIC_SAPPHIRE, new ItemStack(Material.REDSTONE), SlimefunItems.SYNTHETIC_SAPPHIRE, new ItemStack(Material.REDSTONE)}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.REDSTONE), SlimefunItems.SYNTHETIC_SAPPHIRE.item(), new ItemStack(Material.REDSTONE), SlimefunItems.SYNTHETIC_SAPPHIRE.item(), SlimefunItems.SYNTHETIC_DIAMOND.item(), SlimefunItems.SYNTHETIC_SAPPHIRE.item(), new ItemStack(Material.REDSTONE), SlimefunItems.SYNTHETIC_SAPPHIRE.item(), new ItemStack(Material.REDSTONE)}) + .register(plugin); new Jetpack(itemGroups.technicalGadgets, SlimefunItems.DURALUMIN_JETPACK, - new ItemStack[] {SlimefunItems.DURALUMIN_INGOT, null, SlimefunItems.DURALUMIN_INGOT, SlimefunItems.DURALUMIN_INGOT, SlimefunItems.POWER_CRYSTAL, SlimefunItems.DURALUMIN_INGOT, SlimefunItems.STEEL_THRUSTER, SlimefunItems.SMALL_CAPACITOR, SlimefunItems.STEEL_THRUSTER}, - 0.35, 20) - .register(plugin); + new ItemStack[] {SlimefunItems.DURALUMIN_INGOT.item(), null, SlimefunItems.DURALUMIN_INGOT.item(), SlimefunItems.DURALUMIN_INGOT.item(), SlimefunItems.POWER_CRYSTAL.item(), SlimefunItems.DURALUMIN_INGOT.item(), SlimefunItems.STEEL_THRUSTER.item(), SlimefunItems.SMALL_CAPACITOR.item(), SlimefunItems.STEEL_THRUSTER.item()}, + 0.35, 20) + .register(plugin); new Jetpack(itemGroups.technicalGadgets, SlimefunItems.SOLDER_JETPACK, - new ItemStack[] {SlimefunItems.SOLDER_INGOT, null, SlimefunItems.SOLDER_INGOT, SlimefunItems.SOLDER_INGOT, SlimefunItems.POWER_CRYSTAL, SlimefunItems.SOLDER_INGOT, SlimefunItems.STEEL_THRUSTER, SlimefunItems.SMALL_CAPACITOR, SlimefunItems.STEEL_THRUSTER}, - 0.4, 30) - .register(plugin); + new ItemStack[] {SlimefunItems.SOLDER_INGOT.item(), null, SlimefunItems.SOLDER_INGOT.item(), SlimefunItems.SOLDER_INGOT.item(), SlimefunItems.POWER_CRYSTAL.item(), SlimefunItems.SOLDER_INGOT.item(), SlimefunItems.STEEL_THRUSTER.item(), SlimefunItems.SMALL_CAPACITOR.item(), SlimefunItems.STEEL_THRUSTER.item()}, + 0.4, 30) + .register(plugin); new Jetpack(itemGroups.technicalGadgets, SlimefunItems.BILLON_JETPACK, - new ItemStack[] {SlimefunItems.BILLON_INGOT, null, SlimefunItems.BILLON_INGOT, SlimefunItems.BILLON_INGOT, SlimefunItems.POWER_CRYSTAL, SlimefunItems.BILLON_INGOT, SlimefunItems.STEEL_THRUSTER, SlimefunItems.SMALL_CAPACITOR, SlimefunItems.STEEL_THRUSTER}, - 0.45, 45) - .register(plugin); + new ItemStack[] {SlimefunItems.BILLON_INGOT.item(), null, SlimefunItems.BILLON_INGOT.item(), SlimefunItems.BILLON_INGOT.item(), SlimefunItems.POWER_CRYSTAL.item(), SlimefunItems.BILLON_INGOT.item(), SlimefunItems.STEEL_THRUSTER.item(), SlimefunItems.SMALL_CAPACITOR.item(), SlimefunItems.STEEL_THRUSTER.item()}, + 0.45, 45) + .register(plugin); new Jetpack(itemGroups.technicalGadgets, SlimefunItems.STEEL_JETPACK, - new ItemStack[] {SlimefunItems.STEEL_INGOT, null, SlimefunItems.STEEL_INGOT, SlimefunItems.STEEL_INGOT, SlimefunItems.POWER_CRYSTAL, SlimefunItems.STEEL_INGOT, SlimefunItems.STEEL_THRUSTER, SlimefunItems.SMALL_CAPACITOR, SlimefunItems.STEEL_THRUSTER}, - 0.5, 60) - .register(plugin); + new ItemStack[] {SlimefunItems.STEEL_INGOT.item(), null, SlimefunItems.STEEL_INGOT.item(), SlimefunItems.STEEL_INGOT.item(), SlimefunItems.POWER_CRYSTAL.item(), SlimefunItems.STEEL_INGOT.item(), SlimefunItems.STEEL_THRUSTER.item(), SlimefunItems.SMALL_CAPACITOR.item(), SlimefunItems.STEEL_THRUSTER.item()}, + 0.5, 60) + .register(plugin); new Jetpack(itemGroups.technicalGadgets, SlimefunItems.DAMASCUS_STEEL_JETPACK, - new ItemStack[] {SlimefunItems.DAMASCUS_STEEL_INGOT, null, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.POWER_CRYSTAL, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.STEEL_THRUSTER, SlimefunItems.SMALL_CAPACITOR, SlimefunItems.STEEL_THRUSTER}, - 0.55, 75) - .register(plugin); + new ItemStack[] {SlimefunItems.DAMASCUS_STEEL_INGOT.item(), null, SlimefunItems.DAMASCUS_STEEL_INGOT.item(), SlimefunItems.DAMASCUS_STEEL_INGOT.item(), SlimefunItems.POWER_CRYSTAL.item(), SlimefunItems.DAMASCUS_STEEL_INGOT.item(), SlimefunItems.STEEL_THRUSTER.item(), SlimefunItems.SMALL_CAPACITOR.item(), SlimefunItems.STEEL_THRUSTER.item()}, + 0.55, 75) + .register(plugin); new Jetpack(itemGroups.technicalGadgets, SlimefunItems.REINFORCED_ALLOY_JETPACK, - new ItemStack[] {SlimefunItems.REINFORCED_ALLOY_INGOT, null, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.POWER_CRYSTAL, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.STEEL_THRUSTER, SlimefunItems.MEDIUM_CAPACITOR, SlimefunItems.STEEL_THRUSTER}, - 0.6, 100) - .register(plugin); + new ItemStack[] {SlimefunItems.REINFORCED_ALLOY_INGOT.item(), null, SlimefunItems.REINFORCED_ALLOY_INGOT.item(), SlimefunItems.REINFORCED_ALLOY_INGOT.item(), SlimefunItems.POWER_CRYSTAL.item(), SlimefunItems.REINFORCED_ALLOY_INGOT.item(), SlimefunItems.STEEL_THRUSTER.item(), SlimefunItems.MEDIUM_CAPACITOR.item(), SlimefunItems.STEEL_THRUSTER.item()}, + 0.6, 100) + .register(plugin); new Jetpack(itemGroups.technicalGadgets, SlimefunItems.CARBONADO_JETPACK, - new ItemStack[] {SlimefunItems.CARBON_CHUNK, null, SlimefunItems.CARBON_CHUNK, SlimefunItems.CARBONADO, SlimefunItems.POWER_CRYSTAL, SlimefunItems.CARBONADO, SlimefunItems.STEEL_THRUSTER, SlimefunItems.LARGE_CAPACITOR, SlimefunItems.STEEL_THRUSTER}, - 0.7, 150) - .register(plugin); + new ItemStack[] {SlimefunItems.CARBON_CHUNK.item(), null, SlimefunItems.CARBON_CHUNK.item(), SlimefunItems.CARBONADO.item(), SlimefunItems.POWER_CRYSTAL.item(), SlimefunItems.CARBONADO.item(), SlimefunItems.STEEL_THRUSTER.item(), SlimefunItems.LARGE_CAPACITOR.item(), SlimefunItems.STEEL_THRUSTER.item()}, + 0.7, 150) + .register(plugin); new Jetpack(itemGroups.technicalGadgets, SlimefunItems.ARMORED_JETPACK, - new ItemStack[] {SlimefunItems.STEEL_PLATE, null, SlimefunItems.STEEL_PLATE, SlimefunItems.STEEL_PLATE, SlimefunItems.POWER_CRYSTAL, SlimefunItems.STEEL_PLATE, SlimefunItems.STEEL_THRUSTER, SlimefunItems.MEDIUM_CAPACITOR, SlimefunItems.STEEL_THRUSTER}, - 0.5, 50) - .register(plugin); + new ItemStack[] {SlimefunItems.STEEL_PLATE.item(), null, SlimefunItems.STEEL_PLATE.item(), SlimefunItems.STEEL_PLATE.item(), SlimefunItems.POWER_CRYSTAL.item(), SlimefunItems.STEEL_PLATE.item(), SlimefunItems.STEEL_THRUSTER.item(), SlimefunItems.MEDIUM_CAPACITOR.item(), SlimefunItems.STEEL_THRUSTER.item()}, + 0.5, 50) + .register(plugin); new Parachute(itemGroups.technicalGadgets, SlimefunItems.PARACHUTE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.CLOTH, SlimefunItems.CLOTH, SlimefunItems.CLOTH, SlimefunItems.CHAIN, null, SlimefunItems.CHAIN, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.CLOTH.item(), SlimefunItems.CLOTH.item(), SlimefunItems.CLOTH.item(), SlimefunItems.CHAIN.item(), null, SlimefunItems.CHAIN.item(), null, null, null}) + .register(plugin); new HologramProjector(itemGroups.technicalGadgets, SlimefunItems.HOLOGRAM_PROJECTOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.POWER_CRYSTAL, null, SlimefunItems.ALUMINUM_BRASS_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ALUMINUM_BRASS_INGOT, null, SlimefunItems.ALUMINUM_BRASS_INGOT, null}, - new SlimefunItemStack(SlimefunItems.HOLOGRAM_PROJECTOR, 3)) - .register(plugin); + new ItemStack[] {null, SlimefunItems.POWER_CRYSTAL.item(), null, SlimefunItems.ALUMINUM_BRASS_INGOT.item(), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.ALUMINUM_BRASS_INGOT.item(), null, SlimefunItems.ALUMINUM_BRASS_INGOT.item(), null}, + new SlimefunItemStack(SlimefunItems.HOLOGRAM_PROJECTOR, 3).item()) + .register(plugin); new UnplaceableBlock(itemGroups.misc, SlimefunItems.CHAIN, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.STEEL_INGOT, null, null}, - new SlimefunItemStack(SlimefunItems.CHAIN, 8)) - .register(plugin); + new ItemStack[] {null, null, SlimefunItems.STEEL_INGOT.item(), null, SlimefunItems.STEEL_INGOT.item(), null, SlimefunItems.STEEL_INGOT.item(), null, null}, + new SlimefunItemStack(SlimefunItems.CHAIN, 8).item()) + .register(plugin); new SlimefunItem(itemGroups.misc, SlimefunItems.HOOK, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.STEEL_INGOT, null, null, null}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.STEEL_INGOT.item(), null, SlimefunItems.STEEL_INGOT.item(), null, SlimefunItems.STEEL_INGOT.item(), null, null, null}) + .register(plugin); new GrapplingHook(itemGroups.tools, SlimefunItems.GRAPPLING_HOOK, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, null, SlimefunItems.HOOK, null, SlimefunItems.CHAIN, null, SlimefunItems.CHAIN, null, null}) - .register(plugin); + new ItemStack[] {null, null, SlimefunItems.HOOK.item(), null, SlimefunItems.CHAIN.item(), null, SlimefunItems.CHAIN.item(), null, null}) + .register(plugin); new MagicWorkbench(itemGroups.basicMachines, SlimefunItems.MAGIC_WORKBENCH).register(plugin); new SlimefunItem(itemGroups.magicalGadgets, SlimefunItems.STAFF_ELEMENTAL, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, SlimefunItems.MAGICAL_BOOK_COVER, SlimefunItems.MAGIC_LUMP_3, null, new ItemStack(Material.STICK), SlimefunItems.MAGICAL_BOOK_COVER, SlimefunItems.MAGIC_LUMP_3, null, null}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.MAGICAL_BOOK_COVER.item(), SlimefunItems.MAGIC_LUMP_3.item(), null, new ItemStack(Material.STICK), SlimefunItems.MAGICAL_BOOK_COVER.item(), SlimefunItems.MAGIC_LUMP_3.item(), null, null}) + .register(plugin); new WindStaff(itemGroups.magicalGadgets, SlimefunItems.STAFF_WIND, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, new ItemStack(Material.FEATHER), SlimefunItems.ENDER_LUMP_3, null, SlimefunItems.STAFF_ELEMENTAL, new ItemStack(Material.FEATHER), SlimefunItems.STAFF_ELEMENTAL, null, null}) - .register(plugin); + new ItemStack[] {null, new ItemStack(Material.FEATHER), SlimefunItems.ENDER_LUMP_3.item(), null, SlimefunItems.STAFF_ELEMENTAL.item(), new ItemStack(Material.FEATHER), SlimefunItems.STAFF_ELEMENTAL.item(), null, null}) + .register(plugin); new WaterStaff(itemGroups.magicalGadgets, SlimefunItems.STAFF_WATER, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, new ItemStack(Material.LILY_PAD), SlimefunItems.MAGIC_LUMP_2, null, SlimefunItems.STAFF_ELEMENTAL, new ItemStack(Material.LILY_PAD), SlimefunItems.STAFF_ELEMENTAL, null, null}) - .register(plugin); + new ItemStack[] {null, new ItemStack(Material.LILY_PAD), SlimefunItems.MAGIC_LUMP_2.item(), null, SlimefunItems.STAFF_ELEMENTAL.item(), new ItemStack(Material.LILY_PAD), SlimefunItems.STAFF_ELEMENTAL.item(), null, null}) + .register(plugin); new EnchantedItem(itemGroups.magicalGadgets, SlimefunItems.STAFF_FIRE, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, null, SlimefunItems.LAVA_CRYSTAL, null, SlimefunItems.STAFF_ELEMENTAL, null, SlimefunItems.STAFF_ELEMENTAL, null, null}) - .register(plugin); + new ItemStack[] {null, null, SlimefunItems.LAVA_CRYSTAL.item(), null, SlimefunItems.STAFF_ELEMENTAL.item(), null, SlimefunItems.STAFF_ELEMENTAL.item(), null, null}) + .register(plugin); String[] multiToolItems = new String[] {"PORTABLE_CRAFTER", "MAGIC_EYE_OF_ENDER", "STAFF_ELEMENTAL_WIND", "GRAPPLING_HOOK"}; new MultiTool(itemGroups.technicalGadgets, SlimefunItems.DURALUMIN_MULTI_TOOL, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.DURALUMIN_INGOT, null, SlimefunItems.DURALUMIN_INGOT, SlimefunItems.DURALUMIN_INGOT, SlimefunItems.SMALL_CAPACITOR, SlimefunItems.DURALUMIN_INGOT, null, SlimefunItems.DURALUMIN_INGOT, null}, - 20, multiToolItems) - .register(plugin); + new ItemStack[] {SlimefunItems.DURALUMIN_INGOT.item(), null, SlimefunItems.DURALUMIN_INGOT.item(), SlimefunItems.DURALUMIN_INGOT.item(), SlimefunItems.SMALL_CAPACITOR.item(), SlimefunItems.DURALUMIN_INGOT.item(), null, SlimefunItems.DURALUMIN_INGOT.item(), null}, + 20, multiToolItems) + .register(plugin); new MultiTool(itemGroups.technicalGadgets, SlimefunItems.SOLDER_MULTI_TOOL, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.SOLDER_INGOT, null, SlimefunItems.SOLDER_INGOT, SlimefunItems.SOLDER_INGOT, SlimefunItems.SMALL_CAPACITOR, SlimefunItems.SOLDER_INGOT, null, SlimefunItems.SOLDER_INGOT, null}, - 30, multiToolItems) - .register(plugin); + new ItemStack[] {SlimefunItems.SOLDER_INGOT.item(), null, SlimefunItems.SOLDER_INGOT.item(), SlimefunItems.SOLDER_INGOT.item(), SlimefunItems.SMALL_CAPACITOR.item(), SlimefunItems.SOLDER_INGOT.item(), null, SlimefunItems.SOLDER_INGOT.item(), null}, + 30, multiToolItems) + .register(plugin); new MultiTool(itemGroups.technicalGadgets, SlimefunItems.BILLON_MULTI_TOOL, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.BILLON_INGOT, null, SlimefunItems.BILLON_INGOT, SlimefunItems.BILLON_INGOT, SlimefunItems.SMALL_CAPACITOR, SlimefunItems.BILLON_INGOT, null, SlimefunItems.BILLON_INGOT, null}, - 40, multiToolItems) - .register(plugin); + new ItemStack[] {SlimefunItems.BILLON_INGOT.item(), null, SlimefunItems.BILLON_INGOT.item(), SlimefunItems.BILLON_INGOT.item(), SlimefunItems.SMALL_CAPACITOR.item(), SlimefunItems.BILLON_INGOT.item(), null, SlimefunItems.BILLON_INGOT.item(), null}, + 40, multiToolItems) + .register(plugin); new MultiTool(itemGroups.technicalGadgets, SlimefunItems.STEEL_MULTI_TOOL, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.STEEL_INGOT, null, SlimefunItems.STEEL_INGOT, SlimefunItems.STEEL_INGOT, SlimefunItems.SMALL_CAPACITOR, SlimefunItems.STEEL_INGOT, null, SlimefunItems.STEEL_INGOT, null}, - 50, multiToolItems) - .register(plugin); + new ItemStack[] {SlimefunItems.STEEL_INGOT.item(), null, SlimefunItems.STEEL_INGOT.item(), SlimefunItems.STEEL_INGOT.item(), SlimefunItems.SMALL_CAPACITOR.item(), SlimefunItems.STEEL_INGOT.item(), null, SlimefunItems.STEEL_INGOT.item(), null}, + 50, multiToolItems) + .register(plugin); new MultiTool(itemGroups.technicalGadgets, SlimefunItems.DAMASCUS_STEEL_MULTI_TOOL, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.DAMASCUS_STEEL_INGOT, null, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.SMALL_CAPACITOR, SlimefunItems.DAMASCUS_STEEL_INGOT, null, SlimefunItems.DAMASCUS_STEEL_INGOT, null}, - 60, multiToolItems) - .register(plugin); + new ItemStack[] {SlimefunItems.DAMASCUS_STEEL_INGOT.item(), null, SlimefunItems.DAMASCUS_STEEL_INGOT.item(), SlimefunItems.DAMASCUS_STEEL_INGOT.item(), SlimefunItems.SMALL_CAPACITOR.item(), SlimefunItems.DAMASCUS_STEEL_INGOT.item(), null, SlimefunItems.DAMASCUS_STEEL_INGOT.item(), null}, + 60, multiToolItems) + .register(plugin); new MultiTool(itemGroups.technicalGadgets, SlimefunItems.REINFORCED_ALLOY_MULTI_TOOL, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.REINFORCED_ALLOY_INGOT, null, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.MEDIUM_CAPACITOR, SlimefunItems.REINFORCED_ALLOY_INGOT, null, SlimefunItems.REINFORCED_ALLOY_INGOT, null}, - 75, multiToolItems) - .register(plugin); + new ItemStack[] {SlimefunItems.REINFORCED_ALLOY_INGOT.item(), null, SlimefunItems.REINFORCED_ALLOY_INGOT.item(), SlimefunItems.REINFORCED_ALLOY_INGOT.item(), SlimefunItems.MEDIUM_CAPACITOR.item(), SlimefunItems.REINFORCED_ALLOY_INGOT.item(), null, SlimefunItems.REINFORCED_ALLOY_INGOT.item(), null}, + 75, multiToolItems) + .register(plugin); new MultiTool(itemGroups.technicalGadgets, SlimefunItems.CARBONADO_MULTI_TOOL, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.CARBONADO, null, SlimefunItems.CARBONADO, SlimefunItems.CARBONADO, SlimefunItems.LARGE_CAPACITOR, SlimefunItems.CARBONADO, null, SlimefunItems.CARBONADO, null}, - 100, "PORTABLE_CRAFTER", "MAGIC_EYE_OF_ENDER", "STAFF_ELEMENTAL_WIND", "GRAPPLING_HOOK", "GOLD_PAN", "NETHER_GOLD_PAN") - .register(plugin); + new ItemStack[] {SlimefunItems.CARBONADO.item(), null, SlimefunItems.CARBONADO.item(), SlimefunItems.CARBONADO.item(), SlimefunItems.LARGE_CAPACITOR.item(), SlimefunItems.CARBONADO.item(), null, SlimefunItems.CARBONADO.item(), null}, + 100, "PORTABLE_CRAFTER", "MAGIC_EYE_OF_ENDER", "STAFF_ELEMENTAL_WIND", "GRAPPLING_HOOK", "GOLD_PAN", "NETHER_GOLD_PAN") + .register(plugin); new OreWasher(itemGroups.basicMachines, SlimefunItems.ORE_WASHER).register(plugin); new GoldIngot(itemGroups.resources, 24, SlimefunItems.GOLD_24K, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.GOLD_DUST, SlimefunItems.GOLD_22K, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.GOLD_DUST.item(), SlimefunItems.GOLD_22K.item(), null, null, null, null, null, null, null}) + .register(plugin); new GoldIngot(itemGroups.resources, 22, SlimefunItems.GOLD_22K, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.GOLD_DUST, SlimefunItems.GOLD_20K, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.GOLD_DUST.item(), SlimefunItems.GOLD_20K.item(), null, null, null, null, null, null, null}) + .register(plugin); new GoldIngot(itemGroups.resources, 20, SlimefunItems.GOLD_20K, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.GOLD_DUST, SlimefunItems.GOLD_18K, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.GOLD_DUST.item(), SlimefunItems.GOLD_18K.item(), null, null, null, null, null, null, null}) + .register(plugin); new GoldIngot(itemGroups.resources, 18, SlimefunItems.GOLD_18K, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.GOLD_DUST, SlimefunItems.GOLD_16K, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.GOLD_DUST.item(), SlimefunItems.GOLD_16K.item(), null, null, null, null, null, null, null}) + .register(plugin); new GoldIngot(itemGroups.resources, 16, SlimefunItems.GOLD_16K, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.GOLD_DUST, SlimefunItems.GOLD_14K, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.GOLD_DUST.item(), SlimefunItems.GOLD_14K.item(), null, null, null, null, null, null, null}) + .register(plugin); new GoldIngot(itemGroups.resources, 14, SlimefunItems.GOLD_14K, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.GOLD_DUST, SlimefunItems.GOLD_12K, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.GOLD_DUST.item(), SlimefunItems.GOLD_12K.item(), null, null, null, null, null, null, null}) + .register(plugin); new GoldIngot(itemGroups.resources, 12, SlimefunItems.GOLD_12K, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.GOLD_DUST, SlimefunItems.GOLD_10K, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.GOLD_DUST.item(), SlimefunItems.GOLD_10K.item(), null, null, null, null, null, null, null}) + .register(plugin); new GoldIngot(itemGroups.resources, 10, SlimefunItems.GOLD_10K, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.GOLD_DUST, SlimefunItems.GOLD_8K, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.GOLD_DUST.item(), SlimefunItems.GOLD_8K.item(), null, null, null, null, null, null, null}) + .register(plugin); new GoldIngot(itemGroups.resources, 8, SlimefunItems.GOLD_8K, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.GOLD_DUST, SlimefunItems.GOLD_6K, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.GOLD_DUST.item(), SlimefunItems.GOLD_6K.item(), null, null, null, null, null, null, null}) + .register(plugin); new GoldIngot(itemGroups.resources, 6, SlimefunItems.GOLD_6K, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.GOLD_DUST, SlimefunItems.GOLD_4K, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.GOLD_DUST.item(), SlimefunItems.GOLD_4K.item(), null, null, null, null, null, null, null}) + .register(plugin); new GoldIngot(itemGroups.resources, 4, SlimefunItems.GOLD_4K, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.GOLD_DUST, null, null, null, null, null, null, null, null}) - .setUseableInWorkbench(true) - .register(plugin); + new ItemStack[] {SlimefunItems.GOLD_DUST.item(), null, null, null, null, null, null, null, null}) + .setUseableInWorkbench(true) + .register(plugin); new SlimefunItem(itemGroups.misc, SlimefunItems.STONE_CHUNK, RecipeType.ORE_WASHER, - new ItemStack[] {SlimefunItems.SIFTED_ORE, null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.SIFTED_ORE.item(), null, null, null, null, null, null, null, null}) + .register(plugin); new SlimefunItem(itemGroups.resources, SlimefunItems.SILICON, RecipeType.SMELTERY, - new ItemStack[] {new ItemStack(Material.QUARTZ_BLOCK), null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.QUARTZ_BLOCK), null, null, null, null, null, null, null, null}) + .register(plugin); new UnplaceableBlock(itemGroups.technicalComponents, SlimefunItems.SOLAR_PANEL, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.GLASS), new ItemStack(Material.GLASS), new ItemStack(Material.GLASS), SlimefunItems.SILICON, SlimefunItems.SILICON, SlimefunItems.SILICON, SlimefunItems.FERROSILICON, SlimefunItems.FERROSILICON, SlimefunItems.FERROSILICON}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.GLASS), new ItemStack(Material.GLASS), new ItemStack(Material.GLASS), SlimefunItems.SILICON.item(), SlimefunItems.SILICON.item(), SlimefunItems.SILICON.item(), SlimefunItems.FERROSILICON.item(), SlimefunItems.FERROSILICON.item(), SlimefunItems.FERROSILICON.item()}) + .register(plugin); new SolarHelmet(itemGroups.technicalGadgets, SlimefunItems.SOLAR_HELMET, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.SOLAR_PANEL, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.REINFORCED_ALLOY_INGOT, null, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.MEDIUM_CAPACITOR, null, SlimefunItems.MEDIUM_CAPACITOR}, - 0.1) - .register(plugin); + new ItemStack[] {SlimefunItems.REINFORCED_ALLOY_INGOT.item(), SlimefunItems.SOLAR_PANEL.item(), SlimefunItems.REINFORCED_ALLOY_INGOT.item(), SlimefunItems.REINFORCED_ALLOY_INGOT.item(), null, SlimefunItems.REINFORCED_ALLOY_INGOT.item(), SlimefunItems.MEDIUM_CAPACITOR.item(), null, SlimefunItems.MEDIUM_CAPACITOR.item()}, + 0.1) + .register(plugin); new UnplaceableBlock(itemGroups.magicalResources, SlimefunItems.LAVA_CRYSTAL, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_1, new ItemStack(Material.BLAZE_POWDER), SlimefunItems.MAGIC_LUMP_1, new ItemStack(Material.BLAZE_POWDER), SlimefunItems.FIRE_RUNE, new ItemStack(Material.BLAZE_POWDER), SlimefunItems.MAGIC_LUMP_1, new ItemStack(Material.BLAZE_POWDER), SlimefunItems.MAGIC_LUMP_1}) - .register(plugin); + new ItemStack[] {SlimefunItems.MAGIC_LUMP_1.item(), new ItemStack(Material.BLAZE_POWDER), SlimefunItems.MAGIC_LUMP_1.item(), new ItemStack(Material.BLAZE_POWDER), SlimefunItems.FIRE_RUNE.item(), new ItemStack(Material.BLAZE_POWDER), SlimefunItems.MAGIC_LUMP_1.item(), new ItemStack(Material.BLAZE_POWDER), SlimefunItems.MAGIC_LUMP_1.item()}) + .register(plugin); new StormStaff(itemGroups.magicalGadgets, SlimefunItems.STAFF_STORM, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {SlimefunItems.LIGHTNING_RUNE, SlimefunItems.ENDER_LUMP_3, SlimefunItems.LIGHTNING_RUNE, SlimefunItems.STAFF_WATER, SlimefunItems.MAGIC_SUGAR, SlimefunItems.STAFF_WIND, SlimefunItems.LIGHTNING_RUNE, SlimefunItems.ENDER_LUMP_3, SlimefunItems.LIGHTNING_RUNE}) - .register(plugin); + new ItemStack[] {SlimefunItems.LIGHTNING_RUNE.item(), SlimefunItems.ENDER_LUMP_3.item(), SlimefunItems.LIGHTNING_RUNE.item(), SlimefunItems.STAFF_WATER.item(), SlimefunItems.MAGIC_SUGAR.item(), SlimefunItems.STAFF_WIND.item(), SlimefunItems.LIGHTNING_RUNE.item(), SlimefunItems.ENDER_LUMP_3.item(), SlimefunItems.LIGHTNING_RUNE.item()}) + .register(plugin); ItemStack weaknessPotion = new ItemStack(Material.POTION); PotionMeta meta = (PotionMeta) weaknessPotion.getItemMeta(); @@ -848,275 +848,275 @@ public static void setup(@Nonnull Slimefun plugin) { weaknessPotion.setItemMeta(meta); new MagicalZombiePills(itemGroups.magicalGadgets, SlimefunItems.MAGICAL_ZOMBIE_PILLS, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {new ItemStack(Material.GOLD_INGOT), SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.GOLD_INGOT), new ItemStack(Material.APPLE), weaknessPotion, new ItemStack(Material.APPLE), new ItemStack(Material.GOLD_INGOT), SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.GOLD_INGOT)}, - new SlimefunItemStack(SlimefunItems.MAGICAL_ZOMBIE_PILLS, 2)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.GOLD_INGOT), SlimefunItems.MAGIC_LUMP_2.item(), new ItemStack(Material.GOLD_INGOT), new ItemStack(Material.APPLE), weaknessPotion, new ItemStack(Material.APPLE), new ItemStack(Material.GOLD_INGOT), SlimefunItems.MAGIC_LUMP_2.item(), new ItemStack(Material.GOLD_INGOT)}, + new SlimefunItemStack(SlimefunItems.MAGICAL_ZOMBIE_PILLS, 2).item()) + .register(plugin); new SmeltersPickaxe(itemGroups.tools, SlimefunItems.SMELTERS_PICKAXE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.LAVA_CRYSTAL, SlimefunItems.LAVA_CRYSTAL, SlimefunItems.LAVA_CRYSTAL, null, SlimefunItems.FERROSILICON, null, null, SlimefunItems.FERROSILICON, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.LAVA_CRYSTAL.item(), SlimefunItems.LAVA_CRYSTAL.item(), SlimefunItems.LAVA_CRYSTAL.item(), null, SlimefunItems.FERROSILICON.item(), null, null, SlimefunItems.FERROSILICON.item(), null}) + .register(plugin); new SlimefunItem(itemGroups.magicalResources, SlimefunItems.COMMON_TALISMAN, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_2, SlimefunItems.GOLD_8K, SlimefunItems.MAGIC_LUMP_2, null, new ItemStack(Material.EMERALD), null, SlimefunItems.MAGIC_LUMP_2, SlimefunItems.GOLD_8K, SlimefunItems.MAGIC_LUMP_2}) - .register(plugin); + new ItemStack[] {SlimefunItems.MAGIC_LUMP_2.item(), SlimefunItems.GOLD_8K.item(), SlimefunItems.MAGIC_LUMP_2.item(), null, new ItemStack(Material.EMERALD), null, SlimefunItems.MAGIC_LUMP_2.item(), SlimefunItems.GOLD_8K.item(), SlimefunItems.MAGIC_LUMP_2.item()}) + .register(plugin); new Talisman(SlimefunItems.TALISMAN_ANVIL, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, new ItemStack(Material.ANVIL), SlimefunItems.COMMON_TALISMAN, new ItemStack(Material.ANVIL), SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3}, - true, false, "anvil") - .register(plugin); + new ItemStack[] {SlimefunItems.MAGIC_LUMP_3.item(), null, SlimefunItems.MAGIC_LUMP_3.item(), new ItemStack(Material.ANVIL), SlimefunItems.COMMON_TALISMAN.item(), new ItemStack(Material.ANVIL), SlimefunItems.MAGIC_LUMP_3.item(), null, SlimefunItems.MAGIC_LUMP_3.item()}, + true, false, "anvil") + .register(plugin); new Talisman(SlimefunItems.TALISMAN_MINER, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.SYNTHETIC_SAPPHIRE, SlimefunItems.COMMON_TALISMAN, SlimefunItems.SIFTED_ORE, SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3}, - false, false, "miner", 20) - .register(plugin); + new ItemStack[] {SlimefunItems.MAGIC_LUMP_3.item(), null, SlimefunItems.MAGIC_LUMP_3.item(), SlimefunItems.SYNTHETIC_SAPPHIRE.item(), SlimefunItems.COMMON_TALISMAN.item(), SlimefunItems.SIFTED_ORE.item(), SlimefunItems.MAGIC_LUMP_3.item(), null, SlimefunItems.MAGIC_LUMP_3.item()}, + false, false, "miner", 20) + .register(plugin); new Talisman(SlimefunItems.TALISMAN_FARMER, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, new ItemStack(Material.DIAMOND_HOE), SlimefunItems.COMMON_TALISMAN, new ItemStack(Material.DIAMOND_HOE), SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3}, - false, false, "farmer", 20) - .register(plugin); + new ItemStack[] {SlimefunItems.MAGIC_LUMP_3.item(), null, SlimefunItems.MAGIC_LUMP_3.item(), new ItemStack(Material.DIAMOND_HOE), SlimefunItems.COMMON_TALISMAN.item(), new ItemStack(Material.DIAMOND_HOE), SlimefunItems.MAGIC_LUMP_3.item(), null, SlimefunItems.MAGIC_LUMP_3.item()}, + false, false, "farmer", 20) + .register(plugin); new Talisman(SlimefunItems.TALISMAN_HUNTER, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.SYNTHETIC_SAPPHIRE, SlimefunItems.COMMON_TALISMAN, SlimefunItems.MONSTER_JERKY, SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3}, - false, false, "hunter", 20) - .register(plugin); + new ItemStack[] {SlimefunItems.MAGIC_LUMP_3.item(), null, SlimefunItems.MAGIC_LUMP_3.item(), SlimefunItems.SYNTHETIC_SAPPHIRE.item(), SlimefunItems.COMMON_TALISMAN.item(), SlimefunItems.MONSTER_JERKY.item(), SlimefunItems.MAGIC_LUMP_3.item(), null, SlimefunItems.MAGIC_LUMP_3.item()}, + false, false, "hunter", 20) + .register(plugin); new Talisman(SlimefunItems.TALISMAN_LAVA, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.LAVA_CRYSTAL, SlimefunItems.COMMON_TALISMAN, new ItemStack(Material.LAVA_BUCKET), SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3}, - true, true, "lava", new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 3600, 4)) - .register(plugin); + new ItemStack[] {SlimefunItems.MAGIC_LUMP_3.item(), null, SlimefunItems.MAGIC_LUMP_3.item(), SlimefunItems.LAVA_CRYSTAL.item(), SlimefunItems.COMMON_TALISMAN.item(), new ItemStack(Material.LAVA_BUCKET), SlimefunItems.MAGIC_LUMP_3.item(), null, SlimefunItems.MAGIC_LUMP_3.item()}, + true, true, "lava", new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 3600, 4)) + .register(plugin); new Talisman(SlimefunItems.TALISMAN_WATER, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, new ItemStack(Material.WATER_BUCKET), SlimefunItems.COMMON_TALISMAN, new ItemStack(Material.FISHING_ROD), SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3}, - true, true, "water", new PotionEffect(PotionEffectType.WATER_BREATHING, 3600, 4)) - .register(plugin); + new ItemStack[] {SlimefunItems.MAGIC_LUMP_3.item(), null, SlimefunItems.MAGIC_LUMP_3.item(), new ItemStack(Material.WATER_BUCKET), SlimefunItems.COMMON_TALISMAN.item(), new ItemStack(Material.FISHING_ROD), SlimefunItems.MAGIC_LUMP_3.item(), null, SlimefunItems.MAGIC_LUMP_3.item()}, + true, true, "water", new PotionEffect(PotionEffectType.WATER_BREATHING, 3600, 4)) + .register(plugin); new Talisman(SlimefunItems.TALISMAN_ANGEL, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, new ItemStack(Material.FEATHER), SlimefunItems.COMMON_TALISMAN, new ItemStack(Material.FEATHER), SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3}, - false, true, "angel", 75) - .register(plugin); + new ItemStack[] {SlimefunItems.MAGIC_LUMP_3.item(), null, SlimefunItems.MAGIC_LUMP_3.item(), new ItemStack(Material.FEATHER), SlimefunItems.COMMON_TALISMAN.item(), new ItemStack(Material.FEATHER), SlimefunItems.MAGIC_LUMP_3.item(), null, SlimefunItems.MAGIC_LUMP_3.item()}, + false, true, "angel", 75) + .register(plugin); new Talisman(SlimefunItems.TALISMAN_FIRE, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.LAVA_CRYSTAL, SlimefunItems.COMMON_TALISMAN, SlimefunItems.LAVA_CRYSTAL, SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3}, - true, true, "fire", new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 3600, 4)) - .register(plugin); + new ItemStack[] {SlimefunItems.MAGIC_LUMP_3.item(), null, SlimefunItems.MAGIC_LUMP_3.item(), SlimefunItems.LAVA_CRYSTAL.item(), SlimefunItems.COMMON_TALISMAN.item(), SlimefunItems.LAVA_CRYSTAL.item(), SlimefunItems.MAGIC_LUMP_3.item(), null, SlimefunItems.MAGIC_LUMP_3.item()}, + true, true, "fire", new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 3600, 4)) + .register(plugin); new MagicianTalisman(SlimefunItems.TALISMAN_MAGICIAN, - new ItemStack[] {SlimefunItems.ENDER_LUMP_3, null, SlimefunItems.ENDER_LUMP_3, new ItemStack(Material.ENCHANTING_TABLE), SlimefunItems.COMMON_TALISMAN, new ItemStack(Material.ENCHANTING_TABLE), SlimefunItems.ENDER_LUMP_3, null, SlimefunItems.ENDER_LUMP_3}) - .register(plugin); + new ItemStack[] {SlimefunItems.ENDER_LUMP_3.item(), null, SlimefunItems.ENDER_LUMP_3.item(), new ItemStack(Material.ENCHANTING_TABLE), SlimefunItems.COMMON_TALISMAN.item(), new ItemStack(Material.ENCHANTING_TABLE), SlimefunItems.ENDER_LUMP_3.item(), null, SlimefunItems.ENDER_LUMP_3.item()}) + .register(plugin); new Talisman(SlimefunItems.TALISMAN_TRAVELLER, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.STAFF_WIND, SlimefunItems.TALISMAN_ANGEL, SlimefunItems.STAFF_WIND, SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3}, - false, false, "traveller", 60, new PotionEffect(PotionEffectType.SPEED, 3600, 2)) - .register(plugin); + new ItemStack[] {SlimefunItems.MAGIC_LUMP_3.item(), null, SlimefunItems.MAGIC_LUMP_3.item(), SlimefunItems.STAFF_WIND.item(), SlimefunItems.TALISMAN_ANGEL.item(), SlimefunItems.STAFF_WIND.item(), SlimefunItems.MAGIC_LUMP_3.item(), null, SlimefunItems.MAGIC_LUMP_3.item()}, + false, false, "traveller", 60, new PotionEffect(PotionEffectType.SPEED, 3600, 2)) + .register(plugin); new Talisman(SlimefunItems.TALISMAN_WARRIOR, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.COMMON_TALISMAN, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3}, - true, true, "warrior", new PotionEffect(VersionedPotionEffectType.STRENGTH, 3600, 2)) - .register(plugin); + new ItemStack[] {SlimefunItems.MAGIC_LUMP_3.item(), null, SlimefunItems.MAGIC_LUMP_3.item(), SlimefunItems.REINFORCED_ALLOY_INGOT.item(), SlimefunItems.COMMON_TALISMAN.item(), SlimefunItems.REINFORCED_ALLOY_INGOT.item(), SlimefunItems.MAGIC_LUMP_3.item(), null, SlimefunItems.MAGIC_LUMP_3.item()}, + true, true, "warrior", new PotionEffect(VersionedPotionEffectType.STRENGTH, 3600, 2)) + .register(plugin); new Talisman(SlimefunItems.TALISMAN_KNIGHT, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.GILDED_IRON, SlimefunItems.TALISMAN_WARRIOR, SlimefunItems.GILDED_IRON, SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3}, - "knight", 30, new PotionEffect(PotionEffectType.REGENERATION, 100, 3)) - .register(plugin); + new ItemStack[] {SlimefunItems.MAGIC_LUMP_3.item(), null, SlimefunItems.MAGIC_LUMP_3.item(), SlimefunItems.GILDED_IRON.item(), SlimefunItems.TALISMAN_WARRIOR.item(), SlimefunItems.GILDED_IRON.item(), SlimefunItems.MAGIC_LUMP_3.item(), null, SlimefunItems.MAGIC_LUMP_3.item()}, + "knight", 30, new PotionEffect(PotionEffectType.REGENERATION, 100, 3)) + .register(plugin); new Talisman(SlimefunItems.TALISMAN_CAVEMAN, - new ItemStack[] { SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, new ItemStack(Material.GOLDEN_PICKAXE), SlimefunItems.TALISMAN_MINER, SlimefunItems.EARTH_RUNE, SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3}, - false, false, "caveman", 50, new PotionEffect(VersionedPotionEffectType.HASTE, 800, 2)) - .register(plugin); + new ItemStack[] { SlimefunItems.MAGIC_LUMP_3.item(), null, SlimefunItems.MAGIC_LUMP_3.item(), new ItemStack(Material.GOLDEN_PICKAXE), SlimefunItems.TALISMAN_MINER.item(), SlimefunItems.EARTH_RUNE.item(), SlimefunItems.MAGIC_LUMP_3.item(), null, SlimefunItems.MAGIC_LUMP_3.item()}, + false, false, "caveman", 50, new PotionEffect(VersionedPotionEffectType.HASTE, 800, 2)) + .register(plugin); new Talisman(SlimefunItems.TALISMAN_WISE, - new ItemStack[] { SlimefunItems.MAGIC_LUMP_3, SlimefunItems.MAGICAL_GLASS, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE, SlimefunItems.TALISMAN_MAGICIAN, SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.MAGICAL_GLASS, SlimefunItems.MAGIC_LUMP_3}, - false, false, "wise", 20) - .register(plugin); + new ItemStack[] { SlimefunItems.MAGIC_LUMP_3.item(), SlimefunItems.MAGICAL_GLASS.item(), SlimefunItems.MAGIC_LUMP_3.item(), SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE.item(), SlimefunItems.TALISMAN_MAGICIAN.item(), SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE.item(), SlimefunItems.MAGIC_LUMP_3.item(), SlimefunItems.MAGICAL_GLASS.item(), SlimefunItems.MAGIC_LUMP_3.item()}, + false, false, "wise", 20) + .register(plugin); new SlimefunItem(itemGroups.resources, SlimefunItems.GILDED_IRON, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.GOLD_24K, SlimefunItems.IRON_DUST, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.GOLD_24K.item(), SlimefunItems.IRON_DUST.item(), null, null, null, null, null, null, null}) + .register(plugin); new SyntheticEmerald(itemGroups.resources, SlimefunItems.SYNTHETIC_EMERALD, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.SYNTHETIC_SAPPHIRE, SlimefunItems.ALUMINUM_DUST, SlimefunItems.ALUMINUM_INGOT, new ItemStack(Material.GLASS_PANE), null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.SYNTHETIC_SAPPHIRE.item(), SlimefunItems.ALUMINUM_DUST.item(), SlimefunItems.ALUMINUM_INGOT.item(), new ItemStack(Material.GLASS_PANE), null, null, null, null, null}) + .register(plugin); registerArmorSet(itemGroups.armor, SlimefunItems.CHAIN, new ItemStack[] { - new ItemStack(Material.CHAINMAIL_HELMET), new ItemStack(Material.CHAINMAIL_CHESTPLATE), new ItemStack(Material.CHAINMAIL_LEGGINGS), new ItemStack(Material.CHAINMAIL_BOOTS) + new ItemStack(Material.CHAINMAIL_HELMET), new ItemStack(Material.CHAINMAIL_CHESTPLATE), new ItemStack(Material.CHAINMAIL_LEGGINGS), new ItemStack(Material.CHAINMAIL_BOOTS) }, "CHAIN", true, new PotionEffect[0][0], plugin); new Talisman(SlimefunItems.TALISMAN_WHIRLWIND, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.STAFF_WIND, SlimefunItems.TALISMAN_TRAVELLER, SlimefunItems.STAFF_WIND, SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3} - , false, true, "whirlwind", 60) - .register(plugin); + new ItemStack[] {SlimefunItems.MAGIC_LUMP_3.item(), null, SlimefunItems.MAGIC_LUMP_3.item(), SlimefunItems.STAFF_WIND.item(), SlimefunItems.TALISMAN_TRAVELLER.item(), SlimefunItems.STAFF_WIND.item(), SlimefunItems.MAGIC_LUMP_3.item(), null, SlimefunItems.MAGIC_LUMP_3.item()} + , false, true, "whirlwind", 60) + .register(plugin); new Talisman(SlimefunItems.TALISMAN_WIZARD, - new ItemStack[] {SlimefunItems.ENDER_LUMP_3, null, SlimefunItems.ENDER_LUMP_3, SlimefunItems.MAGIC_EYE_OF_ENDER, SlimefunItems.TALISMAN_MAGICIAN, SlimefunItems.MAGIC_EYE_OF_ENDER, SlimefunItems.ENDER_LUMP_3, null, SlimefunItems.ENDER_LUMP_3}, - false, false, "wizard", 60) - .register(plugin); + new ItemStack[] {SlimefunItems.ENDER_LUMP_3.item(), null, SlimefunItems.ENDER_LUMP_3.item(), SlimefunItems.MAGIC_EYE_OF_ENDER.item(), SlimefunItems.TALISMAN_MAGICIAN.item(), SlimefunItems.MAGIC_EYE_OF_ENDER.item(), SlimefunItems.ENDER_LUMP_3.item(), null, SlimefunItems.ENDER_LUMP_3.item()}, + false, false, "wizard", 60) + .register(plugin); new LumberAxe(itemGroups.tools, SlimefunItems.LUMBER_AXE, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {SlimefunItems.SYNTHETIC_DIAMOND, SlimefunItems.SYNTHETIC_DIAMOND, null, SlimefunItems.SYNTHETIC_EMERALD, SlimefunItems.GILDED_IRON, null, null, SlimefunItems.GILDED_IRON, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.SYNTHETIC_DIAMOND.item(), SlimefunItems.SYNTHETIC_DIAMOND.item(), null, SlimefunItems.SYNTHETIC_EMERALD.item(), SlimefunItems.GILDED_IRON.item(), null, null, SlimefunItems.GILDED_IRON.item(), null}) + .register(plugin); new SlimefunItem(itemGroups.misc, SlimefunItems.SALT, RecipeType.ORE_WASHER, - new ItemStack[] {new ItemStack(Material.SAND, 2), null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.SAND, 2), null, null, null, null, null, null, null, null}) + .register(plugin); new HeavyCream(itemGroups.misc, SlimefunItems.HEAVY_CREAM, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.MILK_BUCKET), null, null, null, null, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.HEAVY_CREAM, 2)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.MILK_BUCKET), null, null, null, null, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.HEAVY_CREAM, 2).item()) + .register(plugin); new SlimefunItem(itemGroups.misc, SlimefunItems.CHEESE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.MILK_BUCKET), SlimefunItems.SALT, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.MILK_BUCKET), SlimefunItems.SALT.item(), null, null, null, null, null, null, null}) + .register(plugin); new SlimefunItem(itemGroups.misc, SlimefunItems.BUTTER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.HEAVY_CREAM, SlimefunItems.SALT, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.HEAVY_CREAM.item(), SlimefunItems.SALT.item(), null, null, null, null, null, null, null}) + .register(plugin); registerArmorSet(itemGroups.armor, SlimefunItems.GILDED_IRON, new ItemStack[] { - SlimefunItems.GILDED_IRON_HELMET, SlimefunItems.GILDED_IRON_CHESTPLATE, SlimefunItems.GILDED_IRON_LEGGINGS, SlimefunItems.GILDED_IRON_BOOTS + SlimefunItems.GILDED_IRON_HELMET.item(), SlimefunItems.GILDED_IRON_CHESTPLATE.item(), SlimefunItems.GILDED_IRON_LEGGINGS.item(), SlimefunItems.GILDED_IRON_BOOTS.item() }, "GILDED_IRON", false, new PotionEffect[0][0], plugin); new SlimefunItem(itemGroups.technicalComponents, SlimefunItems.REINFORCED_CLOTH, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.CLOTH, null, SlimefunItems.CLOTH, SlimefunItems.LEAD_INGOT, SlimefunItems.CLOTH, null, SlimefunItems.CLOTH, null}, new SlimefunItemStack(SlimefunItems.REINFORCED_CLOTH, 2)) - .register(plugin); + new ItemStack[] {null, SlimefunItems.CLOTH.item(), null, SlimefunItems.CLOTH.item(), SlimefunItems.LEAD_INGOT.item(), SlimefunItems.CLOTH.item(), null, SlimefunItems.CLOTH.item(), null}, new SlimefunItemStack(SlimefunItems.REINFORCED_CLOTH, 2).item()) + .register(plugin); new HazmatArmorPiece(itemGroups.armor, SlimefunItems.SCUBA_HELMET, RecipeType.ARMOR_FORGE, - new ItemStack[] {new ItemStack(Material.ORANGE_WOOL), SlimefunItems.REINFORCED_CLOTH, new ItemStack(Material.ORANGE_WOOL), SlimefunItems.REINFORCED_CLOTH, new ItemStack(Material.GLASS_PANE), SlimefunItems.REINFORCED_CLOTH, null, null, null}, - new PotionEffect[] {new PotionEffect(PotionEffectType.WATER_BREATHING, 300, 1)}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.ORANGE_WOOL), SlimefunItems.REINFORCED_CLOTH.item(), new ItemStack(Material.ORANGE_WOOL), SlimefunItems.REINFORCED_CLOTH.item(), new ItemStack(Material.GLASS_PANE), SlimefunItems.REINFORCED_CLOTH.item(), null, null, null}, + new PotionEffect[] {new PotionEffect(PotionEffectType.WATER_BREATHING, 300, 1)}) + .register(plugin); new HazmatArmorPiece(itemGroups.armor, SlimefunItems.HAZMAT_CHESTPLATE, RecipeType.ARMOR_FORGE, - new ItemStack[] {new ItemStack(Material.ORANGE_WOOL), null, new ItemStack(Material.ORANGE_WOOL), SlimefunItems.REINFORCED_CLOTH, SlimefunItems.REINFORCED_CLOTH, SlimefunItems.REINFORCED_CLOTH, new ItemStack(Material.BLACK_WOOL), SlimefunItems.REINFORCED_CLOTH, new ItemStack(Material.BLACK_WOOL)}, - new PotionEffect[] {new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 300, 1)}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.ORANGE_WOOL), null, new ItemStack(Material.ORANGE_WOOL), SlimefunItems.REINFORCED_CLOTH.item(), SlimefunItems.REINFORCED_CLOTH.item(), SlimefunItems.REINFORCED_CLOTH.item(), new ItemStack(Material.BLACK_WOOL), SlimefunItems.REINFORCED_CLOTH.item(), new ItemStack(Material.BLACK_WOOL)}, + new PotionEffect[] {new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 300, 1)}) + .register(plugin); new HazmatArmorPiece(itemGroups.armor, SlimefunItems.HAZMAT_LEGGINGS, RecipeType.ARMOR_FORGE, - new ItemStack[] {new ItemStack(Material.BLACK_WOOL), SlimefunItems.REINFORCED_CLOTH, new ItemStack(Material.BLACK_WOOL), SlimefunItems.REINFORCED_CLOTH, null, SlimefunItems.REINFORCED_CLOTH, SlimefunItems.REINFORCED_CLOTH, null, SlimefunItems.REINFORCED_CLOTH}, new PotionEffect[0]) - .register(plugin); + new ItemStack[] {new ItemStack(Material.BLACK_WOOL), SlimefunItems.REINFORCED_CLOTH.item(), new ItemStack(Material.BLACK_WOOL), SlimefunItems.REINFORCED_CLOTH.item(), null, SlimefunItems.REINFORCED_CLOTH.item(), SlimefunItems.REINFORCED_CLOTH.item(), null, SlimefunItems.REINFORCED_CLOTH.item()}, new PotionEffect[0]) + .register(plugin); new HazmatArmorPiece(itemGroups.armor, SlimefunItems.HAZMAT_BOOTS, RecipeType.ARMOR_FORGE, - new ItemStack[] {SlimefunItems.REINFORCED_CLOTH, null, SlimefunItems.REINFORCED_CLOTH, SlimefunItems.REINFORCED_CLOTH, null, SlimefunItems.REINFORCED_CLOTH, new ItemStack(Material.BLACK_WOOL), null, new ItemStack(Material.BLACK_WOOL)}, new PotionEffect[0]) - .register(plugin); + new ItemStack[] {SlimefunItems.REINFORCED_CLOTH.item(), null, SlimefunItems.REINFORCED_CLOTH.item(), SlimefunItems.REINFORCED_CLOTH.item(), null, SlimefunItems.REINFORCED_CLOTH.item(), new ItemStack(Material.BLACK_WOOL), null, new ItemStack(Material.BLACK_WOOL)}, new PotionEffect[0]) + .register(plugin); new SlimefunItem(itemGroups.misc, SlimefunItems.CRUSHED_ORE, RecipeType.ORE_CRUSHER, - new ItemStack[] {SlimefunItems.SIFTED_ORE, null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.SIFTED_ORE.item(), null, null, null, null, null, null, null, null}) + .register(plugin); new SlimefunItem(itemGroups.misc, SlimefunItems.PULVERIZED_ORE, RecipeType.ORE_CRUSHER, - new ItemStack[] {SlimefunItems.CRUSHED_ORE, null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.CRUSHED_ORE.item(), null, null, null, null, null, null, null, null}) + .register(plugin); new SlimefunItem(itemGroups.misc, SlimefunItems.PURE_ORE_CLUSTER, RecipeType.ORE_WASHER, - new ItemStack[] {SlimefunItems.PULVERIZED_ORE, null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.PULVERIZED_ORE.item(), null, null, null, null, null, null, null, null}) + .register(plugin); new RadioactiveItem(itemGroups.misc, Radioactivity.LOW, SlimefunItems.TINY_URANIUM, RecipeType.ORE_CRUSHER, - new ItemStack[] {SlimefunItems.PURE_ORE_CLUSTER, null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.PURE_ORE_CLUSTER.item(), null, null, null, null, null, null, null, null}) + .register(plugin); new RadioactiveItem(itemGroups.misc, Radioactivity.MODERATE, SlimefunItems.SMALL_URANIUM, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.TINY_URANIUM, SlimefunItems.TINY_URANIUM, SlimefunItems.TINY_URANIUM, SlimefunItems.TINY_URANIUM, SlimefunItems.TINY_URANIUM, SlimefunItems.TINY_URANIUM, SlimefunItems.TINY_URANIUM, SlimefunItems.TINY_URANIUM, SlimefunItems.TINY_URANIUM}) - .register(plugin); + new ItemStack[] {SlimefunItems.TINY_URANIUM.item(), SlimefunItems.TINY_URANIUM.item(), SlimefunItems.TINY_URANIUM.item(), SlimefunItems.TINY_URANIUM.item(), SlimefunItems.TINY_URANIUM.item(), SlimefunItems.TINY_URANIUM.item(), SlimefunItems.TINY_URANIUM.item(), SlimefunItems.TINY_URANIUM.item(), SlimefunItems.TINY_URANIUM.item()}) + .register(plugin); new RadioactiveItem(itemGroups.resources, Radioactivity.HIGH, SlimefunItems.URANIUM, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.SMALL_URANIUM, SlimefunItems.SMALL_URANIUM, null, SlimefunItems.SMALL_URANIUM, SlimefunItems.SMALL_URANIUM, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.SMALL_URANIUM.item(), SlimefunItems.SMALL_URANIUM.item(), null, SlimefunItems.SMALL_URANIUM.item(), SlimefunItems.SMALL_URANIUM.item(), null, null, null, null}) + .register(plugin); new SlimefunItem(itemGroups.resources, SlimefunItems.REDSTONE_ALLOY, RecipeType.SMELTERY, - new ItemStack[] {new ItemStack(Material.REDSTONE), new ItemStack(Material.REDSTONE_BLOCK), SlimefunItems.FERROSILICON, SlimefunItems.HARDENED_METAL_INGOT, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.REDSTONE), new ItemStack(Material.REDSTONE_BLOCK), SlimefunItems.FERROSILICON.item(), SlimefunItems.HARDENED_METAL_INGOT.item(), null, null, null, null, null}) + .register(plugin); registerArmorSet(itemGroups.armor, SlimefunItems.GOLD_12K, new ItemStack[] { - SlimefunItems.GOLDEN_HELMET_12K, SlimefunItems.GOLDEN_CHESTPLATE_12K, SlimefunItems.GOLDEN_LEGGINGS_12K, SlimefunItems.GOLDEN_BOOTS_12K + SlimefunItems.GOLDEN_HELMET_12K.item(), SlimefunItems.GOLDEN_CHESTPLATE_12K.item(), SlimefunItems.GOLDEN_LEGGINGS_12K.item(), SlimefunItems.GOLDEN_BOOTS_12K.item() }, "GOLD_12K", false, new PotionEffect[0][0], plugin); new SlimefunItem(itemGroups.misc, SlimefunItems.CLOTH, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.WHITE_WOOL), null, null, null, null, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.CLOTH, 8)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.WHITE_WOOL), null, null, null, null, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.CLOTH, 8).item()) + .register(plugin); new Bandage(itemGroups.usefulItems, SlimefunItems.RAG, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.CLOTH, SlimefunItems.CLOTH, SlimefunItems.CLOTH, new ItemStack(Material.STRING), null, new ItemStack(Material.STRING), SlimefunItems.CLOTH, SlimefunItems.CLOTH, SlimefunItems.CLOTH}, - new SlimefunItemStack(SlimefunItems.RAG, 2), 0) - .register(plugin); + new ItemStack[] {SlimefunItems.CLOTH.item(), SlimefunItems.CLOTH.item(), SlimefunItems.CLOTH.item(), new ItemStack(Material.STRING), null, new ItemStack(Material.STRING), SlimefunItems.CLOTH.item(), SlimefunItems.CLOTH.item(), SlimefunItems.CLOTH.item()}, + new SlimefunItemStack(SlimefunItems.RAG, 2).item(), 0) + .register(plugin); new Bandage(itemGroups.usefulItems, SlimefunItems.BANDAGE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.RAG, new ItemStack(Material.STRING), SlimefunItems.RAG, null, null, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.BANDAGE, 4), 1) - .register(plugin); + new ItemStack[] {SlimefunItems.RAG.item(), new ItemStack(Material.STRING), SlimefunItems.RAG.item(), null, null, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.BANDAGE, 4).item(), 1) + .register(plugin); new Splint(itemGroups.usefulItems, SlimefunItems.SPLINT, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.IRON_INGOT), null, new ItemStack(Material.STICK), new ItemStack(Material.STICK), new ItemStack(Material.STICK), null, new ItemStack(Material.IRON_INGOT), null}, - new SlimefunItemStack(SlimefunItems.SPLINT, 4)) - .register(plugin); + new ItemStack[] {null, new ItemStack(Material.IRON_INGOT), null, new ItemStack(Material.STICK), new ItemStack(Material.STICK), new ItemStack(Material.STICK), null, new ItemStack(Material.IRON_INGOT), null}, + new SlimefunItemStack(SlimefunItems.SPLINT, 4).item()) + .register(plugin); new UnplaceableBlock(itemGroups.misc, SlimefunItems.TIN_CAN, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.TIN_INGOT, SlimefunItems.TIN_INGOT, SlimefunItems.TIN_INGOT, SlimefunItems.TIN_INGOT, null, SlimefunItems.TIN_INGOT, SlimefunItems.TIN_INGOT, SlimefunItems.TIN_INGOT, SlimefunItems.TIN_INGOT}, - new SlimefunItemStack(SlimefunItems.TIN_CAN, 8)) - .register(plugin); + new ItemStack[] {SlimefunItems.TIN_INGOT.item(), SlimefunItems.TIN_INGOT.item(), SlimefunItems.TIN_INGOT.item(), SlimefunItems.TIN_INGOT.item(), null, SlimefunItems.TIN_INGOT.item(), SlimefunItems.TIN_INGOT.item(), SlimefunItems.TIN_INGOT.item(), SlimefunItems.TIN_INGOT.item()}, + new SlimefunItemStack(SlimefunItems.TIN_CAN, 8).item()) + .register(plugin); new Vitamins(itemGroups.usefulItems, SlimefunItems.VITAMINS, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.TIN_CAN, new ItemStack(Material.APPLE), new ItemStack(Material.RED_MUSHROOM), new ItemStack(Material.SUGAR), null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.TIN_CAN.item(), new ItemStack(Material.APPLE), new ItemStack(Material.RED_MUSHROOM), new ItemStack(Material.SUGAR), null, null, null, null, null}) + .register(plugin); new Medicine(itemGroups.usefulItems, SlimefunItems.MEDICINE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.VITAMINS, new ItemStack(Material.GLASS_BOTTLE), SlimefunItems.HEAVY_CREAM, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.VITAMINS.item(), new ItemStack(Material.GLASS_BOTTLE), SlimefunItems.HEAVY_CREAM.item(), null, null, null, null, null, null}) + .register(plugin); new SlimefunArmorPiece(itemGroups.technicalGadgets, SlimefunItems.NIGHT_VISION_GOGGLES, RecipeType.ARMOR_FORGE, - new ItemStack[] {new ItemStack(Material.COAL_BLOCK), new ItemStack(Material.COAL_BLOCK), new ItemStack(Material.COAL_BLOCK), new ItemStack(Material.LIME_STAINED_GLASS_PANE), new ItemStack(Material.COAL_BLOCK), new ItemStack(Material.LIME_STAINED_GLASS_PANE), new ItemStack(Material.COAL_BLOCK), null, new ItemStack(Material.COAL_BLOCK)}, - new PotionEffect[] {new PotionEffect(PotionEffectType.NIGHT_VISION, 600, 20)}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.COAL_BLOCK), new ItemStack(Material.COAL_BLOCK), new ItemStack(Material.COAL_BLOCK), new ItemStack(Material.LIME_STAINED_GLASS_PANE), new ItemStack(Material.COAL_BLOCK), new ItemStack(Material.LIME_STAINED_GLASS_PANE), new ItemStack(Material.COAL_BLOCK), null, new ItemStack(Material.COAL_BLOCK)}, + new PotionEffect[] {new PotionEffect(PotionEffectType.NIGHT_VISION, 600, 20)}) + .register(plugin); new PickaxeOfContainment(itemGroups.tools, SlimefunItems.PICKAXE_OF_CONTAINMENT, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {SlimefunItems.FERROSILICON, SlimefunItems.FERROSILICON, SlimefunItems.FERROSILICON, null, SlimefunItems.GILDED_IRON, null, null, SlimefunItems.GILDED_IRON, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.FERROSILICON.item(), SlimefunItems.FERROSILICON.item(), SlimefunItems.FERROSILICON.item(), null, SlimefunItems.GILDED_IRON.item(), null, null, SlimefunItems.GILDED_IRON.item(), null}) + .register(plugin); new TableSaw(itemGroups.basicMachines, SlimefunItems.TABLE_SAW).register(plugin); new SlimefunArmorPiece(itemGroups.magicalArmor, SlimefunItems.SLIME_HELMET_STEEL, RecipeType.ARMOR_FORGE, - new ItemStack[] {new ItemStack(Material.SLIME_BALL), SlimefunItems.STEEL_PLATE, new ItemStack(Material.SLIME_BALL), new ItemStack(Material.SLIME_BALL), null, new ItemStack(Material.SLIME_BALL), null, null, null}, null) - .register(plugin); + new ItemStack[] {new ItemStack(Material.SLIME_BALL), SlimefunItems.STEEL_PLATE.item(), new ItemStack(Material.SLIME_BALL), new ItemStack(Material.SLIME_BALL), null, new ItemStack(Material.SLIME_BALL), null, null, null}, null) + .register(plugin); new SlimefunArmorPiece(itemGroups.magicalArmor, SlimefunItems.SLIME_CHESTPLATE_STEEL, RecipeType.ARMOR_FORGE, - new ItemStack[] {new ItemStack(Material.SLIME_BALL), null, new ItemStack(Material.SLIME_BALL), new ItemStack(Material.SLIME_BALL), SlimefunItems.STEEL_PLATE, new ItemStack(Material.SLIME_BALL), new ItemStack(Material.SLIME_BALL), new ItemStack(Material.SLIME_BALL), new ItemStack(Material.SLIME_BALL)}, null) - .register(plugin); + new ItemStack[] {new ItemStack(Material.SLIME_BALL), null, new ItemStack(Material.SLIME_BALL), new ItemStack(Material.SLIME_BALL), SlimefunItems.STEEL_PLATE.item(), new ItemStack(Material.SLIME_BALL), new ItemStack(Material.SLIME_BALL), new ItemStack(Material.SLIME_BALL), new ItemStack(Material.SLIME_BALL)}, null) + .register(plugin); new SlimefunArmorPiece(itemGroups.magicalArmor, SlimefunItems.SLIME_LEGGINGS_STEEL, RecipeType.ARMOR_FORGE, - new ItemStack[] {new ItemStack(Material.SLIME_BALL), SlimefunItems.STEEL_PLATE, new ItemStack(Material.SLIME_BALL), new ItemStack(Material.SLIME_BALL), null, new ItemStack(Material.SLIME_BALL), new ItemStack(Material.SLIME_BALL), null, new ItemStack(Material.SLIME_BALL)}, - new PotionEffect[] {new PotionEffect(PotionEffectType.SPEED, 300, 2)}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.SLIME_BALL), SlimefunItems.STEEL_PLATE.item(), new ItemStack(Material.SLIME_BALL), new ItemStack(Material.SLIME_BALL), null, new ItemStack(Material.SLIME_BALL), new ItemStack(Material.SLIME_BALL), null, new ItemStack(Material.SLIME_BALL)}, + new PotionEffect[] {new PotionEffect(PotionEffectType.SPEED, 300, 2)}) + .register(plugin); new LongFallBoots(itemGroups.magicalArmor, SlimefunItems.SLIME_BOOTS_STEEL, RecipeType.ARMOR_FORGE, - new ItemStack[] {null, null, null, new ItemStack(Material.SLIME_BALL), null, new ItemStack(Material.SLIME_BALL), new ItemStack(Material.SLIME_BALL), SlimefunItems.STEEL_PLATE, new ItemStack(Material.SLIME_BALL)}, - new PotionEffect[] {new PotionEffect(VersionedPotionEffectType.JUMP_BOOST, 300, 5)}, - SoundEffect.SLIME_BOOTS_FALL_SOUND) - .register(plugin); + new ItemStack[] {null, null, null, new ItemStack(Material.SLIME_BALL), null, new ItemStack(Material.SLIME_BALL), new ItemStack(Material.SLIME_BALL), SlimefunItems.STEEL_PLATE.item(), new ItemStack(Material.SLIME_BALL)}, + new PotionEffect[] {new PotionEffect(VersionedPotionEffectType.JUMP_BOOST, 300, 5)}, + SoundEffect.SLIME_BOOTS_FALL_SOUND) + .register(plugin); new VampireBlade(itemGroups.weapons, SlimefunItems.BLADE_OF_VAMPIRES, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, new ItemStack(Material.WITHER_SKELETON_SKULL), null, null, new ItemStack(Material.WITHER_SKELETON_SKULL), null, null, new ItemStack(Material.BLAZE_ROD), null}) - .register(plugin); + new ItemStack[] {null, new ItemStack(Material.WITHER_SKELETON_SKULL), null, null, new ItemStack(Material.WITHER_SKELETON_SKULL), null, null, new ItemStack(Material.BLAZE_ROD), null}) + .register(plugin); new SlimefunItem(itemGroups.misc, SlimefunItems.GOLD_24K_BLOCK, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.GOLD_24K, SlimefunItems.GOLD_24K, SlimefunItems.GOLD_24K, SlimefunItems.GOLD_24K, SlimefunItems.GOLD_24K, SlimefunItems.GOLD_24K, SlimefunItems.GOLD_24K, SlimefunItems.GOLD_24K, SlimefunItems.GOLD_24K}) - .register(plugin); + new ItemStack[] {SlimefunItems.GOLD_24K.item(), SlimefunItems.GOLD_24K.item(), SlimefunItems.GOLD_24K.item(), SlimefunItems.GOLD_24K.item(), SlimefunItems.GOLD_24K.item(), SlimefunItems.GOLD_24K.item(), SlimefunItems.GOLD_24K.item(), SlimefunItems.GOLD_24K.item(), SlimefunItems.GOLD_24K.item()}) + .register(plugin); new Composter(itemGroups.basicMachines, SlimefunItems.COMPOSTER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.OAK_SLAB), null, new ItemStack(Material.OAK_SLAB), new ItemStack(Material.OAK_SLAB), null, new ItemStack(Material.OAK_SLAB), new ItemStack(Material.OAK_SLAB), new ItemStack(Material.CAULDRON), new ItemStack(Material.OAK_SLAB)}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.OAK_SLAB), null, new ItemStack(Material.OAK_SLAB), new ItemStack(Material.OAK_SLAB), null, new ItemStack(Material.OAK_SLAB), new ItemStack(Material.OAK_SLAB), new ItemStack(Material.CAULDRON), new ItemStack(Material.OAK_SLAB)}) + .register(plugin); new FarmerShoes(itemGroups.magicalArmor, SlimefunItems.FARMER_SHOES, RecipeType.ARMOR_FORGE, - new ItemStack[] {null, null, null, new ItemStack(Material.HAY_BLOCK), null, new ItemStack(Material.HAY_BLOCK), new ItemStack(Material.HAY_BLOCK), null, new ItemStack(Material.HAY_BLOCK)}) - .register(plugin); + new ItemStack[] {null, null, null, new ItemStack(Material.HAY_BLOCK), null, new ItemStack(Material.HAY_BLOCK), new ItemStack(Material.HAY_BLOCK), null, new ItemStack(Material.HAY_BLOCK)}) + .register(plugin); new ExplosivePickaxe(itemGroups.tools, SlimefunItems.EXPLOSIVE_PICKAXE, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {new ItemStack(Material.TNT), SlimefunItems.SYNTHETIC_DIAMOND, new ItemStack(Material.TNT), null, SlimefunItems.FERROSILICON, null, null, SlimefunItems.FERROSILICON, null}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.TNT), SlimefunItems.SYNTHETIC_DIAMOND.item(), new ItemStack(Material.TNT), null, SlimefunItems.FERROSILICON.item(), null, null, SlimefunItems.FERROSILICON.item(), null}) + .register(plugin); new ExplosiveShovel(itemGroups.tools, SlimefunItems.EXPLOSIVE_SHOVEL, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, SlimefunItems.SYNTHETIC_DIAMOND, null, null, new ItemStack(Material.TNT), null, null, SlimefunItems.FERROSILICON, null}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.SYNTHETIC_DIAMOND.item(), null, null, new ItemStack(Material.TNT), null, null, SlimefunItems.FERROSILICON.item(), null}) + .register(plugin); new AutomatedPanningMachine(itemGroups.basicMachines, SlimefunItems.AUTOMATED_PANNING_MACHINE).register(plugin); @@ -1124,766 +1124,766 @@ public static void setup(@Nonnull Slimefun plugin) { new AdvancedIndustrialMiner(itemGroups.basicMachines, SlimefunItems.ADVANCED_INDUSTRIAL_MINER).register(plugin); new StomperBoots(itemGroups.magicalArmor, SlimefunItems.BOOTS_OF_THE_STOMPER, RecipeType.ARMOR_FORGE, - new ItemStack[] {null, null, null, new ItemStack(Material.YELLOW_WOOL), null, new ItemStack(Material.YELLOW_WOOL), new ItemStack(Material.PISTON), null, new ItemStack(Material.PISTON)}) - .register(plugin); + new ItemStack[] {null, null, null, new ItemStack(Material.YELLOW_WOOL), null, new ItemStack(Material.YELLOW_WOOL), new ItemStack(Material.PISTON), null, new ItemStack(Material.PISTON)}) + .register(plugin); new PickaxeOfTheSeeker(itemGroups.tools, SlimefunItems.PICKAXE_OF_THE_SEEKER, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {new ItemStack(Material.COMPASS), SlimefunItems.SYNTHETIC_DIAMOND, new ItemStack(Material.COMPASS), null, SlimefunItems.FERROSILICON, null, null, SlimefunItems.FERROSILICON, null}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.COMPASS), SlimefunItems.SYNTHETIC_DIAMOND.item(), new ItemStack(Material.COMPASS), null, SlimefunItems.FERROSILICON.item(), null, null, SlimefunItems.FERROSILICON.item(), null}) + .register(plugin); new SlimefunBackpack(9, itemGroups.usefulItems, SlimefunItems.BACKPACK_SMALL, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.LEATHER), null, new ItemStack(Material.LEATHER), SlimefunItems.GOLD_6K, new ItemStack(Material.CHEST), SlimefunItems.GOLD_6K, new ItemStack(Material.LEATHER), new ItemStack(Material.LEATHER), new ItemStack(Material.LEATHER)}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.LEATHER), null, new ItemStack(Material.LEATHER), SlimefunItems.GOLD_6K.item(), new ItemStack(Material.CHEST), SlimefunItems.GOLD_6K.item(), new ItemStack(Material.LEATHER), new ItemStack(Material.LEATHER), new ItemStack(Material.LEATHER)}) + .register(plugin); new SlimefunBackpack(18, itemGroups.usefulItems, SlimefunItems.BACKPACK_MEDIUM, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.LEATHER), null, new ItemStack(Material.LEATHER), SlimefunItems.GOLD_10K, SlimefunItems.BACKPACK_SMALL, SlimefunItems.GOLD_10K, new ItemStack(Material.LEATHER), new ItemStack(Material.LEATHER), new ItemStack(Material.LEATHER)}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.LEATHER), null, new ItemStack(Material.LEATHER), SlimefunItems.GOLD_10K.item(), SlimefunItems.BACKPACK_SMALL.item(), SlimefunItems.GOLD_10K.item(), new ItemStack(Material.LEATHER), new ItemStack(Material.LEATHER), new ItemStack(Material.LEATHER)}) + .register(plugin); new SlimefunBackpack(27, itemGroups.usefulItems, SlimefunItems.BACKPACK_LARGE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.LEATHER), null, new ItemStack(Material.LEATHER), SlimefunItems.GOLD_14K, SlimefunItems.BACKPACK_MEDIUM, SlimefunItems.GOLD_14K, new ItemStack(Material.LEATHER), new ItemStack(Material.LEATHER), new ItemStack(Material.LEATHER)}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.LEATHER), null, new ItemStack(Material.LEATHER), SlimefunItems.GOLD_14K.item(), SlimefunItems.BACKPACK_MEDIUM.item(), SlimefunItems.GOLD_14K.item(), new ItemStack(Material.LEATHER), new ItemStack(Material.LEATHER), new ItemStack(Material.LEATHER)}) + .register(plugin); new SlimefunBackpack(36, itemGroups.usefulItems, SlimefunItems.WOVEN_BACKPACK, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.CLOTH, null, SlimefunItems.CLOTH, SlimefunItems.GOLD_16K, SlimefunItems.BACKPACK_LARGE, SlimefunItems.GOLD_16K, SlimefunItems.CLOTH, SlimefunItems.CLOTH, SlimefunItems.CLOTH}) - .register(plugin); + new ItemStack[] {SlimefunItems.CLOTH.item(), null, SlimefunItems.CLOTH.item(), SlimefunItems.GOLD_16K.item(), SlimefunItems.BACKPACK_LARGE.item(), SlimefunItems.GOLD_16K.item(), SlimefunItems.CLOTH.item(), SlimefunItems.CLOTH.item(), SlimefunItems.CLOTH.item()}) + .register(plugin); new Crucible(itemGroups.basicMachines, SlimefunItems.CRUCIBLE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.TERRACOTTA), null, new ItemStack(Material.TERRACOTTA), new ItemStack(Material.TERRACOTTA), null, new ItemStack(Material.TERRACOTTA), new ItemStack(Material.TERRACOTTA), new ItemStack(Material.FLINT_AND_STEEL), new ItemStack(Material.TERRACOTTA)}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.TERRACOTTA), null, new ItemStack(Material.TERRACOTTA), new ItemStack(Material.TERRACOTTA), null, new ItemStack(Material.TERRACOTTA), new ItemStack(Material.TERRACOTTA), new ItemStack(Material.FLINT_AND_STEEL), new ItemStack(Material.TERRACOTTA)}) + .register(plugin); new SlimefunBackpack(45, itemGroups.usefulItems, SlimefunItems.GILDED_BACKPACK, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.GOLD_22K, null, SlimefunItems.GOLD_22K, new ItemStack(Material.LEATHER), SlimefunItems.WOVEN_BACKPACK, new ItemStack(Material.LEATHER), SlimefunItems.GOLD_22K, null, SlimefunItems.GOLD_22K}) - .register(plugin); + new ItemStack[] {SlimefunItems.GOLD_22K.item(), null, SlimefunItems.GOLD_22K.item(), new ItemStack(Material.LEATHER), SlimefunItems.WOVEN_BACKPACK.item(), new ItemStack(Material.LEATHER), SlimefunItems.GOLD_22K.item(), null, SlimefunItems.GOLD_22K.item()}) + .register(plugin); new SlimefunBackpack(54, itemGroups.usefulItems, SlimefunItems.RADIANT_BACKPACK, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.GOLD_24K, null, SlimefunItems.GOLD_24K, new ItemStack(Material.LEATHER), SlimefunItems.GILDED_BACKPACK, new ItemStack(Material.LEATHER), SlimefunItems.GOLD_24K, null, SlimefunItems.GOLD_24K}) - .register(plugin); + new ItemStack[] {SlimefunItems.GOLD_24K.item(), null, SlimefunItems.GOLD_24K.item(), new ItemStack(Material.LEATHER), SlimefunItems.GILDED_BACKPACK.item(), new ItemStack(Material.LEATHER), SlimefunItems.GOLD_24K.item(), null, SlimefunItems.GOLD_24K.item()}) + .register(plugin); new RestoredBackpack(itemGroups.usefulItems).register(plugin); new UnplaceableBlock(itemGroups.technicalComponents, SlimefunItems.MAGNET, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.NICKEL_INGOT, SlimefunItems.ALUMINUM_DUST, SlimefunItems.IRON_DUST, SlimefunItems.COBALT_INGOT, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.NICKEL_INGOT.item(), SlimefunItems.ALUMINUM_DUST.item(), SlimefunItems.IRON_DUST.item(), SlimefunItems.COBALT_INGOT.item(), null, null, null, null, null}) + .register(plugin); new InfusedMagnet(itemGroups.magicalGadgets, SlimefunItems.INFUSED_MAGNET, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.ENDER_LUMP_2, SlimefunItems.MAGNET, SlimefunItems.ENDER_LUMP_2, SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3}) - .register(plugin); + new ItemStack[] {SlimefunItems.MAGIC_LUMP_3.item(), null, SlimefunItems.MAGIC_LUMP_3.item(), SlimefunItems.ENDER_LUMP_2.item(), SlimefunItems.MAGNET.item(), SlimefunItems.ENDER_LUMP_2.item(), SlimefunItems.MAGIC_LUMP_3.item(), null, SlimefunItems.MAGIC_LUMP_3.item()}) + .register(plugin); new SlimefunItem(itemGroups.tools, SlimefunItems.COBALT_PICKAXE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.COBALT_INGOT, SlimefunItems.COBALT_INGOT, SlimefunItems.COBALT_INGOT, null, SlimefunItems.NICKEL_INGOT, null, null, SlimefunItems.NICKEL_INGOT, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.COBALT_INGOT.item(), SlimefunItems.COBALT_INGOT.item(), SlimefunItems.COBALT_INGOT.item(), null, SlimefunItems.NICKEL_INGOT.item(), null, null, SlimefunItems.NICKEL_INGOT.item(), null}) + .register(plugin); new UnplaceableBlock(itemGroups.magicalResources, SlimefunItems.NECROTIC_SKULL, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3, null, new ItemStack(Material.WITHER_SKELETON_SKULL), null, SlimefunItems.MAGIC_LUMP_3, null, SlimefunItems.MAGIC_LUMP_3}) - .register(plugin); + new ItemStack[] {SlimefunItems.MAGIC_LUMP_3.item(), null, SlimefunItems.MAGIC_LUMP_3.item(), null, new ItemStack(Material.WITHER_SKELETON_SKULL), null, SlimefunItems.MAGIC_LUMP_3.item(), null, SlimefunItems.MAGIC_LUMP_3.item()}) + .register(plugin); new SlimefunItem(itemGroups.magicalResources, SlimefunItems.ESSENCE_OF_AFTERLIFE, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {SlimefunItems.ENDER_LUMP_3, SlimefunItems.AIR_RUNE, SlimefunItems.ENDER_LUMP_3, SlimefunItems.EARTH_RUNE, SlimefunItems.NECROTIC_SKULL, SlimefunItems.FIRE_RUNE, SlimefunItems.ENDER_LUMP_3, SlimefunItems.WATER_RUNE, SlimefunItems.ENDER_LUMP_3}) - .register(plugin); + new ItemStack[] {SlimefunItems.ENDER_LUMP_3.item(), SlimefunItems.AIR_RUNE.item(), SlimefunItems.ENDER_LUMP_3.item(), SlimefunItems.EARTH_RUNE.item(), SlimefunItems.NECROTIC_SKULL.item(), SlimefunItems.FIRE_RUNE.item(), SlimefunItems.ENDER_LUMP_3.item(), SlimefunItems.WATER_RUNE.item(), SlimefunItems.ENDER_LUMP_3.item()}) + .register(plugin); new SlimefunItem(itemGroups.magicalResources, SlimefunItems.SYNTHETIC_SHULKER_SHELL, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {SlimefunItems.ENDER_LUMP_3, SlimefunItems.ENDER_RUNE, SlimefunItems.ENDER_LUMP_3, SlimefunItems.REINFORCED_PLATE, new ItemStack(Material.TURTLE_HELMET), SlimefunItems.REINFORCED_PLATE, SlimefunItems.ENDER_LUMP_3, SlimefunItems.ENDER_RUNE, SlimefunItems.ENDER_LUMP_3}) - .setUseableInWorkbench(true) - .register(plugin); + new ItemStack[] {SlimefunItems.ENDER_LUMP_3.item(), SlimefunItems.ENDER_RUNE.item(), SlimefunItems.ENDER_LUMP_3.item(), SlimefunItems.REINFORCED_PLATE.item(), new ItemStack(Material.TURTLE_HELMET), SlimefunItems.REINFORCED_PLATE.item(), SlimefunItems.ENDER_LUMP_3.item(), SlimefunItems.ENDER_RUNE.item(), SlimefunItems.ENDER_LUMP_3.item()}) + .setUseableInWorkbench(true) + .register(plugin); new SoulboundBackpack(36, itemGroups.magicalGadgets, SlimefunItems.BOUND_BACKPACK, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {SlimefunItems.ENDER_LUMP_2, null, SlimefunItems.ENDER_LUMP_2, SlimefunItems.ESSENCE_OF_AFTERLIFE, SlimefunItems.WOVEN_BACKPACK, SlimefunItems.ESSENCE_OF_AFTERLIFE, SlimefunItems.ENDER_LUMP_2, null, SlimefunItems.ENDER_LUMP_2}) - .register(plugin); + new ItemStack[] {SlimefunItems.ENDER_LUMP_2.item(), null, SlimefunItems.ENDER_LUMP_2.item(), SlimefunItems.ESSENCE_OF_AFTERLIFE.item(), SlimefunItems.WOVEN_BACKPACK.item(), SlimefunItems.ESSENCE_OF_AFTERLIFE.item(), SlimefunItems.ENDER_LUMP_2.item(), null, SlimefunItems.ENDER_LUMP_2.item()}) + .register(plugin); new JetBoots(itemGroups.technicalGadgets, SlimefunItems.DURALUMIN_JETBOOTS, - new ItemStack[] {null, null, null, SlimefunItems.DURALUMIN_INGOT, SlimefunItems.POWER_CRYSTAL, SlimefunItems.DURALUMIN_INGOT, SlimefunItems.STEEL_THRUSTER, SlimefunItems.SMALL_CAPACITOR, SlimefunItems.STEEL_THRUSTER}, - 0.35, 20) - .register(plugin); + new ItemStack[] {null, null, null, SlimefunItems.DURALUMIN_INGOT.item(), SlimefunItems.POWER_CRYSTAL.item(), SlimefunItems.DURALUMIN_INGOT.item(), SlimefunItems.STEEL_THRUSTER.item(), SlimefunItems.SMALL_CAPACITOR.item(), SlimefunItems.STEEL_THRUSTER.item()}, + 0.35, 20) + .register(plugin); new JetBoots(itemGroups.technicalGadgets, SlimefunItems.SOLDER_JETBOOTS, - new ItemStack[] {null, null, null, SlimefunItems.SOLDER_INGOT, SlimefunItems.POWER_CRYSTAL, SlimefunItems.SOLDER_INGOT, SlimefunItems.STEEL_THRUSTER, SlimefunItems.SMALL_CAPACITOR, SlimefunItems.STEEL_THRUSTER}, - 0.4, 30) - .register(plugin); + new ItemStack[] {null, null, null, SlimefunItems.SOLDER_INGOT.item(), SlimefunItems.POWER_CRYSTAL.item(), SlimefunItems.SOLDER_INGOT.item(), SlimefunItems.STEEL_THRUSTER.item(), SlimefunItems.SMALL_CAPACITOR.item(), SlimefunItems.STEEL_THRUSTER.item()}, + 0.4, 30) + .register(plugin); new JetBoots(itemGroups.technicalGadgets, SlimefunItems.BILLON_JETBOOTS, - new ItemStack[] {null, null, null, SlimefunItems.BILLON_INGOT, SlimefunItems.POWER_CRYSTAL, SlimefunItems.BILLON_INGOT, SlimefunItems.STEEL_THRUSTER, SlimefunItems.SMALL_CAPACITOR, SlimefunItems.STEEL_THRUSTER}, - 0.45, 40) - .register(plugin); + new ItemStack[] {null, null, null, SlimefunItems.BILLON_INGOT.item(), SlimefunItems.POWER_CRYSTAL.item(), SlimefunItems.BILLON_INGOT.item(), SlimefunItems.STEEL_THRUSTER.item(), SlimefunItems.SMALL_CAPACITOR.item(), SlimefunItems.STEEL_THRUSTER.item()}, + 0.45, 40) + .register(plugin); new JetBoots(itemGroups.technicalGadgets, SlimefunItems.STEEL_JETBOOTS, - new ItemStack[] {null, null, null, SlimefunItems.STEEL_INGOT, SlimefunItems.POWER_CRYSTAL, SlimefunItems.STEEL_INGOT, SlimefunItems.STEEL_THRUSTER, SlimefunItems.SMALL_CAPACITOR, SlimefunItems.STEEL_THRUSTER}, - 0.5, 50) - .register(plugin); + new ItemStack[] {null, null, null, SlimefunItems.STEEL_INGOT.item(), SlimefunItems.POWER_CRYSTAL.item(), SlimefunItems.STEEL_INGOT.item(), SlimefunItems.STEEL_THRUSTER.item(), SlimefunItems.SMALL_CAPACITOR.item(), SlimefunItems.STEEL_THRUSTER.item()}, + 0.5, 50) + .register(plugin); new JetBoots(itemGroups.technicalGadgets, SlimefunItems.DAMASCUS_STEEL_JETBOOTS, - new ItemStack[] {null, null, null, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.POWER_CRYSTAL, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.STEEL_THRUSTER, SlimefunItems.SMALL_CAPACITOR, SlimefunItems.STEEL_THRUSTER}, - 0.55, 75) - .register(plugin); + new ItemStack[] {null, null, null, SlimefunItems.DAMASCUS_STEEL_INGOT.item(), SlimefunItems.POWER_CRYSTAL.item(), SlimefunItems.DAMASCUS_STEEL_INGOT.item(), SlimefunItems.STEEL_THRUSTER.item(), SlimefunItems.SMALL_CAPACITOR.item(), SlimefunItems.STEEL_THRUSTER.item()}, + 0.55, 75) + .register(plugin); new JetBoots(itemGroups.technicalGadgets, SlimefunItems.REINFORCED_ALLOY_JETBOOTS, - new ItemStack[] {null, null, null, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.POWER_CRYSTAL, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.STEEL_THRUSTER, SlimefunItems.MEDIUM_CAPACITOR, SlimefunItems.STEEL_THRUSTER}, - 0.6, 100) - .register(plugin); + new ItemStack[] {null, null, null, SlimefunItems.REINFORCED_ALLOY_INGOT.item(), SlimefunItems.POWER_CRYSTAL.item(), SlimefunItems.REINFORCED_ALLOY_INGOT.item(), SlimefunItems.STEEL_THRUSTER.item(), SlimefunItems.MEDIUM_CAPACITOR.item(), SlimefunItems.STEEL_THRUSTER.item()}, + 0.6, 100) + .register(plugin); new JetBoots(itemGroups.technicalGadgets, SlimefunItems.CARBONADO_JETBOOTS, - new ItemStack[] {null, null, null, SlimefunItems.CARBONADO, SlimefunItems.POWER_CRYSTAL, SlimefunItems.CARBONADO, SlimefunItems.STEEL_THRUSTER, SlimefunItems.LARGE_CAPACITOR, SlimefunItems.STEEL_THRUSTER}, - 0.7, 125) - .register(plugin); + new ItemStack[] {null, null, null, SlimefunItems.CARBONADO.item(), SlimefunItems.POWER_CRYSTAL.item(), SlimefunItems.CARBONADO.item(), SlimefunItems.STEEL_THRUSTER.item(), SlimefunItems.LARGE_CAPACITOR.item(), SlimefunItems.STEEL_THRUSTER.item()}, + 0.7, 125) + .register(plugin); new JetBoots(itemGroups.technicalGadgets, SlimefunItems.ARMORED_JETBOOTS, - new ItemStack[] {null, null, null, SlimefunItems.STEEL_PLATE, SlimefunItems.POWER_CRYSTAL, SlimefunItems.STEEL_PLATE, SlimefunItems.STEEL_THRUSTER, SlimefunItems.MEDIUM_CAPACITOR, SlimefunItems.STEEL_THRUSTER}, - 0.45, 50) - .register(plugin); + new ItemStack[] {null, null, null, SlimefunItems.STEEL_PLATE.item(), SlimefunItems.POWER_CRYSTAL.item(), SlimefunItems.STEEL_PLATE.item(), SlimefunItems.STEEL_THRUSTER.item(), SlimefunItems.MEDIUM_CAPACITOR.item(), SlimefunItems.STEEL_THRUSTER.item()}, + 0.45, 50) + .register(plugin); new SeismicAxe(itemGroups.weapons, SlimefunItems.SEISMIC_AXE, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {SlimefunItems.HARDENED_METAL_INGOT, SlimefunItems.HARDENED_METAL_INGOT, null, SlimefunItems.HARDENED_METAL_INGOT, SlimefunItems.STAFF_ELEMENTAL, null, null, SlimefunItems.STAFF_ELEMENTAL, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.HARDENED_METAL_INGOT.item(), SlimefunItems.HARDENED_METAL_INGOT.item(), null, SlimefunItems.HARDENED_METAL_INGOT.item(), SlimefunItems.STAFF_ELEMENTAL.item(), null, null, SlimefunItems.STAFF_ELEMENTAL.item(), null}) + .register(plugin); new PickaxeOfVeinMining(itemGroups.tools, SlimefunItems.PICKAXE_OF_VEIN_MINING, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {new ItemStack(Material.EMERALD_ORE), SlimefunItems.SYNTHETIC_DIAMOND, new ItemStack(Material.EMERALD_ORE), null, SlimefunItems.GILDED_IRON, null, null, SlimefunItems.GILDED_IRON, null}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.EMERALD_ORE), SlimefunItems.SYNTHETIC_DIAMOND.item(), new ItemStack(Material.EMERALD_ORE), null, SlimefunItems.GILDED_IRON.item(), null, null, SlimefunItems.GILDED_IRON.item(), null}) + .register(plugin); new ClimbingPick(itemGroups.tools, SlimefunItems.CLIMBING_PICK, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.STEEL_INGOT, SlimefunItems.HARDENED_METAL_INGOT, SlimefunItems.STEEL_INGOT, null, new ItemStack(Material.STICK), null, null, new ItemStack(Material.STICK), null}) - .register(plugin); + new ItemStack[] {SlimefunItems.STEEL_INGOT.item(), SlimefunItems.HARDENED_METAL_INGOT.item(), SlimefunItems.STEEL_INGOT.item(), null, new ItemStack(Material.STICK), null, null, new ItemStack(Material.STICK), null}) + .register(plugin); new SoulboundItem(itemGroups.weapons, SlimefunItems.SOULBOUND_SWORD, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null, null, new ItemStack(Material.DIAMOND_SWORD), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE.item(), null, null, new ItemStack(Material.DIAMOND_SWORD), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE.item(), null}) + .register(plugin); new SoulboundItem(itemGroups.weapons, SlimefunItems.SOULBOUND_TRIDENT, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null, null, new ItemStack(Material.TRIDENT), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE.item(), null, null, new ItemStack(Material.TRIDENT), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE.item(), null}) + .register(plugin); new SoulboundItem(itemGroups.weapons, SlimefunItems.SOULBOUND_BOW, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null, null, new ItemStack(Material.BOW), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE.item(), null, null, new ItemStack(Material.BOW), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE.item(), null}) + .register(plugin); new SoulboundItem(itemGroups.tools, SlimefunItems.SOULBOUND_PICKAXE, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null, null, new ItemStack(Material.DIAMOND_PICKAXE), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE.item(), null, null, new ItemStack(Material.DIAMOND_PICKAXE), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE.item(), null}) + .register(plugin); new SoulboundItem(itemGroups.tools, SlimefunItems.SOULBOUND_AXE, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null, null, new ItemStack(Material.DIAMOND_AXE), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE.item(), null, null, new ItemStack(Material.DIAMOND_AXE), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE.item(), null}) + .register(plugin); new SoulboundItem(itemGroups.tools, SlimefunItems.SOULBOUND_SHOVEL, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null, null, new ItemStack(Material.DIAMOND_SHOVEL), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE.item(), null, null, new ItemStack(Material.DIAMOND_SHOVEL), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE.item(), null}) + .register(plugin); new SoulboundItem(itemGroups.tools, SlimefunItems.SOULBOUND_HOE, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null, null, new ItemStack(Material.DIAMOND_HOE), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE.item(), null, null, new ItemStack(Material.DIAMOND_HOE), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE.item(), null}) + .register(plugin); new SoulboundItem(itemGroups.magicalArmor, SlimefunItems.SOULBOUND_HELMET, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null, null, new ItemStack(Material.DIAMOND_HELMET), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE.item(), null, null, new ItemStack(Material.DIAMOND_HELMET), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE.item(), null}) + .register(plugin); new SoulboundItem(itemGroups.magicalArmor, SlimefunItems.SOULBOUND_CHESTPLATE, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null, null, new ItemStack(Material.DIAMOND_CHESTPLATE), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE.item(), null, null, new ItemStack(Material.DIAMOND_CHESTPLATE), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE.item(), null}) + .register(plugin); new SoulboundItem(itemGroups.magicalArmor, SlimefunItems.SOULBOUND_LEGGINGS, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null, null, new ItemStack(Material.DIAMOND_LEGGINGS), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE.item(), null, null, new ItemStack(Material.DIAMOND_LEGGINGS), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE.item(), null}) + .register(plugin); new SoulboundItem(itemGroups.magicalArmor, SlimefunItems.SOULBOUND_BOOTS, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null, null, new ItemStack(Material.DIAMOND_BOOTS), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.ESSENCE_OF_AFTERLIFE.item(), null, null, new ItemStack(Material.DIAMOND_BOOTS), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE.item(), null}) + .register(plugin); new Juicer(itemGroups.basicMachines, SlimefunItems.JUICER).register(plugin); new Juice(itemGroups.food, SlimefunItems.APPLE_JUICE, RecipeType.JUICER, - new ItemStack[] {new ItemStack(Material.APPLE), null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.APPLE), null, null, null, null, null, null, null, null}) + .register(plugin); new Juice(itemGroups.food, SlimefunItems.CARROT_JUICE, RecipeType.JUICER, - new ItemStack[] {new ItemStack(Material.CARROT), null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.CARROT), null, null, null, null, null, null, null, null}) + .register(plugin); new Juice(itemGroups.food, SlimefunItems.MELON_JUICE, RecipeType.JUICER, - new ItemStack[] {new ItemStack(Material.MELON_SLICE), null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.MELON_SLICE), null, null, null, null, null, null, null, null}) + .register(plugin); new Juice(itemGroups.food, SlimefunItems.PUMPKIN_JUICE, RecipeType.JUICER, - new ItemStack[] {new ItemStack(Material.PUMPKIN), null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.PUMPKIN), null, null, null, null, null, null, null, null}) + .register(plugin); new Juice(itemGroups.food, SlimefunItems.SWEET_BERRY_JUICE, RecipeType.JUICER, - new ItemStack[] {new ItemStack(Material.SWEET_BERRIES), null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.SWEET_BERRIES), null, null, null, null, null, null, null, null}) + .register(plugin); new Juice(itemGroups.food, SlimefunItems.GOLDEN_APPLE_JUICE, RecipeType.JUICER, - new ItemStack[] {new ItemStack(Material.GOLDEN_APPLE), null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.GOLDEN_APPLE), null, null, null, null, null, null, null, null}) + .register(plugin); new VanillaItem(itemGroups.food, new ItemStack(Material.ENCHANTED_GOLDEN_APPLE), "ENCHANTED_GOLDEN_APPLE", RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.GOLD_24K_BLOCK, SlimefunItems.GOLD_24K_BLOCK, SlimefunItems.GOLD_24K_BLOCK, SlimefunItems.GOLD_24K_BLOCK, new ItemStack(Material.APPLE), SlimefunItems.GOLD_24K_BLOCK, SlimefunItems.GOLD_24K_BLOCK, SlimefunItems.GOLD_24K_BLOCK, SlimefunItems.GOLD_24K_BLOCK}) - .register(plugin); + new ItemStack[] {SlimefunItems.GOLD_24K_BLOCK.item(), SlimefunItems.GOLD_24K_BLOCK.item(), SlimefunItems.GOLD_24K_BLOCK.item(), SlimefunItems.GOLD_24K_BLOCK.item(), new ItemStack(Material.APPLE), SlimefunItems.GOLD_24K_BLOCK.item(), SlimefunItems.GOLD_24K_BLOCK.item(), SlimefunItems.GOLD_24K_BLOCK.item(), SlimefunItems.GOLD_24K_BLOCK.item()}) + .register(plugin); new BrokenSpawner(itemGroups.magicalResources, SlimefunItems.BROKEN_SPAWNER, new RecipeType(new NamespacedKey(plugin, "pickaxe_of_containment"), SlimefunItems.PICKAXE_OF_CONTAINMENT), - new ItemStack[] {null, null, null, null, new ItemStack(Material.SPAWNER), null, null, null, null}) - .register(plugin); + new ItemStack[] {null, null, null, null, new ItemStack(Material.SPAWNER), null, null, null, null}) + .register(plugin); new RepairedSpawner(itemGroups.magicalGadgets, SlimefunItems.REPAIRED_SPAWNER, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {SlimefunItems.ENDER_RUNE, SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE, SlimefunItems.ESSENCE_OF_AFTERLIFE, SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE, SlimefunItems.BROKEN_SPAWNER, SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE, SlimefunItems.ESSENCE_OF_AFTERLIFE, SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE, SlimefunItems.ENDER_RUNE}) - .register(plugin); + new ItemStack[] {SlimefunItems.ENDER_RUNE.item(), SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE.item(), SlimefunItems.ESSENCE_OF_AFTERLIFE.item(), SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE.item(), SlimefunItems.BROKEN_SPAWNER.item(), SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE.item(), SlimefunItems.ESSENCE_OF_AFTERLIFE.item(), SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE.item(), SlimefunItems.ENDER_RUNE.item()}) + .register(plugin); new EnhancedFurnace(itemGroups.basicMachines, 1, 1, 1, SlimefunItems.ENHANCED_FURNACE, - new ItemStack[] {null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.BASIC_CIRCUIT_BOARD, new ItemStack(Material.FURNACE), SlimefunItems.HEATING_COIL, null, SlimefunItems.ELECTRIC_MOTOR, null}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.STEEL_INGOT.item(), null, SlimefunItems.BASIC_CIRCUIT_BOARD.item(), new ItemStack(Material.FURNACE), SlimefunItems.HEATING_COIL.item(), null, SlimefunItems.ELECTRIC_MOTOR.item(), null}) + .register(plugin); new EnhancedFurnace(itemGroups.basicMachines, 2, 1, 1, SlimefunItems.ENHANCED_FURNACE_2, - new ItemStack[] {null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.BASIC_CIRCUIT_BOARD, SlimefunItems.ENHANCED_FURNACE, SlimefunItems.HEATING_COIL, null, SlimefunItems.ELECTRIC_MOTOR, null}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.STEEL_INGOT.item(), null, SlimefunItems.BASIC_CIRCUIT_BOARD.item(), SlimefunItems.ENHANCED_FURNACE.item(), SlimefunItems.HEATING_COIL.item(), null, SlimefunItems.ELECTRIC_MOTOR.item(), null}) + .register(plugin); new EnhancedFurnace(itemGroups.basicMachines, 2, 2, 1, SlimefunItems.ENHANCED_FURNACE_3, - new ItemStack[] {null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.BASIC_CIRCUIT_BOARD, SlimefunItems.ENHANCED_FURNACE_2, SlimefunItems.HEATING_COIL, null, SlimefunItems.ELECTRIC_MOTOR, null}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.STEEL_INGOT.item(), null, SlimefunItems.BASIC_CIRCUIT_BOARD.item(), SlimefunItems.ENHANCED_FURNACE_2.item(), SlimefunItems.HEATING_COIL.item(), null, SlimefunItems.ELECTRIC_MOTOR.item(), null}) + .register(plugin); new EnhancedFurnace(itemGroups.basicMachines, 3, 2, 1, SlimefunItems.ENHANCED_FURNACE_4, - new ItemStack[] {null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.BASIC_CIRCUIT_BOARD, SlimefunItems.ENHANCED_FURNACE_3, SlimefunItems.HEATING_COIL, null, SlimefunItems.ELECTRIC_MOTOR, null}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.STEEL_INGOT.item(), null, SlimefunItems.BASIC_CIRCUIT_BOARD.item(), SlimefunItems.ENHANCED_FURNACE_3.item(), SlimefunItems.HEATING_COIL.item(), null, SlimefunItems.ELECTRIC_MOTOR.item(), null}) + .register(plugin); new EnhancedFurnace(itemGroups.basicMachines, 3, 2, 2, SlimefunItems.ENHANCED_FURNACE_5, - new ItemStack[] {null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.BASIC_CIRCUIT_BOARD, SlimefunItems.ENHANCED_FURNACE_4, SlimefunItems.HEATING_COIL, null, SlimefunItems.ELECTRIC_MOTOR, null}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.STEEL_INGOT.item(), null, SlimefunItems.BASIC_CIRCUIT_BOARD.item(), SlimefunItems.ENHANCED_FURNACE_4.item(), SlimefunItems.HEATING_COIL.item(), null, SlimefunItems.ELECTRIC_MOTOR.item(), null}) + .register(plugin); new EnhancedFurnace(itemGroups.basicMachines, 3, 3, 2, SlimefunItems.ENHANCED_FURNACE_6, - new ItemStack[] {null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.BASIC_CIRCUIT_BOARD, SlimefunItems.ENHANCED_FURNACE_5, SlimefunItems.HEATING_COIL, null, SlimefunItems.ELECTRIC_MOTOR, null}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.STEEL_INGOT.item(), null, SlimefunItems.BASIC_CIRCUIT_BOARD.item(), SlimefunItems.ENHANCED_FURNACE_5.item(), SlimefunItems.HEATING_COIL.item(), null, SlimefunItems.ELECTRIC_MOTOR.item(), null}) + .register(plugin); new EnhancedFurnace(itemGroups.basicMachines, 4, 3, 2, SlimefunItems.ENHANCED_FURNACE_7, - new ItemStack[] {null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.BASIC_CIRCUIT_BOARD, SlimefunItems.ENHANCED_FURNACE_6, SlimefunItems.HEATING_COIL, null, SlimefunItems.ELECTRIC_MOTOR, null}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.STEEL_INGOT.item(), null, SlimefunItems.BASIC_CIRCUIT_BOARD.item(), SlimefunItems.ENHANCED_FURNACE_6.item(), SlimefunItems.HEATING_COIL.item(), null, SlimefunItems.ELECTRIC_MOTOR.item(), null}) + .register(plugin); new EnhancedFurnace(itemGroups.basicMachines, 4, 4, 2, SlimefunItems.ENHANCED_FURNACE_8, - new ItemStack[] {null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.BASIC_CIRCUIT_BOARD, SlimefunItems.ENHANCED_FURNACE_7, SlimefunItems.HEATING_COIL, null, SlimefunItems.ELECTRIC_MOTOR, null}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.STEEL_INGOT.item(), null, SlimefunItems.BASIC_CIRCUIT_BOARD.item(), SlimefunItems.ENHANCED_FURNACE_7.item(), SlimefunItems.HEATING_COIL.item(), null, SlimefunItems.ELECTRIC_MOTOR.item(), null}) + .register(plugin); new EnhancedFurnace(itemGroups.basicMachines, 5, 4, 2, SlimefunItems.ENHANCED_FURNACE_9, - new ItemStack[] {null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.BASIC_CIRCUIT_BOARD, SlimefunItems.ENHANCED_FURNACE_8, SlimefunItems.HEATING_COIL, null, SlimefunItems.ELECTRIC_MOTOR, null}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.STEEL_INGOT.item(), null, SlimefunItems.BASIC_CIRCUIT_BOARD.item(), SlimefunItems.ENHANCED_FURNACE_8.item(), SlimefunItems.HEATING_COIL.item(), null, SlimefunItems.ELECTRIC_MOTOR.item(), null}) + .register(plugin); new EnhancedFurnace(itemGroups.basicMachines, 5, 5, 2, SlimefunItems.ENHANCED_FURNACE_10, - new ItemStack[] {null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.BASIC_CIRCUIT_BOARD, SlimefunItems.ENHANCED_FURNACE_9, SlimefunItems.HEATING_COIL, null, SlimefunItems.ELECTRIC_MOTOR, null}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.STEEL_INGOT.item(), null, SlimefunItems.BASIC_CIRCUIT_BOARD.item(), SlimefunItems.ENHANCED_FURNACE_9.item(), SlimefunItems.HEATING_COIL.item(), null, SlimefunItems.ELECTRIC_MOTOR.item(), null}) + .register(plugin); new EnhancedFurnace(itemGroups.basicMachines, 5, 5, 3, SlimefunItems.ENHANCED_FURNACE_11, - new ItemStack[] {null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.BASIC_CIRCUIT_BOARD, SlimefunItems.ENHANCED_FURNACE_10, SlimefunItems.HEATING_COIL, null, SlimefunItems.ELECTRIC_MOTOR, null}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.STEEL_INGOT.item(), null, SlimefunItems.BASIC_CIRCUIT_BOARD.item(), SlimefunItems.ENHANCED_FURNACE_10.item(), SlimefunItems.HEATING_COIL.item(), null, SlimefunItems.ELECTRIC_MOTOR.item(), null}) + .register(plugin); new EnhancedFurnace(itemGroups.basicMachines, 10, 10, 3, SlimefunItems.REINFORCED_FURNACE, - new ItemStack[] {SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.BASIC_CIRCUIT_BOARD, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.HEATING_COIL, SlimefunItems.ENHANCED_FURNACE_11, SlimefunItems.HEATING_COIL, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.REINFORCED_ALLOY_INGOT}) - .register(plugin); + new ItemStack[] {SlimefunItems.REINFORCED_ALLOY_INGOT.item(), SlimefunItems.BASIC_CIRCUIT_BOARD.item(), SlimefunItems.REINFORCED_ALLOY_INGOT.item(), SlimefunItems.HEATING_COIL.item(), SlimefunItems.ENHANCED_FURNACE_11.item(), SlimefunItems.HEATING_COIL.item(), SlimefunItems.REINFORCED_ALLOY_INGOT.item(), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.REINFORCED_ALLOY_INGOT.item()}) + .register(plugin); new EnhancedFurnace(itemGroups.basicMachines, 20, 10, 3, SlimefunItems.CARBONADO_EDGED_FURNACE, - new ItemStack[] {SlimefunItems.CARBONADO, SlimefunItems.BASIC_CIRCUIT_BOARD, SlimefunItems.CARBONADO, SlimefunItems.HEATING_COIL, SlimefunItems.REINFORCED_FURNACE, SlimefunItems.HEATING_COIL, SlimefunItems.CARBONADO, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.CARBONADO}) - .register(plugin); + new ItemStack[] {SlimefunItems.CARBONADO.item(), SlimefunItems.BASIC_CIRCUIT_BOARD.item(), SlimefunItems.CARBONADO.item(), SlimefunItems.HEATING_COIL.item(), SlimefunItems.REINFORCED_FURNACE.item(), SlimefunItems.HEATING_COIL.item(), SlimefunItems.CARBONADO.item(), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.CARBONADO.item()}) + .register(plugin); new UnplaceableBlock(itemGroups.technicalComponents, SlimefunItems.ELECTRO_MAGNET, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.NICKEL_INGOT, SlimefunItems.MAGNET, SlimefunItems.COBALT_INGOT, null, SlimefunItems.BATTERY, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.NICKEL_INGOT.item(), SlimefunItems.MAGNET.item(), SlimefunItems.COBALT_INGOT.item(), null, SlimefunItems.BATTERY.item(), null, null, null, null}) + .register(plugin); new UnplaceableBlock(itemGroups.technicalComponents, SlimefunItems.ELECTRIC_MOTOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.COPPER_WIRE, SlimefunItems.COPPER_WIRE, SlimefunItems.COPPER_WIRE, null, SlimefunItems.ELECTRO_MAGNET, null, SlimefunItems.COPPER_WIRE, SlimefunItems.COPPER_WIRE, SlimefunItems.COPPER_WIRE}) - .register(plugin); + new ItemStack[] {SlimefunItems.COPPER_WIRE.item(), SlimefunItems.COPPER_WIRE.item(), SlimefunItems.COPPER_WIRE.item(), null, SlimefunItems.ELECTRO_MAGNET.item(), null, SlimefunItems.COPPER_WIRE.item(), SlimefunItems.COPPER_WIRE.item(), SlimefunItems.COPPER_WIRE.item()}) + .register(plugin); new UnplaceableBlock(itemGroups.technicalComponents, SlimefunItems.HEATING_COIL, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.COPPER_WIRE, SlimefunItems.COPPER_WIRE, SlimefunItems.COPPER_WIRE, SlimefunItems.COPPER_WIRE, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.COPPER_WIRE, SlimefunItems.COPPER_WIRE, SlimefunItems.COPPER_WIRE, SlimefunItems.COPPER_WIRE}) - .register(plugin); + new ItemStack[] {SlimefunItems.COPPER_WIRE.item(), SlimefunItems.COPPER_WIRE.item(), SlimefunItems.COPPER_WIRE.item(), SlimefunItems.COPPER_WIRE.item(), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.COPPER_WIRE.item(), SlimefunItems.COPPER_WIRE.item(), SlimefunItems.COPPER_WIRE.item(), SlimefunItems.COPPER_WIRE.item()}) + .register(plugin); new UnplaceableBlock(itemGroups.technicalComponents, SlimefunItems.COPPER_WIRE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, null, null, SlimefunItems.COPPER_INGOT, SlimefunItems.COPPER_INGOT, SlimefunItems.COPPER_INGOT, null, null, null}, - new SlimefunItemStack(SlimefunItems.COPPER_WIRE, 8)) - .register(plugin); + new ItemStack[] {null, null, null, SlimefunItems.COPPER_INGOT.item(), SlimefunItems.COPPER_INGOT.item(), SlimefunItems.COPPER_INGOT.item(), null, null, null}, + new SlimefunItemStack(SlimefunItems.COPPER_WIRE, 8).item()) + .register(plugin); new BlockPlacer(itemGroups.basicMachines, SlimefunItems.BLOCK_PLACER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.GOLD_4K, new ItemStack(Material.PISTON), SlimefunItems.GOLD_4K, new ItemStack(Material.IRON_INGOT), SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.IRON_INGOT), SlimefunItems.GOLD_4K, new ItemStack(Material.PISTON), SlimefunItems.GOLD_4K}) - .register(plugin); + new ItemStack[] {SlimefunItems.GOLD_4K.item(), new ItemStack(Material.PISTON), SlimefunItems.GOLD_4K.item(), new ItemStack(Material.IRON_INGOT), SlimefunItems.ELECTRIC_MOTOR.item(), new ItemStack(Material.IRON_INGOT), SlimefunItems.GOLD_4K.item(), new ItemStack(Material.PISTON), SlimefunItems.GOLD_4K.item()}) + .register(plugin); new TelepositionScroll(itemGroups.magicalGadgets, SlimefunItems.SCROLL_OF_DIMENSIONAL_TELEPOSITION, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, SlimefunItems.ENDER_LUMP_3, SlimefunItems.MAGIC_EYE_OF_ENDER, SlimefunItems.ENDER_LUMP_3, SlimefunItems.MAGICAL_BOOK_COVER, SlimefunItems.ENDER_LUMP_3, SlimefunItems.MAGIC_EYE_OF_ENDER, SlimefunItems.ENDER_LUMP_3, null}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.ENDER_LUMP_3.item(), SlimefunItems.MAGIC_EYE_OF_ENDER.item(), SlimefunItems.ENDER_LUMP_3.item(), SlimefunItems.MAGICAL_BOOK_COVER.item(), SlimefunItems.ENDER_LUMP_3.item(), SlimefunItems.MAGIC_EYE_OF_ENDER.item(), SlimefunItems.ENDER_LUMP_3.item(), null}) + .register(plugin); new ExplosiveBow(itemGroups.weapons, SlimefunItems.EXPLOSIVE_BOW, - new ItemStack[] {null, new ItemStack(Material.STICK), new ItemStack(Material.GUNPOWDER), SlimefunItems.STAFF_FIRE, null, SlimefunItems.SULFATE, null, new ItemStack(Material.STICK), new ItemStack(Material.GUNPOWDER)}) - .register(plugin); + new ItemStack[] {null, new ItemStack(Material.STICK), new ItemStack(Material.GUNPOWDER), SlimefunItems.STAFF_FIRE.item(), null, SlimefunItems.SULFATE.item(), null, new ItemStack(Material.STICK), new ItemStack(Material.GUNPOWDER)}) + .register(plugin); new IcyBow(itemGroups.weapons, SlimefunItems.ICY_BOW, - new ItemStack[] {null, new ItemStack(Material.STICK), new ItemStack(Material.ICE), SlimefunItems.STAFF_WATER, null, new ItemStack(Material.PACKED_ICE), null, new ItemStack(Material.STICK), new ItemStack(Material.ICE)}) - .register(plugin); + new ItemStack[] {null, new ItemStack(Material.STICK), new ItemStack(Material.ICE), SlimefunItems.STAFF_WATER.item(), null, new ItemStack(Material.PACKED_ICE), null, new ItemStack(Material.STICK), new ItemStack(Material.ICE)}) + .register(plugin); new KnowledgeTome(itemGroups.magicalGadgets, SlimefunItems.TOME_OF_KNOWLEDGE_SHARING, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, new ItemStack(Material.FEATHER), null, new ItemStack(Material.INK_SAC), SlimefunItems.MAGICAL_BOOK_COVER, new ItemStack(Material.GLASS_BOTTLE), null, new ItemStack(Material.WRITABLE_BOOK), null}) - .register(plugin); + new ItemStack[] {null, new ItemStack(Material.FEATHER), null, new ItemStack(Material.INK_SAC), SlimefunItems.MAGICAL_BOOK_COVER.item(), new ItemStack(Material.GLASS_BOTTLE), null, new ItemStack(Material.WRITABLE_BOOK), null}) + .register(plugin); new KnowledgeFlask(itemGroups.magicalGadgets, SlimefunItems.FLASK_OF_KNOWLEDGE, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, null, null, SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.GLASS_PANE), SlimefunItems.MAGIC_LUMP_2, null, SlimefunItems.MAGIC_LUMP_2, null}, - new SlimefunItemStack(SlimefunItems.FLASK_OF_KNOWLEDGE, 8)) - .register(plugin); + new ItemStack[] {null, null, null, SlimefunItems.MAGIC_LUMP_2.item(), new ItemStack(Material.GLASS_PANE), SlimefunItems.MAGIC_LUMP_2.item(), null, SlimefunItems.MAGIC_LUMP_2.item(), null}, + new SlimefunItemStack(SlimefunItems.FLASK_OF_KNOWLEDGE, 8).item()) + .register(plugin); new HiddenItem(itemGroups.magicalGadgets, SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE, RecipeType.INTERACT, - new ItemStack[] {SlimefunItems.FLASK_OF_KNOWLEDGE, null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.FLASK_OF_KNOWLEDGE.item(), null, null, null, null, null, null, null, null}) + .register(plugin); new BirthdayCake(itemGroups.birthday, new SlimefunItemStack("BIRTHDAY_CAKE", Material.CAKE, "&bBirthday Cake"), RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.TORCH), null, new ItemStack(Material.SUGAR), new ItemStack(Material.CAKE), new ItemStack(Material.SUGAR), null, null, null}) - .register(plugin); + new ItemStack[] {null, new ItemStack(Material.TORCH), null, new ItemStack(Material.SUGAR), new ItemStack(Material.CAKE), new ItemStack(Material.SUGAR), null, null, null}) + .register(plugin); new Juice(itemGroups.christmas, SlimefunItems.CHRISTMAS_MILK, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.MILK_BUCKET), new ItemStack(Material.GLASS_BOTTLE), null, null, null, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.CHRISTMAS_MILK, 4)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.MILK_BUCKET), new ItemStack(Material.GLASS_BOTTLE), null, null, null, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.CHRISTMAS_MILK, 4).item()) + .register(plugin); new Juice(itemGroups.christmas, SlimefunItems.CHRISTMAS_CHOCOLATE_MILK, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.CHRISTMAS_MILK, new ItemStack(Material.COCOA_BEANS), null, null, null, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.CHRISTMAS_CHOCOLATE_MILK, 2)) - .register(plugin); + new ItemStack[] {SlimefunItems.CHRISTMAS_MILK.item(), new ItemStack(Material.COCOA_BEANS), null, null, null, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.CHRISTMAS_CHOCOLATE_MILK, 2).item()) + .register(plugin); new Juice(itemGroups.christmas, SlimefunItems.CHRISTMAS_EGG_NOG, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.CHRISTMAS_MILK, new ItemStack(Material.EGG), null, null, null, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.CHRISTMAS_EGG_NOG, 2)) - .register(plugin); + new ItemStack[] {SlimefunItems.CHRISTMAS_MILK.item(), new ItemStack(Material.EGG), null, null, null, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.CHRISTMAS_EGG_NOG, 2).item()) + .register(plugin); new Juice(itemGroups.christmas, SlimefunItems.CHRISTMAS_APPLE_CIDER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.APPLE_JUICE, new ItemStack(Material.SUGAR), null, null, null, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.CHRISTMAS_APPLE_CIDER, 2)) - .register(plugin); + new ItemStack[] {SlimefunItems.APPLE_JUICE.item(), new ItemStack(Material.SUGAR), null, null, null, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.CHRISTMAS_APPLE_CIDER, 2).item()) + .register(plugin); new SlimefunItem(itemGroups.christmas, SlimefunItems.CHRISTMAS_COOKIE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.COOKIE), new ItemStack(Material.SUGAR), new ItemStack(Material.LIME_DYE), null, null, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.CHRISTMAS_COOKIE, 16)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.COOKIE), new ItemStack(Material.SUGAR), new ItemStack(Material.LIME_DYE), null, null, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.CHRISTMAS_COOKIE, 16).item()) + .register(plugin); new SlimefunItem(itemGroups.christmas, SlimefunItems.CHRISTMAS_FRUIT_CAKE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.EGG), new ItemStack(Material.APPLE), new ItemStack(Material.MELON), new ItemStack(Material.SUGAR), null, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.CHRISTMAS_FRUIT_CAKE, 4)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.EGG), new ItemStack(Material.APPLE), new ItemStack(Material.MELON), new ItemStack(Material.SUGAR), null, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.CHRISTMAS_FRUIT_CAKE, 4).item()) + .register(plugin); new SlimefunItem(itemGroups.christmas, SlimefunItems.CHRISTMAS_APPLE_PIE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.SUGAR), new ItemStack(Material.APPLE), new ItemStack(Material.EGG), null, null, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.CHRISTMAS_APPLE_PIE, 2)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.SUGAR), new ItemStack(Material.APPLE), new ItemStack(Material.EGG), null, null, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.CHRISTMAS_APPLE_PIE, 2).item()) + .register(plugin); new Juice(itemGroups.christmas, SlimefunItems.CHRISTMAS_HOT_CHOCOLATE, RecipeType.SMELTERY, - new ItemStack[] {SlimefunItems.CHRISTMAS_CHOCOLATE_MILK, null, null, null, null, null, null, null, null}, SlimefunItems.CHRISTMAS_HOT_CHOCOLATE) - .register(plugin); + new ItemStack[] {SlimefunItems.CHRISTMAS_CHOCOLATE_MILK.item(), null, null, null, null, null, null, null, null}, SlimefunItems.CHRISTMAS_HOT_CHOCOLATE.item()) + .register(plugin); new SlimefunItem(itemGroups.christmas, SlimefunItems.CHRISTMAS_CAKE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.EGG), new ItemStack(Material.SUGAR), SlimefunItems.WHEAT_FLOUR, new ItemStack(Material.MILK_BUCKET), null, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.CHRISTMAS_CAKE, 4)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.EGG), new ItemStack(Material.SUGAR), SlimefunItems.WHEAT_FLOUR.item(), new ItemStack(Material.MILK_BUCKET), null, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.CHRISTMAS_CAKE, 4).item()) + .register(plugin); new SlimefunItem(itemGroups.christmas, SlimefunItems.CHRISTMAS_CARAMEL, RecipeType.SMELTERY, - new ItemStack[] {new ItemStack(Material.SUGAR), new ItemStack(Material.SUGAR), null, null, null, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.CHRISTMAS_CARAMEL, 4)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.SUGAR), new ItemStack(Material.SUGAR), null, null, null, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.CHRISTMAS_CARAMEL, 4).item()) + .register(plugin); new SlimefunItem(itemGroups.christmas, SlimefunItems.CHRISTMAS_CARAMEL_APPLE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.CHRISTMAS_CARAMEL, null, null, new ItemStack(Material.APPLE), null, null, new ItemStack(Material.STICK), null}, - new SlimefunItemStack(SlimefunItems.CHRISTMAS_CARAMEL_APPLE, 2)) - .register(plugin); + new ItemStack[] {null, SlimefunItems.CHRISTMAS_CARAMEL.item(), null, null, new ItemStack(Material.APPLE), null, null, new ItemStack(Material.STICK), null}, + new SlimefunItemStack(SlimefunItems.CHRISTMAS_CARAMEL_APPLE, 2).item()) + .register(plugin); new SlimefunItem(itemGroups.christmas, SlimefunItems.CHRISTMAS_CHOCOLATE_APPLE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.COCOA_BEANS), null, null, new ItemStack(Material.APPLE), null, null, new ItemStack(Material.STICK), null}, - new SlimefunItemStack(SlimefunItems.CHRISTMAS_CHOCOLATE_APPLE, 2)) - .register(plugin); + new ItemStack[] {null, new ItemStack(Material.COCOA_BEANS), null, null, new ItemStack(Material.APPLE), null, null, new ItemStack(Material.STICK), null}, + new SlimefunItemStack(SlimefunItems.CHRISTMAS_CHOCOLATE_APPLE, 2).item()) + .register(plugin); new ChristmasPresent(itemGroups.christmas, SlimefunItems.CHRISTMAS_PRESENT, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, new ItemStack(Material.NAME_TAG), null, new ItemStack(Material.RED_WOOL), new ItemStack(Material.GREEN_WOOL), new ItemStack(Material.RED_WOOL), new ItemStack(Material.RED_WOOL), new ItemStack(Material.GREEN_WOOL), new ItemStack(Material.RED_WOOL)}, - new SlimefunItemStack(SlimefunItems.CHRISTMAS_HOT_CHOCOLATE, 1), - new SlimefunItemStack(SlimefunItems.CHRISTMAS_CHOCOLATE_APPLE, 4), - new SlimefunItemStack(SlimefunItems.CHRISTMAS_CARAMEL_APPLE, 4), - new SlimefunItemStack(SlimefunItems.CHRISTMAS_CAKE, 4), - new SlimefunItemStack(SlimefunItems.CHRISTMAS_COOKIE, 8), - new SlimefunItemStack(SlimefunItems.CHRISTMAS_PRESENT, 1), - new SlimefunItemStack(SlimefunItems.CHRISTMAS_EGG_NOG, 1), - new SlimefunItemStack(SlimefunItems.CHRISTMAS_MILK, 1), - new SlimefunItemStack(SlimefunItems.CHRISTMAS_APPLE_CIDER, 1), - new SlimefunItemStack(SlimefunItems.CHRISTMAS_FRUIT_CAKE, 4), - new SlimefunItemStack(SlimefunItems.CHRISTMAS_APPLE_PIE, 4), - new ItemStack(Material.EMERALD) + new ItemStack[] {null, new ItemStack(Material.NAME_TAG), null, new ItemStack(Material.RED_WOOL), new ItemStack(Material.GREEN_WOOL), new ItemStack(Material.RED_WOOL), new ItemStack(Material.RED_WOOL), new ItemStack(Material.GREEN_WOOL), new ItemStack(Material.RED_WOOL)}, + new SlimefunItemStack(SlimefunItems.CHRISTMAS_HOT_CHOCOLATE, 1).item(), + new SlimefunItemStack(SlimefunItems.CHRISTMAS_CHOCOLATE_APPLE, 4).item(), + new SlimefunItemStack(SlimefunItems.CHRISTMAS_CARAMEL_APPLE, 4).item(), + new SlimefunItemStack(SlimefunItems.CHRISTMAS_CAKE, 4).item(), + new SlimefunItemStack(SlimefunItems.CHRISTMAS_COOKIE, 8).item(), + new SlimefunItemStack(SlimefunItems.CHRISTMAS_PRESENT, 1).item(), + new SlimefunItemStack(SlimefunItems.CHRISTMAS_EGG_NOG, 1).item(), + new SlimefunItemStack(SlimefunItems.CHRISTMAS_MILK, 1).item(), + new SlimefunItemStack(SlimefunItems.CHRISTMAS_APPLE_CIDER, 1).item(), + new SlimefunItemStack(SlimefunItems.CHRISTMAS_FRUIT_CAKE, 4).item(), + new SlimefunItemStack(SlimefunItems.CHRISTMAS_APPLE_PIE, 4).item(), + new ItemStack(Material.EMERALD) ).register(plugin); new SlimefunItem(itemGroups.easter, SlimefunItems.EASTER_CARROT_PIE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.SUGAR), new ItemStack(Material.CARROT), new ItemStack(Material.EGG), null, null, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.EASTER_CARROT_PIE, 2)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.SUGAR), new ItemStack(Material.CARROT), new ItemStack(Material.EGG), null, null, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.EASTER_CARROT_PIE, 2).item()) + .register(plugin); new SlimefunItem(itemGroups.easter, SlimefunItems.EASTER_APPLE_PIE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.SUGAR), new ItemStack(Material.APPLE), new ItemStack(Material.EGG), null, null, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.EASTER_APPLE_PIE, 2)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.SUGAR), new ItemStack(Material.APPLE), new ItemStack(Material.EGG), null, null, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.EASTER_APPLE_PIE, 2).item()) + .register(plugin); new EasterEgg(itemGroups.easter, SlimefunItems.EASTER_EGG, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, null, null, new ItemStack(Material.LIME_DYE), new ItemStack(Material.EGG), new ItemStack(Material.PURPLE_DYE), null, null, null}, - new SlimefunItemStack(SlimefunItems.EASTER_EGG, 2), - // Gifts: - new SlimefunItemStack(SlimefunItems.EASTER_CARROT_PIE, 4), - new SlimefunItemStack(SlimefunItems.CARROT_JUICE, 1), - new ItemStack(Material.EMERALD), - new ItemStack(Material.CAKE), - new ItemStack(Material.RABBIT_FOOT), - new ItemStack(Material.GOLDEN_CARROT, 4) + new ItemStack[] {null, null, null, new ItemStack(Material.LIME_DYE), new ItemStack(Material.EGG), new ItemStack(Material.PURPLE_DYE), null, null, null}, + new SlimefunItemStack(SlimefunItems.EASTER_EGG, 2).item(), + // Gifts: + new SlimefunItemStack(SlimefunItems.EASTER_CARROT_PIE, 4).item(), + new SlimefunItemStack(SlimefunItems.CARROT_JUICE, 1).item(), + new ItemStack(Material.EMERALD), + new ItemStack(Material.CAKE), + new ItemStack(Material.RABBIT_FOOT), + new ItemStack(Material.GOLDEN_CARROT, 4) ).register(plugin); itemGroups.rickFlexGroup.register(plugin); new SlimefunItem(itemGroups.misc, SlimefunItems.REINFORCED_PLATE, RecipeType.COMPRESSOR, - new ItemStack[] {new SlimefunItemStack(SlimefunItems.REINFORCED_ALLOY_INGOT, 8), null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {new SlimefunItemStack(SlimefunItems.REINFORCED_ALLOY_INGOT, 8).item(), null, null, null, null, null, null, null, null}) + .register(plugin); new HardenedGlass(itemGroups.technicalComponents, SlimefunItems.HARDENED_GLASS, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.GLASS), new ItemStack(Material.GLASS), new ItemStack(Material.GLASS), new ItemStack(Material.GLASS), SlimefunItems.REINFORCED_PLATE, new ItemStack(Material.GLASS), new ItemStack(Material.GLASS), new ItemStack(Material.GLASS), new ItemStack(Material.GLASS)}, - new SlimefunItemStack(SlimefunItems.HARDENED_GLASS, 16)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.GLASS), new ItemStack(Material.GLASS), new ItemStack(Material.GLASS), new ItemStack(Material.GLASS), SlimefunItems.REINFORCED_PLATE.item(), new ItemStack(Material.GLASS), new ItemStack(Material.GLASS), new ItemStack(Material.GLASS), new ItemStack(Material.GLASS)}, + new SlimefunItemStack(SlimefunItems.HARDENED_GLASS, 16).item()) + .register(plugin); new UnplaceableBlock(itemGroups.technicalComponents, SlimefunItems.COOLING_UNIT, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.ICE), new ItemStack(Material.ICE), new ItemStack(Material.ICE), SlimefunItems.ALUMINUM_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ALUMINUM_INGOT, new ItemStack(Material.ICE), new ItemStack(Material.ICE), new ItemStack(Material.ICE)}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.ICE), new ItemStack(Material.ICE), new ItemStack(Material.ICE), SlimefunItems.ALUMINUM_INGOT.item(), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.ALUMINUM_INGOT.item(), new ItemStack(Material.ICE), new ItemStack(Material.ICE), new ItemStack(Material.ICE)}) + .register(plugin); new Cooler(27, itemGroups.usefulItems, SlimefunItems.COOLER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.CLOTH, SlimefunItems.CLOTH, SlimefunItems.CLOTH, SlimefunItems.ALUMINUM_INGOT, SlimefunItems.COOLING_UNIT, SlimefunItems.ALUMINUM_INGOT, SlimefunItems.ALUMINUM_INGOT, SlimefunItems.ALUMINUM_INGOT, SlimefunItems.ALUMINUM_INGOT}) - .register(plugin); + new ItemStack[] {SlimefunItems.CLOTH.item(), SlimefunItems.CLOTH.item(), SlimefunItems.CLOTH.item(), SlimefunItems.ALUMINUM_INGOT.item(), SlimefunItems.COOLING_UNIT.item(), SlimefunItems.ALUMINUM_INGOT.item(), SlimefunItems.ALUMINUM_INGOT.item(), SlimefunItems.ALUMINUM_INGOT.item(), SlimefunItems.ALUMINUM_INGOT.item()}) + .register(plugin); new WitherProofBlock(itemGroups.technicalComponents, SlimefunItems.WITHER_PROOF_OBSIDIAN, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.LEAD_INGOT, new ItemStack(Material.OBSIDIAN), SlimefunItems.LEAD_INGOT, new ItemStack(Material.OBSIDIAN), SlimefunItems.HARDENED_GLASS, new ItemStack(Material.OBSIDIAN), SlimefunItems.LEAD_INGOT, new ItemStack(Material.OBSIDIAN), SlimefunItems.LEAD_INGOT}, - new SlimefunItemStack(SlimefunItems.WITHER_PROOF_OBSIDIAN, 4)) - .register(plugin); + new ItemStack[] {SlimefunItems.LEAD_INGOT.item(), new ItemStack(Material.OBSIDIAN), SlimefunItems.LEAD_INGOT.item(), new ItemStack(Material.OBSIDIAN), SlimefunItems.HARDENED_GLASS.item(), new ItemStack(Material.OBSIDIAN), SlimefunItems.LEAD_INGOT.item(), new ItemStack(Material.OBSIDIAN), SlimefunItems.LEAD_INGOT.item()}, + new SlimefunItemStack(SlimefunItems.WITHER_PROOF_OBSIDIAN, 4).item()) + .register(plugin); new AncientPedestal(itemGroups.magicalGadgets, SlimefunItems.ANCIENT_PEDESTAL, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {new ItemStack(Material.OBSIDIAN), SlimefunItems.GOLD_8K, new ItemStack(Material.OBSIDIAN), null, new ItemStack(Material.STONE), null, new ItemStack(Material.OBSIDIAN), SlimefunItems.GOLD_8K, new ItemStack(Material.OBSIDIAN)}, - new SlimefunItemStack(SlimefunItems.ANCIENT_PEDESTAL, 4)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.OBSIDIAN), SlimefunItems.GOLD_8K.item(), new ItemStack(Material.OBSIDIAN), null, new ItemStack(Material.STONE), null, new ItemStack(Material.OBSIDIAN), SlimefunItems.GOLD_8K.item(), new ItemStack(Material.OBSIDIAN)}, + new SlimefunItemStack(SlimefunItems.ANCIENT_PEDESTAL, 4).item()) + .register(plugin); new AncientAltar(itemGroups.magicalGadgets, SlimefunItems.ANCIENT_ALTAR, RecipeType.MAGIC_WORKBENCH, - new ItemStack[] {null, new ItemStack(Material.ENCHANTING_TABLE), null, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.GOLD_8K, SlimefunItems.MAGIC_LUMP_3, new ItemStack(Material.OBSIDIAN), SlimefunItems.GOLD_8K, new ItemStack(Material.OBSIDIAN)}) - .register(plugin); + new ItemStack[] {null, new ItemStack(Material.ENCHANTING_TABLE), null, SlimefunItems.MAGIC_LUMP_3.item(), SlimefunItems.GOLD_8K.item(), SlimefunItems.MAGIC_LUMP_3.item(), new ItemStack(Material.OBSIDIAN), SlimefunItems.GOLD_8K.item(), new ItemStack(Material.OBSIDIAN)}) + .register(plugin); new EnergyRegulator(itemGroups.electricity, SlimefunItems.ENERGY_REGULATOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.SILVER_INGOT, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.SILVER_INGOT, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.SILVER_INGOT, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.SILVER_INGOT}) - .register(plugin); + new ItemStack[] {SlimefunItems.SILVER_INGOT.item(), SlimefunItems.DAMASCUS_STEEL_INGOT.item(), SlimefunItems.SILVER_INGOT.item(), SlimefunItems.DAMASCUS_STEEL_INGOT.item(), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.DAMASCUS_STEEL_INGOT.item(), SlimefunItems.SILVER_INGOT.item(), SlimefunItems.DAMASCUS_STEEL_INGOT.item(), SlimefunItems.SILVER_INGOT.item()}) + .register(plugin); new EnergyConnector(itemGroups.electricity, SlimefunItems.ENERGY_CONNECTOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.CARBON, SlimefunItems.COPPER_WIRE, SlimefunItems.CARBON, SlimefunItems.COPPER_WIRE, new ItemStack(Material.REDSTONE_BLOCK), SlimefunItems.COPPER_WIRE, SlimefunItems.CARBON, SlimefunItems.COPPER_WIRE, SlimefunItems.CARBON}, - new SlimefunItemStack(SlimefunItems.ENERGY_CONNECTOR, 8)) - .register(plugin); + new ItemStack[] {SlimefunItems.CARBON.item(), SlimefunItems.COPPER_WIRE.item(), SlimefunItems.CARBON.item(), SlimefunItems.COPPER_WIRE.item(), new ItemStack(Material.REDSTONE_BLOCK), SlimefunItems.COPPER_WIRE.item(), SlimefunItems.CARBON.item(), SlimefunItems.COPPER_WIRE.item(), SlimefunItems.CARBON.item()}, + new SlimefunItemStack(SlimefunItems.ENERGY_CONNECTOR, 8).item()) + .register(plugin); new SlimefunItem(itemGroups.misc, SlimefunItems.DUCT_TAPE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.ALUMINUM_DUST, SlimefunItems.ALUMINUM_DUST, SlimefunItems.ALUMINUM_DUST, new ItemStack(Material.SLIME_BALL), new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.SLIME_BALL), new ItemStack(Material.PAPER), new ItemStack(Material.PAPER), new ItemStack(Material.PAPER)}, - new SlimefunItemStack(SlimefunItems.DUCT_TAPE, 2)) - .register(plugin); + new ItemStack[] {SlimefunItems.ALUMINUM_DUST.item(), SlimefunItems.ALUMINUM_DUST.item(), SlimefunItems.ALUMINUM_DUST.item(), new ItemStack(Material.SLIME_BALL), new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.SLIME_BALL), new ItemStack(Material.PAPER), new ItemStack(Material.PAPER), new ItemStack(Material.PAPER)}, + new SlimefunItemStack(SlimefunItems.DUCT_TAPE, 2).item()) + .register(plugin); new Capacitor(itemGroups.electricity, 128, SlimefunItems.SMALL_CAPACITOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.DURALUMIN_INGOT, SlimefunItems.SULFATE, SlimefunItems.DURALUMIN_INGOT, SlimefunItems.REDSTONE_ALLOY, SlimefunItems.ENERGY_CONNECTOR, SlimefunItems.REDSTONE_ALLOY, SlimefunItems.DURALUMIN_INGOT, new ItemStack(Material.REDSTONE), SlimefunItems.DURALUMIN_INGOT}) - .register(plugin); + new ItemStack[] {SlimefunItems.DURALUMIN_INGOT.item(), SlimefunItems.SULFATE.item(), SlimefunItems.DURALUMIN_INGOT.item(), SlimefunItems.REDSTONE_ALLOY.item(), SlimefunItems.ENERGY_CONNECTOR.item(), SlimefunItems.REDSTONE_ALLOY.item(), SlimefunItems.DURALUMIN_INGOT.item(), new ItemStack(Material.REDSTONE), SlimefunItems.DURALUMIN_INGOT.item()}) + .register(plugin); new Capacitor(itemGroups.electricity, 512, SlimefunItems.MEDIUM_CAPACITOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.BILLON_INGOT, SlimefunItems.REDSTONE_ALLOY, SlimefunItems.BILLON_INGOT, new ItemStack(Material.REDSTONE), SlimefunItems.SMALL_CAPACITOR, new ItemStack(Material.REDSTONE), SlimefunItems.BILLON_INGOT, SlimefunItems.REDSTONE_ALLOY, SlimefunItems.BILLON_INGOT}) - .register(plugin); + new ItemStack[] {SlimefunItems.BILLON_INGOT.item(), SlimefunItems.REDSTONE_ALLOY.item(), SlimefunItems.BILLON_INGOT.item(), new ItemStack(Material.REDSTONE), SlimefunItems.SMALL_CAPACITOR.item(), new ItemStack(Material.REDSTONE), SlimefunItems.BILLON_INGOT.item(), SlimefunItems.REDSTONE_ALLOY.item(), SlimefunItems.BILLON_INGOT.item()}) + .register(plugin); new Capacitor(itemGroups.electricity, 1024, SlimefunItems.BIG_CAPACITOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.STEEL_INGOT, SlimefunItems.REDSTONE_ALLOY, SlimefunItems.STEEL_INGOT, new ItemStack(Material.REDSTONE), SlimefunItems.MEDIUM_CAPACITOR, new ItemStack(Material.REDSTONE), SlimefunItems.STEEL_INGOT, SlimefunItems.REDSTONE_ALLOY, SlimefunItems.STEEL_INGOT}) - .register(plugin); + new ItemStack[] {SlimefunItems.STEEL_INGOT.item(), SlimefunItems.REDSTONE_ALLOY.item(), SlimefunItems.STEEL_INGOT.item(), new ItemStack(Material.REDSTONE), SlimefunItems.MEDIUM_CAPACITOR.item(), new ItemStack(Material.REDSTONE), SlimefunItems.STEEL_INGOT.item(), SlimefunItems.REDSTONE_ALLOY.item(), SlimefunItems.STEEL_INGOT.item()}) + .register(plugin); new Capacitor(itemGroups.electricity, 8192, SlimefunItems.LARGE_CAPACITOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.REDSTONE_ALLOY, SlimefunItems.REINFORCED_ALLOY_INGOT, new ItemStack(Material.REDSTONE), SlimefunItems.BIG_CAPACITOR, new ItemStack(Material.REDSTONE), SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.REDSTONE_ALLOY, SlimefunItems.REINFORCED_ALLOY_INGOT}) - .register(plugin); + new ItemStack[] {SlimefunItems.REINFORCED_ALLOY_INGOT.item(), SlimefunItems.REDSTONE_ALLOY.item(), SlimefunItems.REINFORCED_ALLOY_INGOT.item(), new ItemStack(Material.REDSTONE), SlimefunItems.BIG_CAPACITOR.item(), new ItemStack(Material.REDSTONE), SlimefunItems.REINFORCED_ALLOY_INGOT.item(), SlimefunItems.REDSTONE_ALLOY.item(), SlimefunItems.REINFORCED_ALLOY_INGOT.item()}) + .register(plugin); new Capacitor(itemGroups.electricity, 65536, SlimefunItems.CARBONADO_EDGED_CAPACITOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.CARBONADO, SlimefunItems.REDSTONE_ALLOY, SlimefunItems.CARBONADO, new ItemStack(Material.REDSTONE), SlimefunItems.LARGE_CAPACITOR, new ItemStack(Material.REDSTONE), SlimefunItems.CARBONADO, SlimefunItems.REDSTONE_ALLOY, SlimefunItems.CARBONADO}) - .register(plugin); + new ItemStack[] {SlimefunItems.CARBONADO.item(), SlimefunItems.REDSTONE_ALLOY.item(), SlimefunItems.CARBONADO.item(), new ItemStack(Material.REDSTONE), SlimefunItems.LARGE_CAPACITOR.item(), new ItemStack(Material.REDSTONE), SlimefunItems.CARBONADO.item(), SlimefunItems.REDSTONE_ALLOY.item(), SlimefunItems.CARBONADO.item()}) + .register(plugin); new Capacitor(itemGroups.electricity, 524288, SlimefunItems.ENERGIZED_CAPACITOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.CARBONADO, SlimefunItems.REDSTONE_ALLOY, SlimefunItems.CARBONADO, new ItemStack(Material.NETHER_STAR), SlimefunItems.CARBONADO_EDGED_CAPACITOR, new ItemStack(Material.NETHER_STAR), SlimefunItems.CARBONADO, SlimefunItems.REDSTONE_ALLOY, SlimefunItems.CARBONADO}) - .register(plugin); + new ItemStack[] {SlimefunItems.CARBONADO.item(), SlimefunItems.REDSTONE_ALLOY.item(), SlimefunItems.CARBONADO.item(), new ItemStack(Material.NETHER_STAR), SlimefunItems.CARBONADO_EDGED_CAPACITOR.item(), new ItemStack(Material.NETHER_STAR), SlimefunItems.CARBONADO.item(), SlimefunItems.REDSTONE_ALLOY.item(), SlimefunItems.CARBONADO.item()}) + .register(plugin); new SolarGenerator(itemGroups.electricity, 2, 0, SlimefunItems.SOLAR_GENERATOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.SOLAR_PANEL, SlimefunItems.SOLAR_PANEL, SlimefunItems.SOLAR_PANEL, SlimefunItems.ALUMINUM_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ALUMINUM_INGOT, null, SlimefunItems.ALUMINUM_INGOT, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.SOLAR_PANEL.item(), SlimefunItems.SOLAR_PANEL.item(), SlimefunItems.SOLAR_PANEL.item(), SlimefunItems.ALUMINUM_INGOT.item(), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.ALUMINUM_INGOT.item(), null, SlimefunItems.ALUMINUM_INGOT.item(), null}) + .register(plugin); new SolarGenerator(itemGroups.electricity, 8, 0, SlimefunItems.SOLAR_GENERATOR_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.SOLAR_GENERATOR, SlimefunItems.ALUMINUM_INGOT, SlimefunItems.SOLAR_GENERATOR, SlimefunItems.ALUMINUM_INGOT, new ItemStack(Material.REDSTONE), SlimefunItems.ALUMINUM_INGOT, SlimefunItems.SOLAR_GENERATOR, SlimefunItems.ALUMINUM_INGOT, SlimefunItems.SOLAR_GENERATOR}) - .register(plugin); + new ItemStack[] {SlimefunItems.SOLAR_GENERATOR.item(), SlimefunItems.ALUMINUM_INGOT.item(), SlimefunItems.SOLAR_GENERATOR.item(), SlimefunItems.ALUMINUM_INGOT.item(), new ItemStack(Material.REDSTONE), SlimefunItems.ALUMINUM_INGOT.item(), SlimefunItems.SOLAR_GENERATOR.item(), SlimefunItems.ALUMINUM_INGOT.item(), SlimefunItems.SOLAR_GENERATOR.item()}) + .register(plugin); new SolarGenerator(itemGroups.electricity, 32, 0, SlimefunItems.SOLAR_GENERATOR_3, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.SOLAR_GENERATOR_2, SlimefunItems.ALUMINUM_INGOT, SlimefunItems.SOLAR_GENERATOR_2, SlimefunItems.ALUMINUM_INGOT, SlimefunItems.CARBONADO, SlimefunItems.ALUMINUM_INGOT, SlimefunItems.SOLAR_GENERATOR_2, SlimefunItems.ALUMINUM_INGOT, SlimefunItems.SOLAR_GENERATOR_2}) - .register(plugin); + new ItemStack[] {SlimefunItems.SOLAR_GENERATOR_2.item(), SlimefunItems.ALUMINUM_INGOT.item(), SlimefunItems.SOLAR_GENERATOR_2.item(), SlimefunItems.ALUMINUM_INGOT.item(), SlimefunItems.CARBONADO.item(), SlimefunItems.ALUMINUM_INGOT.item(), SlimefunItems.SOLAR_GENERATOR_2.item(), SlimefunItems.ALUMINUM_INGOT.item(), SlimefunItems.SOLAR_GENERATOR_2.item()}) + .register(plugin); new SolarGenerator(itemGroups.electricity, 128, 64, SlimefunItems.SOLAR_GENERATOR_4, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.SOLAR_GENERATOR_3, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.SOLAR_GENERATOR_3, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.SOLAR_GENERATOR_3, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.SOLAR_GENERATOR_3}) - .register(plugin); + new ItemStack[] {SlimefunItems.SOLAR_GENERATOR_3.item(), SlimefunItems.BLISTERING_INGOT_3.item(), SlimefunItems.SOLAR_GENERATOR_3.item(), SlimefunItems.BLISTERING_INGOT_3.item(), SlimefunItems.ELECTRO_MAGNET.item(), SlimefunItems.BLISTERING_INGOT_3.item(), SlimefunItems.SOLAR_GENERATOR_3.item(), SlimefunItems.BLISTERING_INGOT_3.item(), SlimefunItems.SOLAR_GENERATOR_3.item()}) + .register(plugin); new ChargingBench(itemGroups.electricity, SlimefunItems.CHARGING_BENCH, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.ELECTRO_MAGNET, null, SlimefunItems.BATTERY, new ItemStack(Material.CRAFTING_TABLE), SlimefunItems.BATTERY, null, SlimefunItems.SMALL_CAPACITOR, null}) - .setCapacity(128) - .setEnergyConsumption(10) - .setProcessingSpeed(1) - .register(plugin); + new ItemStack[] {null, SlimefunItems.ELECTRO_MAGNET.item(), null, SlimefunItems.BATTERY.item(), new ItemStack(Material.CRAFTING_TABLE), SlimefunItems.BATTERY.item(), null, SlimefunItems.SMALL_CAPACITOR.item(), null}) + .setCapacity(128) + .setEnergyConsumption(10) + .setProcessingSpeed(1) + .register(plugin); new ElectricFurnace(itemGroups.electricity, SlimefunItems.ELECTRIC_FURNACE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.FURNACE), null, SlimefunItems.GILDED_IRON, SlimefunItems.HEATING_COIL, SlimefunItems.GILDED_IRON, SlimefunItems.GILDED_IRON, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.GILDED_IRON}) - .setCapacity(64) - .setEnergyConsumption(2) - .setProcessingSpeed(1) - .register(plugin); + new ItemStack[] {null, new ItemStack(Material.FURNACE), null, SlimefunItems.GILDED_IRON.item(), SlimefunItems.HEATING_COIL.item(), SlimefunItems.GILDED_IRON.item(), SlimefunItems.GILDED_IRON.item(), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.GILDED_IRON.item()}) + .setCapacity(64) + .setEnergyConsumption(2) + .setProcessingSpeed(1) + .register(plugin); new ElectricFurnace(itemGroups.electricity, SlimefunItems.ELECTRIC_FURNACE_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.ELECTRIC_MOTOR, null, SlimefunItems.GILDED_IRON, SlimefunItems.ELECTRIC_FURNACE, SlimefunItems.GILDED_IRON, SlimefunItems.GILDED_IRON, SlimefunItems.HEATING_COIL, SlimefunItems.GILDED_IRON}) - .setCapacity(128) - .setEnergyConsumption(3) - .setProcessingSpeed(2) - .register(plugin); + new ItemStack[] {null, SlimefunItems.ELECTRIC_MOTOR.item(), null, SlimefunItems.GILDED_IRON.item(), SlimefunItems.ELECTRIC_FURNACE.item(), SlimefunItems.GILDED_IRON.item(), SlimefunItems.GILDED_IRON.item(), SlimefunItems.HEATING_COIL.item(), SlimefunItems.GILDED_IRON.item()}) + .setCapacity(128) + .setEnergyConsumption(3) + .setProcessingSpeed(2) + .register(plugin); new ElectricFurnace(itemGroups.electricity, SlimefunItems.ELECTRIC_FURNACE_3, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.ELECTRIC_MOTOR, null, SlimefunItems.STEEL_INGOT, SlimefunItems.ELECTRIC_FURNACE_2, SlimefunItems.STEEL_INGOT, SlimefunItems.GILDED_IRON, SlimefunItems.HEATING_COIL, SlimefunItems.GILDED_IRON}) - .setCapacity(128) - .setEnergyConsumption(5) - .setProcessingSpeed(4) - .register(plugin); + new ItemStack[] {null, SlimefunItems.ELECTRIC_MOTOR.item(), null, SlimefunItems.STEEL_INGOT.item(), SlimefunItems.ELECTRIC_FURNACE_2.item(), SlimefunItems.STEEL_INGOT.item(), SlimefunItems.GILDED_IRON.item(), SlimefunItems.HEATING_COIL.item(), SlimefunItems.GILDED_IRON.item()}) + .setCapacity(128) + .setEnergyConsumption(5) + .setProcessingSpeed(4) + .register(plugin); new ElectricGoldPan(itemGroups.electricity, SlimefunItems.ELECTRIC_GOLD_PAN, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.GOLD_PAN, null, new ItemStack(Material.FLINT), SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.FLINT), SlimefunItems.ALUMINUM_INGOT, SlimefunItems.ALUMINUM_INGOT, SlimefunItems.ALUMINUM_INGOT}) - .setCapacity(128) - .setEnergyConsumption(1) - .setProcessingSpeed(1) - .register(plugin); + new ItemStack[] {null, SlimefunItems.GOLD_PAN.item(), null, new ItemStack(Material.FLINT), SlimefunItems.ELECTRIC_MOTOR.item(), new ItemStack(Material.FLINT), SlimefunItems.ALUMINUM_INGOT.item(), SlimefunItems.ALUMINUM_INGOT.item(), SlimefunItems.ALUMINUM_INGOT.item()}) + .setCapacity(128) + .setEnergyConsumption(1) + .setProcessingSpeed(1) + .register(plugin); new ElectricGoldPan(itemGroups.electricity, SlimefunItems.ELECTRIC_GOLD_PAN_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.GOLD_PAN, null, new ItemStack(Material.IRON_INGOT), SlimefunItems.ELECTRIC_GOLD_PAN, new ItemStack(Material.IRON_INGOT), SlimefunItems.DURALUMIN_INGOT, SlimefunItems.DURALUMIN_INGOT, SlimefunItems.DURALUMIN_INGOT}) - .setCapacity(128) - .setEnergyConsumption(2) - .setProcessingSpeed(3) - .register(plugin); + new ItemStack[] {null, SlimefunItems.GOLD_PAN.item(), null, new ItemStack(Material.IRON_INGOT), SlimefunItems.ELECTRIC_GOLD_PAN.item(), new ItemStack(Material.IRON_INGOT), SlimefunItems.DURALUMIN_INGOT.item(), SlimefunItems.DURALUMIN_INGOT.item(), SlimefunItems.DURALUMIN_INGOT.item()}) + .setCapacity(128) + .setEnergyConsumption(2) + .setProcessingSpeed(3) + .register(plugin); new ElectricGoldPan(itemGroups.electricity, SlimefunItems.ELECTRIC_GOLD_PAN_3, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.GOLD_PAN, null, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ELECTRIC_GOLD_PAN_2, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.COBALT_INGOT, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.COBALT_INGOT}) - .setCapacity(512) - .setEnergyConsumption(7) - .setProcessingSpeed(10) - .register(plugin); + new ItemStack[] {null, SlimefunItems.GOLD_PAN.item(), null, SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.ELECTRIC_GOLD_PAN_2.item(), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.COBALT_INGOT.item(), SlimefunItems.BLISTERING_INGOT_3.item(), SlimefunItems.COBALT_INGOT.item()}) + .setCapacity(512) + .setEnergyConsumption(7) + .setProcessingSpeed(10) + .register(plugin); new ElectricDustWasher(itemGroups.electricity, SlimefunItems.ELECTRIC_DUST_WASHER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.WATER_BUCKET), null, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.ELECTRIC_GOLD_PAN, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.COPPER_INGOT, SlimefunItems.COPPER_INGOT, SlimefunItems.COPPER_INGOT}) - .setCapacity(128) - .setEnergyConsumption(3) - .setProcessingSpeed(1) - .register(plugin); + new ItemStack[] {null, new ItemStack(Material.WATER_BUCKET), null, SlimefunItems.ELECTRO_MAGNET.item(), SlimefunItems.ELECTRIC_GOLD_PAN.item(), SlimefunItems.ELECTRO_MAGNET.item(), SlimefunItems.COPPER_INGOT.item(), SlimefunItems.COPPER_INGOT.item(), SlimefunItems.COPPER_INGOT.item()}) + .setCapacity(128) + .setEnergyConsumption(3) + .setProcessingSpeed(1) + .register(plugin); new ElectricDustWasher(itemGroups.electricity, SlimefunItems.ELECTRIC_DUST_WASHER_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.WATER_BUCKET), null, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.ELECTRIC_DUST_WASHER, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.DAMASCUS_STEEL_INGOT}) - .setCapacity(128) - .setEnergyConsumption(5) - .setProcessingSpeed(2) - .register(plugin); + new ItemStack[] {null, new ItemStack(Material.WATER_BUCKET), null, SlimefunItems.ELECTRO_MAGNET.item(), SlimefunItems.ELECTRIC_DUST_WASHER.item(), SlimefunItems.ELECTRO_MAGNET.item(), SlimefunItems.DAMASCUS_STEEL_INGOT.item(), SlimefunItems.DAMASCUS_STEEL_INGOT.item(), SlimefunItems.DAMASCUS_STEEL_INGOT.item()}) + .setCapacity(128) + .setEnergyConsumption(5) + .setProcessingSpeed(2) + .register(plugin); new ElectricDustWasher(itemGroups.electricity, SlimefunItems.ELECTRIC_DUST_WASHER_3, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.WATER_BUCKET), null, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.ELECTRIC_DUST_WASHER_2, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.CORINTHIAN_BRONZE_INGOT}) - .setCapacity(512) - .setEnergyConsumption(15) - .setProcessingSpeed(10) - .register(plugin); + new ItemStack[] {null, new ItemStack(Material.WATER_BUCKET), null, SlimefunItems.ELECTRO_MAGNET.item(), SlimefunItems.ELECTRIC_DUST_WASHER_2.item(), SlimefunItems.ELECTRO_MAGNET.item(), SlimefunItems.CORINTHIAN_BRONZE_INGOT.item(), SlimefunItems.BLISTERING_INGOT_3.item(), SlimefunItems.CORINTHIAN_BRONZE_INGOT.item()}) + .setCapacity(512) + .setEnergyConsumption(15) + .setProcessingSpeed(10) + .register(plugin); new ElectricIngotFactory(itemGroups.electricity, SlimefunItems.ELECTRIC_INGOT_FACTORY, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.FLINT_AND_STEEL), null, SlimefunItems.HEATING_COIL, SlimefunItems.ELECTRIC_DUST_WASHER, SlimefunItems.HEATING_COIL, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.DAMASCUS_STEEL_INGOT}) - .setCapacity(256) - .setEnergyConsumption(4) - .setProcessingSpeed(1) - .register(plugin); + new ItemStack[] {null, new ItemStack(Material.FLINT_AND_STEEL), null, SlimefunItems.HEATING_COIL.item(), SlimefunItems.ELECTRIC_DUST_WASHER.item(), SlimefunItems.HEATING_COIL.item(), SlimefunItems.DAMASCUS_STEEL_INGOT.item(), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.DAMASCUS_STEEL_INGOT.item()}) + .setCapacity(256) + .setEnergyConsumption(4) + .setProcessingSpeed(1) + .register(plugin); new ElectricIngotFactory(itemGroups.electricity, SlimefunItems.ELECTRIC_INGOT_FACTORY_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.GILDED_IRON, new ItemStack(Material.FLINT_AND_STEEL), SlimefunItems.GILDED_IRON, SlimefunItems.HEATING_COIL, SlimefunItems.ELECTRIC_INGOT_FACTORY, SlimefunItems.HEATING_COIL, SlimefunItems.BRASS_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.BRASS_INGOT}) - .setCapacity(256) - .setEnergyConsumption(7) - .setProcessingSpeed(2) - .register(plugin); + new ItemStack[] {SlimefunItems.GILDED_IRON.item(), new ItemStack(Material.FLINT_AND_STEEL), SlimefunItems.GILDED_IRON.item(), SlimefunItems.HEATING_COIL.item(), SlimefunItems.ELECTRIC_INGOT_FACTORY.item(), SlimefunItems.HEATING_COIL.item(), SlimefunItems.BRASS_INGOT.item(), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.BRASS_INGOT.item()}) + .setCapacity(256) + .setEnergyConsumption(7) + .setProcessingSpeed(2) + .register(plugin); new ElectricIngotFactory(itemGroups.electricity, SlimefunItems.ELECTRIC_INGOT_FACTORY_3, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.GILDED_IRON, new ItemStack(Material.FLINT_AND_STEEL), SlimefunItems.GILDED_IRON, SlimefunItems.HEATING_COIL, SlimefunItems.ELECTRIC_INGOT_FACTORY_2, SlimefunItems.HEATING_COIL, SlimefunItems.BRASS_INGOT, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.BRASS_INGOT}) - .setCapacity(512) - .setEnergyConsumption(20) - .setProcessingSpeed(8) - .register(plugin); + new ItemStack[] {SlimefunItems.GILDED_IRON.item(), new ItemStack(Material.FLINT_AND_STEEL), SlimefunItems.GILDED_IRON.item(), SlimefunItems.HEATING_COIL.item(), SlimefunItems.ELECTRIC_INGOT_FACTORY_2.item(), SlimefunItems.HEATING_COIL.item(), SlimefunItems.BRASS_INGOT.item(), SlimefunItems.BLISTERING_INGOT_3.item(), SlimefunItems.BRASS_INGOT.item()}) + .setCapacity(512) + .setEnergyConsumption(20) + .setProcessingSpeed(8) + .register(plugin); new ElectrifiedCrucible(itemGroups.electricity, SlimefunItems.ELECTRIFIED_CRUCIBLE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.LEAD_INGOT, SlimefunItems.CRUCIBLE, SlimefunItems.LEAD_INGOT, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.HEATING_COIL, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.LEAD_INGOT, SlimefunItems.LARGE_CAPACITOR, SlimefunItems.LEAD_INGOT}) - .setCapacity(1024) - .setEnergyConsumption(24) - .setProcessingSpeed(1) - .register(plugin); + new ItemStack[] {SlimefunItems.LEAD_INGOT.item(), SlimefunItems.CRUCIBLE.item(), SlimefunItems.LEAD_INGOT.item(), SlimefunItems.DAMASCUS_STEEL_INGOT.item(), SlimefunItems.HEATING_COIL.item(), SlimefunItems.DAMASCUS_STEEL_INGOT.item(), SlimefunItems.LEAD_INGOT.item(), SlimefunItems.LARGE_CAPACITOR.item(), SlimefunItems.LEAD_INGOT.item()}) + .setCapacity(1024) + .setEnergyConsumption(24) + .setProcessingSpeed(1) + .register(plugin); new ElectrifiedCrucible(itemGroups.electricity, SlimefunItems.ELECTRIFIED_CRUCIBLE_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.ELECTRIFIED_CRUCIBLE, SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.LEAD_INGOT, SlimefunItems.HEATING_COIL, SlimefunItems.LEAD_INGOT}) - .setCapacity(1024) - .setEnergyConsumption(40) - .setProcessingSpeed(2) - .register(plugin); + new ItemStack[] {SlimefunItems.CORINTHIAN_BRONZE_INGOT.item(), SlimefunItems.ELECTRIFIED_CRUCIBLE.item(), SlimefunItems.CORINTHIAN_BRONZE_INGOT.item(), SlimefunItems.DAMASCUS_STEEL_INGOT.item(), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.DAMASCUS_STEEL_INGOT.item(), SlimefunItems.LEAD_INGOT.item(), SlimefunItems.HEATING_COIL.item(), SlimefunItems.LEAD_INGOT.item()}) + .setCapacity(1024) + .setEnergyConsumption(40) + .setProcessingSpeed(2) + .register(plugin); new ElectrifiedCrucible(itemGroups.electricity, SlimefunItems.ELECTRIFIED_CRUCIBLE_3, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.ELECTRIFIED_CRUCIBLE_2, SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.STEEL_PLATE, SlimefunItems.POWER_CRYSTAL, SlimefunItems.STEEL_PLATE, SlimefunItems.LEAD_INGOT, SlimefunItems.LEAD_INGOT, SlimefunItems.LEAD_INGOT}) - .setCapacity(1024) - .setEnergyConsumption(60) - .setProcessingSpeed(4) - .register(plugin); + new ItemStack[] {SlimefunItems.CORINTHIAN_BRONZE_INGOT.item(), SlimefunItems.ELECTRIFIED_CRUCIBLE_2.item(), SlimefunItems.CORINTHIAN_BRONZE_INGOT.item(), SlimefunItems.STEEL_PLATE.item(), SlimefunItems.POWER_CRYSTAL.item(), SlimefunItems.STEEL_PLATE.item(), SlimefunItems.LEAD_INGOT.item(), SlimefunItems.LEAD_INGOT.item(), SlimefunItems.LEAD_INGOT.item()}) + .setCapacity(1024) + .setEnergyConsumption(60) + .setProcessingSpeed(4) + .register(plugin); new ElectricOreGrinder(itemGroups.electricity, SlimefunItems.ELECTRIC_ORE_GRINDER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.DIAMOND_PICKAXE), null, SlimefunItems.GILDED_IRON, SlimefunItems.HEATING_COIL, SlimefunItems.GILDED_IRON, SlimefunItems.GILDED_IRON, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.GILDED_IRON}) - .setCapacity(128) - .setEnergyConsumption(6) - .setProcessingSpeed(1) - .register(plugin); + new ItemStack[] {null, new ItemStack(Material.DIAMOND_PICKAXE), null, SlimefunItems.GILDED_IRON.item(), SlimefunItems.HEATING_COIL.item(), SlimefunItems.GILDED_IRON.item(), SlimefunItems.GILDED_IRON.item(), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.GILDED_IRON.item()}) + .setCapacity(128) + .setEnergyConsumption(6) + .setProcessingSpeed(1) + .register(plugin); new ElectricOreGrinder(itemGroups.electricity, SlimefunItems.ELECTRIC_ORE_GRINDER_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.DIAMOND_PICKAXE), null, SlimefunItems.HEATING_COIL, SlimefunItems.ELECTRIC_ORE_GRINDER, SlimefunItems.HEATING_COIL, SlimefunItems.GILDED_IRON, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.GILDED_IRON}) - .setCapacity(512) - .setEnergyConsumption(15) - .setProcessingSpeed(4) - .register(plugin); + new ItemStack[] {null, new ItemStack(Material.DIAMOND_PICKAXE), null, SlimefunItems.HEATING_COIL.item(), SlimefunItems.ELECTRIC_ORE_GRINDER.item(), SlimefunItems.HEATING_COIL.item(), SlimefunItems.GILDED_IRON.item(), SlimefunItems.BLISTERING_INGOT_3.item(), SlimefunItems.GILDED_IRON.item()}) + .setCapacity(512) + .setEnergyConsumption(15) + .setProcessingSpeed(4) + .register(plugin); new ElectricOreGrinder(itemGroups.electricity, SlimefunItems.ELECTRIC_ORE_GRINDER_3, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.REINFORCED_PLATE, SlimefunItems.HEATING_COIL, SlimefunItems.REINFORCED_PLATE, null, SlimefunItems.ELECTRIC_ORE_GRINDER_2, null, SlimefunItems.REINFORCED_PLATE, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.REINFORCED_PLATE}) - .setCapacity(1024) - .setEnergyConsumption(45) - .setProcessingSpeed(10) - .register(plugin); + new ItemStack[] {SlimefunItems.REINFORCED_PLATE.item(), SlimefunItems.HEATING_COIL.item(), SlimefunItems.REINFORCED_PLATE.item(), null, SlimefunItems.ELECTRIC_ORE_GRINDER_2.item(), null, SlimefunItems.REINFORCED_PLATE.item(), SlimefunItems.BLISTERING_INGOT_3.item(), SlimefunItems.REINFORCED_PLATE.item()}) + .setCapacity(1024) + .setEnergyConsumption(45) + .setProcessingSpeed(10) + .register(plugin); new HeatedPressureChamber(itemGroups.electricity, SlimefunItems.HEATED_PRESSURE_CHAMBER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.LEAD_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.LEAD_INGOT, SlimefunItems.LEAD_INGOT, new ItemStack(Material.GLASS), SlimefunItems.LEAD_INGOT, SlimefunItems.LEAD_INGOT, SlimefunItems.HEATING_COIL, SlimefunItems.LEAD_INGOT}) - .setCapacity(128) - .setEnergyConsumption(5) - .setProcessingSpeed(1) - .register(plugin); + new ItemStack[] {SlimefunItems.LEAD_INGOT.item(), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.LEAD_INGOT.item(), SlimefunItems.LEAD_INGOT.item(), new ItemStack(Material.GLASS), SlimefunItems.LEAD_INGOT.item(), SlimefunItems.LEAD_INGOT.item(), SlimefunItems.HEATING_COIL.item(), SlimefunItems.LEAD_INGOT.item()}) + .setCapacity(128) + .setEnergyConsumption(5) + .setProcessingSpeed(1) + .register(plugin); new HeatedPressureChamber(itemGroups.electricity, SlimefunItems.HEATED_PRESSURE_CHAMBER_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.LEAD_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.LEAD_INGOT, SlimefunItems.LEAD_INGOT, SlimefunItems.HEATED_PRESSURE_CHAMBER, SlimefunItems.LEAD_INGOT, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.HEATING_COIL, SlimefunItems.REINFORCED_ALLOY_INGOT}) - .setCapacity(256) - .setEnergyConsumption(22) - .setProcessingSpeed(5) - .register(plugin); + new ItemStack[] {SlimefunItems.LEAD_INGOT.item(), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.LEAD_INGOT.item(), SlimefunItems.LEAD_INGOT.item(), SlimefunItems.HEATED_PRESSURE_CHAMBER.item(), SlimefunItems.LEAD_INGOT.item(), SlimefunItems.REINFORCED_ALLOY_INGOT.item(), SlimefunItems.HEATING_COIL.item(), SlimefunItems.REINFORCED_ALLOY_INGOT.item()}) + .setCapacity(256) + .setEnergyConsumption(22) + .setProcessingSpeed(5) + .register(plugin); new ElectricIngotPulverizer(itemGroups.electricity, SlimefunItems.ELECTRIC_INGOT_PULVERIZER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.ELECTRIC_ORE_GRINDER, null, SlimefunItems.LEAD_INGOT, SlimefunItems.MEDIUM_CAPACITOR, SlimefunItems.LEAD_INGOT, SlimefunItems.LEAD_INGOT, SlimefunItems.HEATING_COIL, SlimefunItems.LEAD_INGOT}) - .setCapacity(512) - .setEnergyConsumption(7) - .setProcessingSpeed(1) - .register(plugin); + new ItemStack[] {null, SlimefunItems.ELECTRIC_ORE_GRINDER.item(), null, SlimefunItems.LEAD_INGOT.item(), SlimefunItems.MEDIUM_CAPACITOR.item(), SlimefunItems.LEAD_INGOT.item(), SlimefunItems.LEAD_INGOT.item(), SlimefunItems.HEATING_COIL.item(), SlimefunItems.LEAD_INGOT.item()}) + .setCapacity(512) + .setEnergyConsumption(7) + .setProcessingSpeed(1) + .register(plugin); new CoalGenerator(itemGroups.electricity, SlimefunItems.COAL_GENERATOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.HEATING_COIL, new ItemStack(Material.FURNACE), SlimefunItems.HEATING_COIL, SlimefunItems.NICKEL_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.NICKEL_INGOT, null, SlimefunItems.NICKEL_INGOT, null}) - .setCapacity(64) - .setEnergyProduction(8) - .register(plugin); + new ItemStack[] {SlimefunItems.HEATING_COIL.item(), new ItemStack(Material.FURNACE), SlimefunItems.HEATING_COIL.item(), SlimefunItems.NICKEL_INGOT.item(), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.NICKEL_INGOT.item(), null, SlimefunItems.NICKEL_INGOT.item(), null}) + .setCapacity(64) + .setEnergyProduction(8) + .register(plugin); new CoalGenerator(itemGroups.electricity, SlimefunItems.COAL_GENERATOR_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.MAGMA_BLOCK), SlimefunItems.HEATING_COIL, new ItemStack(Material.MAGMA_BLOCK), SlimefunItems.HARDENED_METAL_INGOT, SlimefunItems.COAL_GENERATOR, SlimefunItems.HARDENED_METAL_INGOT, null, SlimefunItems.ELECTRIC_MOTOR, null}) - .setCapacity(256) - .setEnergyProduction(15) - .register(plugin); + new ItemStack[] {new ItemStack(Material.MAGMA_BLOCK), SlimefunItems.HEATING_COIL.item(), new ItemStack(Material.MAGMA_BLOCK), SlimefunItems.HARDENED_METAL_INGOT.item(), SlimefunItems.COAL_GENERATOR.item(), SlimefunItems.HARDENED_METAL_INGOT.item(), null, SlimefunItems.ELECTRIC_MOTOR.item(), null}) + .setCapacity(256) + .setEnergyProduction(15) + .register(plugin); new BioGenerator(itemGroups.electricity, SlimefunItems.BIO_REACTOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.HEATING_COIL, SlimefunItems.COMPOSTER, SlimefunItems.HEATING_COIL, SlimefunItems.ALUMINUM_BRASS_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ALUMINUM_BRASS_INGOT, null, SlimefunItems.ALUMINUM_BRASS_INGOT, null}) - .setCapacity(128) - .setEnergyProduction(4) - .register(plugin); + new ItemStack[] {SlimefunItems.HEATING_COIL.item(), SlimefunItems.COMPOSTER.item(), SlimefunItems.HEATING_COIL.item(), SlimefunItems.ALUMINUM_BRASS_INGOT.item(), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.ALUMINUM_BRASS_INGOT.item(), null, SlimefunItems.ALUMINUM_BRASS_INGOT.item(), null}) + .setCapacity(128) + .setEnergyProduction(4) + .register(plugin); new AutoDrier(itemGroups.electricity, SlimefunItems.AUTO_DRIER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[]{null, null, null, SlimefunItems.HEATING_COIL, new ItemStack(Material.SMOKER), SlimefunItems.HEATING_COIL, null, new ItemStack(Material.CAMPFIRE), null}) - .setCapacity(128) - .setEnergyConsumption(5) - .setProcessingSpeed(1) - .register(plugin); + new ItemStack[]{null, null, null, SlimefunItems.HEATING_COIL.item(), new ItemStack(Material.SMOKER), SlimefunItems.HEATING_COIL.item(), null, new ItemStack(Material.CAMPFIRE), null}) + .setCapacity(128) + .setEnergyConsumption(5) + .setProcessingSpeed(1) + .register(plugin); new AutoBrewer(itemGroups.electricity, SlimefunItems.AUTO_BREWER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.HEATING_COIL, null, SlimefunItems.REINFORCED_PLATE, new ItemStack(Material.BREWING_STAND), SlimefunItems.REINFORCED_PLATE, null, SlimefunItems.ELECTRIC_MOTOR, null}) - .setCapacity(128) - .setEnergyConsumption(6) - .setProcessingSpeed(1) - .register(plugin); + new ItemStack[] {null, SlimefunItems.HEATING_COIL.item(), null, SlimefunItems.REINFORCED_PLATE.item(), new ItemStack(Material.BREWING_STAND), SlimefunItems.REINFORCED_PLATE.item(), null, SlimefunItems.ELECTRIC_MOTOR.item(), null}) + .setCapacity(128) + .setEnergyConsumption(6) + .setProcessingSpeed(1) + .register(plugin); new ElectricPress(itemGroups.electricity, SlimefunItems.ELECTRIC_PRESS, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.PISTON), SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.PISTON), null, SlimefunItems.MEDIUM_CAPACITOR, null, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.DAMASCUS_STEEL_INGOT}) - .setCapacity(256) - .setEnergyConsumption(8) - .setProcessingSpeed(1) - .register(plugin); + new ItemStack[] {new ItemStack(Material.PISTON), SlimefunItems.ELECTRIC_MOTOR.item(), new ItemStack(Material.PISTON), null, SlimefunItems.MEDIUM_CAPACITOR.item(), null, SlimefunItems.DAMASCUS_STEEL_INGOT.item(), SlimefunItems.DAMASCUS_STEEL_INGOT.item(), SlimefunItems.DAMASCUS_STEEL_INGOT.item()}) + .setCapacity(256) + .setEnergyConsumption(8) + .setProcessingSpeed(1) + .register(plugin); new ElectricPress(itemGroups.electricity, SlimefunItems.ELECTRIC_PRESS_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.STICKY_PISTON), SlimefunItems.ELECTRIC_PRESS, new ItemStack(Material.STICKY_PISTON), SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.BIG_CAPACITOR, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.DAMASCUS_STEEL_INGOT}) - .setCapacity(1024) - .setEnergyConsumption(20) - .setProcessingSpeed(3) - .register(plugin); + new ItemStack[] {new ItemStack(Material.STICKY_PISTON), SlimefunItems.ELECTRIC_PRESS.item(), new ItemStack(Material.STICKY_PISTON), SlimefunItems.DAMASCUS_STEEL_INGOT.item(), SlimefunItems.BIG_CAPACITOR.item(), SlimefunItems.DAMASCUS_STEEL_INGOT.item(), SlimefunItems.DAMASCUS_STEEL_INGOT.item(), SlimefunItems.DAMASCUS_STEEL_INGOT.item(), SlimefunItems.DAMASCUS_STEEL_INGOT.item()}) + .setCapacity(1024) + .setEnergyConsumption(20) + .setProcessingSpeed(3) + .register(plugin); new SlimefunItem(itemGroups.resources, SlimefunItems.MAGNESIUM_SALT, RecipeType.HEATED_PRESSURE_CHAMBER, - new ItemStack[] {SlimefunItems.MAGNESIUM_DUST, SlimefunItems.SALT, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.MAGNESIUM_DUST.item(), SlimefunItems.SALT.item(), null, null, null, null, null, null, null}) + .register(plugin); new MagnesiumGenerator(itemGroups.electricity, SlimefunItems.MAGNESIUM_GENERATOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.ELECTRIC_MOTOR, null, SlimefunItems.COMPRESSED_CARBON, new ItemStack(Material.WATER_BUCKET), SlimefunItems.COMPRESSED_CARBON, SlimefunItems.DURALUMIN_INGOT, SlimefunItems.DURALUMIN_INGOT, SlimefunItems.DURALUMIN_INGOT}) - .setCapacity(128) - .setEnergyProduction(18) - .register(plugin); + new ItemStack[] {null, SlimefunItems.ELECTRIC_MOTOR.item(), null, SlimefunItems.COMPRESSED_CARBON.item(), new ItemStack(Material.WATER_BUCKET), SlimefunItems.COMPRESSED_CARBON.item(), SlimefunItems.DURALUMIN_INGOT.item(), SlimefunItems.DURALUMIN_INGOT.item(), SlimefunItems.DURALUMIN_INGOT.item()}) + .setCapacity(128) + .setEnergyProduction(18) + .register(plugin); new AutoEnchanter(itemGroups.electricity, SlimefunItems.AUTO_ENCHANTER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.ENCHANTING_TABLE), null, SlimefunItems.CARBONADO, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.CARBONADO, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.WITHER_PROOF_OBSIDIAN}) - .setCapacity(128) - .setEnergyConsumption(9) - .setProcessingSpeed(1) - .register(plugin); + new ItemStack[] {null, new ItemStack(Material.ENCHANTING_TABLE), null, SlimefunItems.CARBONADO.item(), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.CARBONADO.item(), SlimefunItems.WITHER_PROOF_OBSIDIAN.item(), SlimefunItems.WITHER_PROOF_OBSIDIAN.item(), SlimefunItems.WITHER_PROOF_OBSIDIAN.item()}) + .setCapacity(128) + .setEnergyConsumption(9) + .setProcessingSpeed(1) + .register(plugin); new AutoEnchanter(itemGroups.electricity, SlimefunItems.AUTO_ENCHANTER_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.REINFORCED_PLATE, SlimefunItems.BIG_CAPACITOR, SlimefunItems.REINFORCED_PLATE, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.AUTO_ENCHANTER, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.SYNTHETIC_DIAMOND, SlimefunItems.WITHER_PROOF_OBSIDIAN}) - .setCapacity(1024) - .setEnergyConsumption(24) - .setProcessingSpeed(3) - .register(plugin); + new ItemStack[] {SlimefunItems.REINFORCED_PLATE.item(), SlimefunItems.BIG_CAPACITOR.item(), SlimefunItems.REINFORCED_PLATE.item(), SlimefunItems.BLISTERING_INGOT_3.item(), SlimefunItems.AUTO_ENCHANTER.item(), SlimefunItems.BLISTERING_INGOT_3.item(), SlimefunItems.WITHER_PROOF_OBSIDIAN.item(), SlimefunItems.SYNTHETIC_DIAMOND.item(), SlimefunItems.WITHER_PROOF_OBSIDIAN.item()}) + .setCapacity(1024) + .setEnergyConsumption(24) + .setProcessingSpeed(3) + .register(plugin); new AutoDisenchanter(itemGroups.electricity, SlimefunItems.AUTO_DISENCHANTER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.REDSTONE), new ItemStack(Material.ANVIL), new ItemStack(Material.REDSTONE), SlimefunItems.CARBONADO, SlimefunItems.AUTO_ENCHANTER, SlimefunItems.CARBONADO, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.WITHER_PROOF_OBSIDIAN}) - .setCapacity(128) - .setEnergyConsumption(9) - .setProcessingSpeed(1) - .register(plugin); + new ItemStack[] {new ItemStack(Material.REDSTONE), new ItemStack(Material.ANVIL), new ItemStack(Material.REDSTONE), SlimefunItems.CARBONADO.item(), SlimefunItems.AUTO_ENCHANTER.item(), SlimefunItems.CARBONADO.item(), SlimefunItems.WITHER_PROOF_OBSIDIAN.item(), SlimefunItems.WITHER_PROOF_OBSIDIAN.item(), SlimefunItems.WITHER_PROOF_OBSIDIAN.item()}) + .setCapacity(128) + .setEnergyConsumption(9) + .setProcessingSpeed(1) + .register(plugin); new AutoDisenchanter(itemGroups.electricity, SlimefunItems.AUTO_DISENCHANTER_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.REINFORCED_PLATE, new ItemStack(Material.ANVIL), SlimefunItems.REINFORCED_PLATE, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.AUTO_DISENCHANTER, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.BIG_CAPACITOR, SlimefunItems.WITHER_PROOF_OBSIDIAN}) - .setCapacity(1024) - .setEnergyConsumption(24) - .setProcessingSpeed(3) - .register(plugin); + new ItemStack[] {SlimefunItems.REINFORCED_PLATE.item(), new ItemStack(Material.ANVIL), SlimefunItems.REINFORCED_PLATE.item(), SlimefunItems.BLISTERING_INGOT_3.item(), SlimefunItems.AUTO_DISENCHANTER.item(), SlimefunItems.BLISTERING_INGOT_3.item(), SlimefunItems.WITHER_PROOF_OBSIDIAN.item(), SlimefunItems.BIG_CAPACITOR.item(), SlimefunItems.WITHER_PROOF_OBSIDIAN.item()}) + .setCapacity(1024) + .setEnergyConsumption(24) + .setProcessingSpeed(3) + .register(plugin); new AutoAnvil(itemGroups.electricity, 10, SlimefunItems.AUTO_ANVIL, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.ANVIL), null, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.REINFORCED_ALLOY_INGOT, new ItemStack(Material.IRON_BLOCK), new ItemStack(Material.IRON_BLOCK), new ItemStack(Material.IRON_BLOCK)}) - .setCapacity(128) - .setEnergyConsumption(12) - .setProcessingSpeed(1) - .register(plugin); + new ItemStack[] {null, new ItemStack(Material.ANVIL), null, SlimefunItems.REINFORCED_ALLOY_INGOT.item(), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.REINFORCED_ALLOY_INGOT.item(), new ItemStack(Material.IRON_BLOCK), new ItemStack(Material.IRON_BLOCK), new ItemStack(Material.IRON_BLOCK)}) + .setCapacity(128) + .setEnergyConsumption(12) + .setProcessingSpeed(1) + .register(plugin); new AutoAnvil(itemGroups.electricity, 25, SlimefunItems.AUTO_ANVIL_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.AUTO_ANVIL, null, SlimefunItems.STEEL_PLATE, SlimefunItems.HEATING_COIL, SlimefunItems.STEEL_PLATE, new ItemStack(Material.IRON_BLOCK), new ItemStack(Material.IRON_BLOCK), new ItemStack(Material.IRON_BLOCK)}) - .setCapacity(256) - .setEnergyConsumption(16) - .setProcessingSpeed(1) - .register(plugin); + new ItemStack[] {null, SlimefunItems.AUTO_ANVIL.item(), null, SlimefunItems.STEEL_PLATE.item(), SlimefunItems.HEATING_COIL.item(), SlimefunItems.STEEL_PLATE.item(), new ItemStack(Material.IRON_BLOCK), new ItemStack(Material.IRON_BLOCK), new ItemStack(Material.IRON_BLOCK)}) + .setCapacity(256) + .setEnergyConsumption(16) + .setProcessingSpeed(1) + .register(plugin); new BookBinder(itemGroups.electricity, SlimefunItems.BOOK_BINDER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.ENCHANTING_TABLE), null, new ItemStack(Material.BOOKSHELF), SlimefunItems.HARDENED_METAL_INGOT, new ItemStack(Material.BOOKSHELF), SlimefunItems.SYNTHETIC_SAPPHIRE, SlimefunItems.SMALL_CAPACITOR, SlimefunItems.SYNTHETIC_SAPPHIRE}) - .setCapacity(256) - .setEnergyConsumption(16) - .setProcessingSpeed(1) - .register(plugin); + new ItemStack[] {null, new ItemStack(Material.ENCHANTING_TABLE), null, new ItemStack(Material.BOOKSHELF), SlimefunItems.HARDENED_METAL_INGOT.item(), new ItemStack(Material.BOOKSHELF), SlimefunItems.SYNTHETIC_SAPPHIRE.item(), SlimefunItems.SMALL_CAPACITOR.item(), SlimefunItems.SYNTHETIC_SAPPHIRE.item()}) + .setCapacity(256) + .setEnergyConsumption(16) + .setProcessingSpeed(1) + .register(plugin); new Multimeter(itemGroups.technicalGadgets, SlimefunItems.MULTIMETER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.COPPER_INGOT, null, SlimefunItems.COPPER_INGOT, null, SlimefunItems.REDSTONE_ALLOY, null, null, SlimefunItems.GOLD_6K, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.COPPER_INGOT.item(), null, SlimefunItems.COPPER_INGOT.item(), null, SlimefunItems.REDSTONE_ALLOY.item(), null, null, SlimefunItems.GOLD_6K.item(), null}) + .register(plugin); new SlimefunItem(itemGroups.technicalComponents, SlimefunItems.PLASTIC_SHEET, RecipeType.HEATED_PRESSURE_CHAMBER, - new ItemStack[] {null, null, null, null, SlimefunItems.OIL_BUCKET, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.PLASTIC_SHEET, 8)) - .register(plugin); + new ItemStack[] {null, null, null, null, SlimefunItems.OIL_BUCKET.item(), null, null, null, null}, + new SlimefunItemStack(SlimefunItems.PLASTIC_SHEET, 8).item()) + .register(plugin); new UnplaceableBlock(itemGroups.technicalComponents, SlimefunItems.ANDROID_MEMORY_CORE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.BRASS_INGOT, new ItemStack(Material.ORANGE_STAINED_GLASS), SlimefunItems.BRASS_INGOT, SlimefunItems.POWER_CRYSTAL, SlimefunItems.TIN_DUST, SlimefunItems.POWER_CRYSTAL, SlimefunItems.BRASS_INGOT, new ItemStack(Material.ORANGE_STAINED_GLASS), SlimefunItems.BRASS_INGOT}) - .register(plugin); + new ItemStack[] {SlimefunItems.BRASS_INGOT.item(), new ItemStack(Material.ORANGE_STAINED_GLASS), SlimefunItems.BRASS_INGOT.item(), SlimefunItems.POWER_CRYSTAL.item(), SlimefunItems.TIN_DUST.item(), SlimefunItems.POWER_CRYSTAL.item(), SlimefunItems.BRASS_INGOT.item(), new ItemStack(Material.ORANGE_STAINED_GLASS), SlimefunItems.BRASS_INGOT.item()}) + .register(plugin); new GPSTransmitter(itemGroups.gps, 1, SlimefunItems.GPS_TRANSMITTER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, null, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.STEEL_INGOT, SlimefunItems.ADVANCED_CIRCUIT_BOARD, SlimefunItems.STEEL_INGOT, SlimefunItems.STEEL_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.STEEL_INGOT}) { + new ItemStack[] {null, null, SlimefunItems.ELECTRO_MAGNET.item(), SlimefunItems.STEEL_INGOT.item(), SlimefunItems.ADVANCED_CIRCUIT_BOARD.item(), SlimefunItems.STEEL_INGOT.item(), SlimefunItems.STEEL_INGOT.item(), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.STEEL_INGOT.item()}) { @Override public int getMultiplier(int y) { @@ -1898,7 +1898,7 @@ public int getEnergyConsumption() { }.register(plugin); new GPSTransmitter(itemGroups.gps, 2, SlimefunItems.GPS_TRANSMITTER_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.GPS_TRANSMITTER, SlimefunItems.BRONZE_INGOT, SlimefunItems.GPS_TRANSMITTER, SlimefunItems.BRONZE_INGOT, SlimefunItems.CARBON, SlimefunItems.BRONZE_INGOT, SlimefunItems.GPS_TRANSMITTER, SlimefunItems.BRONZE_INGOT, SlimefunItems.GPS_TRANSMITTER}) { + new ItemStack[] {SlimefunItems.GPS_TRANSMITTER.item(), SlimefunItems.BRONZE_INGOT.item(), SlimefunItems.GPS_TRANSMITTER.item(), SlimefunItems.BRONZE_INGOT.item(), SlimefunItems.CARBON.item(), SlimefunItems.BRONZE_INGOT.item(), SlimefunItems.GPS_TRANSMITTER.item(), SlimefunItems.BRONZE_INGOT.item(), SlimefunItems.GPS_TRANSMITTER.item()}) { @Override public int getMultiplier(int y) { @@ -1913,7 +1913,7 @@ public int getEnergyConsumption() { }.register(plugin); new GPSTransmitter(itemGroups.gps, 3, SlimefunItems.GPS_TRANSMITTER_3, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.GPS_TRANSMITTER_2, SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.GPS_TRANSMITTER_2, SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.CARBONADO, SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.GPS_TRANSMITTER_2, SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.GPS_TRANSMITTER_2}) { + new ItemStack[] {SlimefunItems.GPS_TRANSMITTER_2.item(), SlimefunItems.CORINTHIAN_BRONZE_INGOT.item(), SlimefunItems.GPS_TRANSMITTER_2.item(), SlimefunItems.CORINTHIAN_BRONZE_INGOT.item(), SlimefunItems.CARBONADO.item(), SlimefunItems.CORINTHIAN_BRONZE_INGOT.item(), SlimefunItems.GPS_TRANSMITTER_2.item(), SlimefunItems.CORINTHIAN_BRONZE_INGOT.item(), SlimefunItems.GPS_TRANSMITTER_2.item()}) { @Override public int getMultiplier(int y) { @@ -1928,7 +1928,7 @@ public int getEnergyConsumption() { }.register(plugin); new GPSTransmitter(itemGroups.gps, 4, SlimefunItems.GPS_TRANSMITTER_4, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.GPS_TRANSMITTER_3, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.GPS_TRANSMITTER_3, SlimefunItems.NICKEL_INGOT, SlimefunItems.CARBONADO, SlimefunItems.NICKEL_INGOT, SlimefunItems.GPS_TRANSMITTER_3, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.GPS_TRANSMITTER_3}) { + new ItemStack[] {SlimefunItems.GPS_TRANSMITTER_3.item(), SlimefunItems.BLISTERING_INGOT_3.item(), SlimefunItems.GPS_TRANSMITTER_3.item(), SlimefunItems.NICKEL_INGOT.item(), SlimefunItems.CARBONADO.item(), SlimefunItems.NICKEL_INGOT.item(), SlimefunItems.GPS_TRANSMITTER_3.item(), SlimefunItems.BLISTERING_INGOT_3.item(), SlimefunItems.GPS_TRANSMITTER_3.item()}) { @Override public int getMultiplier(int y) { @@ -1943,501 +1943,503 @@ public int getEnergyConsumption() { }.register(plugin); new GPSControlPanel(itemGroups.gps, SlimefunItems.GPS_CONTROL_PANEL, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, null, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.COBALT_INGOT, SlimefunItems.ADVANCED_CIRCUIT_BOARD, SlimefunItems.COBALT_INGOT, SlimefunItems.ALUMINUM_BRASS_INGOT, SlimefunItems.ALUMINUM_BRASS_INGOT, SlimefunItems.ALUMINUM_BRASS_INGOT}) - .register(plugin); + new ItemStack[] {null, null, SlimefunItems.ELECTRO_MAGNET.item(), SlimefunItems.COBALT_INGOT.item(), SlimefunItems.ADVANCED_CIRCUIT_BOARD.item(), SlimefunItems.COBALT_INGOT.item(), SlimefunItems.ALUMINUM_BRASS_INGOT.item(), SlimefunItems.ALUMINUM_BRASS_INGOT.item(), SlimefunItems.ALUMINUM_BRASS_INGOT.item()}) + .register(plugin); new GPSMarkerTool(itemGroups.gps, SlimefunItems.GPS_MARKER_TOOL, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.ELECTRO_MAGNET, null, new ItemStack(Material.LAPIS_LAZULI), SlimefunItems.BASIC_CIRCUIT_BOARD, new ItemStack(Material.LAPIS_LAZULI), new ItemStack(Material.REDSTONE), SlimefunItems.REDSTONE_ALLOY, new ItemStack(Material.REDSTONE)}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.ELECTRO_MAGNET.item(), null, new ItemStack(Material.LAPIS_LAZULI), SlimefunItems.BASIC_CIRCUIT_BOARD.item(), new ItemStack(Material.LAPIS_LAZULI), new ItemStack(Material.REDSTONE), SlimefunItems.REDSTONE_ALLOY.item(), new ItemStack(Material.REDSTONE)}) + .register(plugin); new SlimefunItem(itemGroups.gps, SlimefunItems.GPS_EMERGENCY_TRANSMITTER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.ELECTRO_MAGNET, null, null, SlimefunItems.GPS_TRANSMITTER, null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE, null}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.ELECTRO_MAGNET.item(), null, null, SlimefunItems.GPS_TRANSMITTER.item(), null, null, SlimefunItems.ESSENCE_OF_AFTERLIFE.item(), null}) + .register(plugin); new AndroidInterface(itemGroups.androids, SlimefunItems.ANDROID_INTERFACE_ITEMS, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.PLASTIC_SHEET, SlimefunItems.STEEL_INGOT, SlimefunItems.PLASTIC_SHEET, SlimefunItems.STEEL_INGOT, SlimefunItems.BASIC_CIRCUIT_BOARD, new ItemStack(Material.BLUE_STAINED_GLASS), SlimefunItems.PLASTIC_SHEET, SlimefunItems.STEEL_INGOT, SlimefunItems.PLASTIC_SHEET}) - .register(plugin); + new ItemStack[] {SlimefunItems.PLASTIC_SHEET.item(), SlimefunItems.STEEL_INGOT.item(), SlimefunItems.PLASTIC_SHEET.item(), SlimefunItems.STEEL_INGOT.item(), SlimefunItems.BASIC_CIRCUIT_BOARD.item(), new ItemStack(Material.BLUE_STAINED_GLASS), SlimefunItems.PLASTIC_SHEET.item(), SlimefunItems.STEEL_INGOT.item(), SlimefunItems.PLASTIC_SHEET.item()}) + .register(plugin); new AndroidInterface(itemGroups.androids, SlimefunItems.ANDROID_INTERFACE_FUEL, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.PLASTIC_SHEET, SlimefunItems.STEEL_INGOT, SlimefunItems.PLASTIC_SHEET, new ItemStack(Material.RED_STAINED_GLASS), SlimefunItems.BASIC_CIRCUIT_BOARD, SlimefunItems.STEEL_INGOT, SlimefunItems.PLASTIC_SHEET, SlimefunItems.STEEL_INGOT, SlimefunItems.PLASTIC_SHEET}) - .register(plugin); + new ItemStack[] {SlimefunItems.PLASTIC_SHEET.item(), SlimefunItems.STEEL_INGOT.item(), SlimefunItems.PLASTIC_SHEET.item(), new ItemStack(Material.RED_STAINED_GLASS), SlimefunItems.BASIC_CIRCUIT_BOARD.item(), SlimefunItems.STEEL_INGOT.item(), SlimefunItems.PLASTIC_SHEET.item(), SlimefunItems.STEEL_INGOT.item(), SlimefunItems.PLASTIC_SHEET.item()}) + .register(plugin); new ProgrammableAndroid(itemGroups.androids, 1, SlimefunItems.PROGRAMMABLE_ANDROID, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.PLASTIC_SHEET, SlimefunItems.ANDROID_MEMORY_CORE, SlimefunItems.PLASTIC_SHEET, SlimefunItems.COAL_GENERATOR, SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.CHEST), SlimefunItems.PLASTIC_SHEET, SlimefunItems.PLASTIC_SHEET, SlimefunItems.PLASTIC_SHEET}) - .register(plugin); + new ItemStack[] {SlimefunItems.PLASTIC_SHEET.item(), SlimefunItems.ANDROID_MEMORY_CORE.item(), SlimefunItems.PLASTIC_SHEET.item(), SlimefunItems.COAL_GENERATOR.item(), SlimefunItems.ELECTRIC_MOTOR.item(), new ItemStack(Material.CHEST), SlimefunItems.PLASTIC_SHEET.item(), SlimefunItems.PLASTIC_SHEET.item(), SlimefunItems.PLASTIC_SHEET.item()}) + .register(plugin); new MinerAndroid(itemGroups.androids, 1, SlimefunItems.PROGRAMMABLE_ANDROID_MINER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, null, null, new ItemStack(Material.DIAMOND_PICKAXE), SlimefunItems.PROGRAMMABLE_ANDROID, new ItemStack(Material.DIAMOND_PICKAXE), null, SlimefunItems.ELECTRIC_MOTOR, null}) - .register(plugin); + new ItemStack[] {null, null, null, new ItemStack(Material.DIAMOND_PICKAXE), SlimefunItems.PROGRAMMABLE_ANDROID.item(), new ItemStack(Material.DIAMOND_PICKAXE), null, SlimefunItems.ELECTRIC_MOTOR.item(), null}) + .register(plugin); new FarmerAndroid(itemGroups.androids, 1, SlimefunItems.PROGRAMMABLE_ANDROID_FARMER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, null, null, new ItemStack(Material.DIAMOND_HOE), SlimefunItems.PROGRAMMABLE_ANDROID, new ItemStack(Material.DIAMOND_HOE), null, SlimefunItems.ELECTRIC_MOTOR, null}) - .register(plugin); + new ItemStack[] {null, null, null, new ItemStack(Material.DIAMOND_HOE), SlimefunItems.PROGRAMMABLE_ANDROID.item(), new ItemStack(Material.DIAMOND_HOE), null, SlimefunItems.ELECTRIC_MOTOR.item(), null}) + .register(plugin); new WoodcutterAndroid(itemGroups.androids, 1, SlimefunItems.PROGRAMMABLE_ANDROID_WOODCUTTER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, null, null, new ItemStack(Material.DIAMOND_AXE), SlimefunItems.PROGRAMMABLE_ANDROID, new ItemStack(Material.DIAMOND_AXE), null, SlimefunItems.ELECTRIC_MOTOR, null}) - .register(plugin); + new ItemStack[] {null, null, null, new ItemStack(Material.DIAMOND_AXE), SlimefunItems.PROGRAMMABLE_ANDROID.item(), new ItemStack(Material.DIAMOND_AXE), null, SlimefunItems.ELECTRIC_MOTOR.item(), null}) + .register(plugin); new FishermanAndroid(itemGroups.androids, 1, SlimefunItems.PROGRAMMABLE_ANDROID_FISHERMAN, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, null, null, new ItemStack(Material.FISHING_ROD), SlimefunItems.PROGRAMMABLE_ANDROID, new ItemStack(Material.FISHING_ROD), null, SlimefunItems.ELECTRIC_MOTOR, null}) - .register(plugin); + new ItemStack[] {null, null, null, new ItemStack(Material.FISHING_ROD), SlimefunItems.PROGRAMMABLE_ANDROID.item(), new ItemStack(Material.FISHING_ROD), null, SlimefunItems.ELECTRIC_MOTOR.item(), null}) + .register(plugin); new ButcherAndroid(itemGroups.androids, 1, SlimefunItems.PROGRAMMABLE_ANDROID_BUTCHER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.GPS_TRANSMITTER, null, new ItemStack(Material.DIAMOND_SWORD), SlimefunItems.PROGRAMMABLE_ANDROID, new ItemStack(Material.DIAMOND_SWORD), null, SlimefunItems.ELECTRIC_MOTOR, null}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.GPS_TRANSMITTER.item(), null, new ItemStack(Material.DIAMOND_SWORD), SlimefunItems.PROGRAMMABLE_ANDROID.item(), new ItemStack(Material.DIAMOND_SWORD), null, SlimefunItems.ELECTRIC_MOTOR.item(), null}) + .register(plugin); new ProgrammableAndroid(itemGroups.androids, 2, SlimefunItems.PROGRAMMABLE_ANDROID_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.PLASTIC_SHEET, SlimefunItems.ANDROID_MEMORY_CORE, SlimefunItems.PLASTIC_SHEET, SlimefunItems.COMBUSTION_REACTOR, SlimefunItems.PROGRAMMABLE_ANDROID, new ItemStack(Material.CHEST), SlimefunItems.PLASTIC_SHEET, SlimefunItems.POWER_CRYSTAL, SlimefunItems.PLASTIC_SHEET}) - .register(plugin); + new ItemStack[] {SlimefunItems.PLASTIC_SHEET.item(), SlimefunItems.ANDROID_MEMORY_CORE.item(), SlimefunItems.PLASTIC_SHEET.item(), SlimefunItems.COMBUSTION_REACTOR.item(), SlimefunItems.PROGRAMMABLE_ANDROID.item(), new ItemStack(Material.CHEST), SlimefunItems.PLASTIC_SHEET.item(), SlimefunItems.POWER_CRYSTAL.item(), SlimefunItems.PLASTIC_SHEET.item()}) + .register(plugin); new FishermanAndroid(itemGroups.androids, 2, SlimefunItems.PROGRAMMABLE_ANDROID_2_FISHERMAN, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, null, null, new ItemStack(Material.FISHING_ROD), SlimefunItems.PROGRAMMABLE_ANDROID_2, new ItemStack(Material.FISHING_ROD), null, SlimefunItems.ELECTRIC_MOTOR, null}) - .register(plugin); + new ItemStack[] {null, null, null, new ItemStack(Material.FISHING_ROD), SlimefunItems.PROGRAMMABLE_ANDROID_2.item(), new ItemStack(Material.FISHING_ROD), null, SlimefunItems.ELECTRIC_MOTOR.item(), null}) + .register(plugin); new ButcherAndroid(itemGroups.androids, 2, SlimefunItems.PROGRAMMABLE_ANDROID_2_BUTCHER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.GPS_TRANSMITTER, null, new ItemStack(Material.DIAMOND_SWORD), SlimefunItems.PROGRAMMABLE_ANDROID_2, new ItemStack(Material.DIAMOND_SWORD), null, SlimefunItems.ELECTRIC_MOTOR, null}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.GPS_TRANSMITTER.item(), null, new ItemStack(Material.DIAMOND_SWORD), SlimefunItems.PROGRAMMABLE_ANDROID_2.item(), new ItemStack(Material.DIAMOND_SWORD), null, SlimefunItems.ELECTRIC_MOTOR.item(), null}) + .register(plugin); new FarmerAndroid(itemGroups.androids, 2, SlimefunItems.PROGRAMMABLE_ANDROID_2_FARMER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.GPS_TRANSMITTER, null, new ItemStack(Material.DIAMOND_HOE), SlimefunItems.PROGRAMMABLE_ANDROID_2, new ItemStack(Material.DIAMOND_HOE), null, SlimefunItems.ELECTRIC_MOTOR, null}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.GPS_TRANSMITTER.item(), null, new ItemStack(Material.DIAMOND_HOE), SlimefunItems.PROGRAMMABLE_ANDROID_2.item(), new ItemStack(Material.DIAMOND_HOE), null, SlimefunItems.ELECTRIC_MOTOR.item(), null}) + .register(plugin); new ProgrammableAndroid(itemGroups.androids, 3, SlimefunItems.PROGRAMMABLE_ANDROID_3, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.PLASTIC_SHEET, SlimefunItems.ANDROID_MEMORY_CORE, SlimefunItems.PLASTIC_SHEET, SlimefunItems.NUCLEAR_REACTOR, SlimefunItems.PROGRAMMABLE_ANDROID_2, new ItemStack(Material.CHEST), SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.POWER_CRYSTAL, SlimefunItems.BLISTERING_INGOT_3}) - .register(plugin); + new ItemStack[] {SlimefunItems.PLASTIC_SHEET.item(), SlimefunItems.ANDROID_MEMORY_CORE.item(), SlimefunItems.PLASTIC_SHEET.item(), SlimefunItems.NUCLEAR_REACTOR.item(), SlimefunItems.PROGRAMMABLE_ANDROID_2.item(), new ItemStack(Material.CHEST), SlimefunItems.BLISTERING_INGOT_3.item(), SlimefunItems.POWER_CRYSTAL.item(), SlimefunItems.BLISTERING_INGOT_3.item()}) + .register(plugin); new FishermanAndroid(itemGroups.androids, 3, SlimefunItems.PROGRAMMABLE_ANDROID_3_FISHERMAN, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, null, null, new ItemStack(Material.FISHING_ROD), SlimefunItems.PROGRAMMABLE_ANDROID_3, new ItemStack(Material.FISHING_ROD), null, SlimefunItems.ELECTRIC_MOTOR, null}) - .register(plugin); + new ItemStack[] {null, null, null, new ItemStack(Material.FISHING_ROD), SlimefunItems.PROGRAMMABLE_ANDROID_3.item(), new ItemStack(Material.FISHING_ROD), null, SlimefunItems.ELECTRIC_MOTOR.item(), null}) + .register(plugin); new ButcherAndroid(itemGroups.androids, 3, SlimefunItems.PROGRAMMABLE_ANDROID_3_BUTCHER, RecipeType.ENHANCED_CRAFTING_TABLE, - 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 ItemStack[] {null, SlimefunItems.GPS_TRANSMITTER_3.item(), null, new ItemStack(Material.DIAMOND_SWORD), SlimefunItems.PROGRAMMABLE_ANDROID_3.item(), new ItemStack(Material.DIAMOND_SWORD), null, SlimefunItems.ELECTRIC_MOTOR.item(), null}) + .register(plugin); new ElementalRune(itemGroups.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 ItemStack[] {new ItemStack(Material.STONE), SlimefunItems.MAGIC_LUMP_1.item(), new ItemStack(Material.STONE), SlimefunItems.MAGIC_LUMP_1.item(), new ItemStack(Material.OBSIDIAN), SlimefunItems.MAGIC_LUMP_1.item(), new ItemStack(Material.STONE), SlimefunItems.MAGIC_LUMP_1.item(), new ItemStack(Material.STONE)}) + .register(plugin); new ElementalRune(itemGroups.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 ItemStack[] {new ItemStack(Material.FEATHER), SlimefunItems.MAGIC_LUMP_1.item(), new ItemStack(Material.FEATHER), new ItemStack(Material.GHAST_TEAR), SlimefunItems.BLANK_RUNE.item(), new ItemStack(Material.GHAST_TEAR), new ItemStack(Material.FEATHER), SlimefunItems.MAGIC_LUMP_1.item(), new ItemStack(Material.FEATHER)}, + new SlimefunItemStack(SlimefunItems.AIR_RUNE, 4).item()) + .register(plugin); new ElementalRune(itemGroups.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 ItemStack[] {new ItemStack(Material.DIRT), SlimefunItems.MAGIC_LUMP_1.item(), new ItemStack(Material.STONE), new ItemStack(Material.OBSIDIAN), SlimefunItems.BLANK_RUNE.item(), new ItemStack(Material.OBSIDIAN), new ItemStack(Material.STONE), SlimefunItems.MAGIC_LUMP_1.item(), new ItemStack(Material.DIRT)}, + new SlimefunItemStack(SlimefunItems.EARTH_RUNE, 4).item()) + .register(plugin); new ElementalRune(itemGroups.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 ItemStack[] {new ItemStack(Material.FIRE_CHARGE), SlimefunItems.MAGIC_LUMP_2.item(), new ItemStack(Material.FIRE_CHARGE), new ItemStack(Material.BLAZE_POWDER), SlimefunItems.EARTH_RUNE.item(), new ItemStack(Material.FLINT_AND_STEEL), new ItemStack(Material.FIRE_CHARGE), SlimefunItems.MAGIC_LUMP_2.item(), new ItemStack(Material.FIRE_CHARGE)}, + new SlimefunItemStack(SlimefunItems.FIRE_RUNE, 4).item()) + .register(plugin); new ElementalRune(itemGroups.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 ItemStack[] {new ItemStack(Material.SALMON), SlimefunItems.MAGIC_LUMP_2.item(), new ItemStack(Material.WATER_BUCKET), new ItemStack(Material.SAND), SlimefunItems.BLANK_RUNE.item(), new ItemStack(Material.SAND), new ItemStack(Material.WATER_BUCKET), SlimefunItems.MAGIC_LUMP_2.item(), new ItemStack(Material.COD)}, + new SlimefunItemStack(SlimefunItems.WATER_RUNE, 4).item()) + .register(plugin); new ElementalRune(itemGroups.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 ItemStack[] {new ItemStack(Material.ENDER_PEARL), SlimefunItems.ENDER_LUMP_3.item(), new ItemStack(Material.ENDER_PEARL), new ItemStack(Material.ENDER_EYE), SlimefunItems.BLANK_RUNE.item(), new ItemStack(Material.ENDER_EYE), new ItemStack(Material.ENDER_PEARL), SlimefunItems.ENDER_LUMP_3.item(), new ItemStack(Material.ENDER_PEARL)}, + new SlimefunItemStack(SlimefunItems.ENDER_RUNE, 6).item()) + .register(plugin); new ElementalRune(itemGroups.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 ItemStack[] {new ItemStack(Material.IRON_INGOT), SlimefunItems.MAGIC_LUMP_3.item(), new ItemStack(Material.IRON_INGOT), SlimefunItems.AIR_RUNE.item(), new ItemStack(Material.PHANTOM_MEMBRANE), SlimefunItems.WATER_RUNE.item(), new ItemStack(Material.IRON_INGOT), SlimefunItems.MAGIC_LUMP_3.item(), new ItemStack(Material.IRON_INGOT)}, + new SlimefunItemStack(SlimefunItems.LIGHTNING_RUNE, 4).item()) + .register(plugin); new ElementalRune(itemGroups.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); + new ItemStack[] {new ItemStack(Material.RED_DYE), SlimefunItems.MAGIC_LUMP_3.item(), new ItemStack(Material.CYAN_DYE), new ItemStack(Material.WHITE_WOOL), SlimefunItems.ENDER_RUNE.item(), new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.YELLOW_DYE), SlimefunItems.ENDER_LUMP_3.item(), new ItemStack(Material.MAGENTA_DYE)}) + .register(plugin); new SoulboundRune(itemGroups.magicalResources, SlimefunItems.SOULBOUND_RUNE, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, SlimefunItems.ESSENCE_OF_AFTERLIFE, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.ENDER_LUMP_3, SlimefunItems.ENDER_RUNE, SlimefunItems.ENDER_LUMP_3, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.ESSENCE_OF_AFTERLIFE, SlimefunItems.MAGIC_LUMP_3}) - .register(plugin); + new ItemStack[] {SlimefunItems.MAGIC_LUMP_3.item(), SlimefunItems.ESSENCE_OF_AFTERLIFE.item(), SlimefunItems.MAGIC_LUMP_3.item(), SlimefunItems.ENDER_LUMP_3.item(), SlimefunItems.ENDER_RUNE.item(), SlimefunItems.ENDER_LUMP_3.item(), SlimefunItems.MAGIC_LUMP_3.item(), SlimefunItems.ESSENCE_OF_AFTERLIFE.item(), SlimefunItems.MAGIC_LUMP_3.item()}) + .register(plugin); new EnchantmentRune(itemGroups.magicalResources, SlimefunItems.ENCHANTMENT_RUNE, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, SlimefunItems.MAGICAL_GLASS, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.MAGICAL_GLASS, SlimefunItems.LIGHTNING_RUNE, SlimefunItems.MAGICAL_GLASS, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.MAGICAL_GLASS, SlimefunItems.MAGIC_LUMP_3}) - .register(plugin); + new ItemStack[] {SlimefunItems.MAGIC_LUMP_3.item(), SlimefunItems.MAGICAL_GLASS.item(), SlimefunItems.MAGIC_LUMP_3.item(), SlimefunItems.MAGICAL_GLASS.item(), SlimefunItems.LIGHTNING_RUNE.item(), SlimefunItems.MAGICAL_GLASS.item(), SlimefunItems.MAGIC_LUMP_3.item(), SlimefunItems.MAGICAL_GLASS.item(), SlimefunItems.MAGIC_LUMP_3.item()}) + .register(plugin); new InfernalBonemeal(itemGroups.magicalGadgets, SlimefunItems.INFERNAL_BONEMEAL, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {new ItemStack(Material.NETHER_WART), SlimefunItems.EARTH_RUNE, new ItemStack(Material.NETHER_WART), SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.BONE_MEAL), SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.NETHER_WART), new ItemStack(Material.BLAZE_POWDER), new ItemStack(Material.NETHER_WART)}, - new SlimefunItemStack(SlimefunItems.INFERNAL_BONEMEAL, 8)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.NETHER_WART), SlimefunItems.EARTH_RUNE.item(), new ItemStack(Material.NETHER_WART), SlimefunItems.MAGIC_LUMP_2.item(), new ItemStack(Material.BONE_MEAL), SlimefunItems.MAGIC_LUMP_2.item(), new ItemStack(Material.NETHER_WART), new ItemStack(Material.BLAZE_POWDER), new ItemStack(Material.NETHER_WART)}, + new SlimefunItemStack(SlimefunItems.INFERNAL_BONEMEAL, 8).item()) + .register(plugin); new SlimefunItem(itemGroups.magicalGadgets, SlimefunItems.ELYTRA_SCALE, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {SlimefunItems.ENDER_LUMP_3, SlimefunItems.AIR_RUNE, SlimefunItems.ENDER_LUMP_3, new ItemStack(Material.PHANTOM_MEMBRANE), new ItemStack(Material.FEATHER), new ItemStack(Material.PHANTOM_MEMBRANE), SlimefunItems.ENDER_LUMP_3, SlimefunItems.AIR_RUNE, SlimefunItems.ENDER_LUMP_3}) - .register(plugin); + new ItemStack[] {SlimefunItems.ENDER_LUMP_3.item(), SlimefunItems.AIR_RUNE.item(), SlimefunItems.ENDER_LUMP_3.item(), new ItemStack(Material.PHANTOM_MEMBRANE), new ItemStack(Material.FEATHER), new ItemStack(Material.PHANTOM_MEMBRANE), SlimefunItems.ENDER_LUMP_3.item(), SlimefunItems.AIR_RUNE.item(), SlimefunItems.ENDER_LUMP_3.item()}) + .register(plugin); new VanillaItem(itemGroups.magicalGadgets, new ItemStack(Material.ELYTRA), "ELYTRA", RecipeType.ANCIENT_ALTAR, - new ItemStack[] {SlimefunItems.ELYTRA_SCALE, SlimefunItems.AIR_RUNE, SlimefunItems.ELYTRA_SCALE, SlimefunItems.AIR_RUNE, new ItemStack(Material.LEATHER_CHESTPLATE), SlimefunItems.AIR_RUNE, SlimefunItems.ELYTRA_SCALE, SlimefunItems.AIR_RUNE, SlimefunItems.ELYTRA_SCALE}) - .register(plugin); + new ItemStack[] {SlimefunItems.ELYTRA_SCALE.item(), SlimefunItems.AIR_RUNE.item(), SlimefunItems.ELYTRA_SCALE.item(), SlimefunItems.AIR_RUNE.item(), new ItemStack(Material.LEATHER_CHESTPLATE), SlimefunItems.AIR_RUNE.item(), SlimefunItems.ELYTRA_SCALE.item(), SlimefunItems.AIR_RUNE.item(), SlimefunItems.ELYTRA_SCALE.item()}) + .register(plugin); new SlimefunItem(itemGroups.magicalGadgets, SlimefunItems.INFUSED_ELYTRA, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {SlimefunItems.FLASK_OF_KNOWLEDGE, SlimefunItems.ELYTRA_SCALE, SlimefunItems.FLASK_OF_KNOWLEDGE, SlimefunItems.FLASK_OF_KNOWLEDGE, new ItemStack(Material.ELYTRA), SlimefunItems.FLASK_OF_KNOWLEDGE, SlimefunItems.FLASK_OF_KNOWLEDGE, SlimefunItems.ELYTRA_SCALE, SlimefunItems.FLASK_OF_KNOWLEDGE}) - .register(plugin); + new ItemStack[] {SlimefunItems.FLASK_OF_KNOWLEDGE.item(), SlimefunItems.ELYTRA_SCALE.item(), SlimefunItems.FLASK_OF_KNOWLEDGE.item(), SlimefunItems.FLASK_OF_KNOWLEDGE.item(), new ItemStack(Material.ELYTRA), SlimefunItems.FLASK_OF_KNOWLEDGE.item(), SlimefunItems.FLASK_OF_KNOWLEDGE.item(), SlimefunItems.ELYTRA_SCALE.item(), SlimefunItems.FLASK_OF_KNOWLEDGE.item()}) + .register(plugin); new SoulboundItem(itemGroups.magicalGadgets, SlimefunItems.SOULBOUND_ELYTRA, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {SlimefunItems.FLASK_OF_KNOWLEDGE, SlimefunItems.ESSENCE_OF_AFTERLIFE, SlimefunItems.FLASK_OF_KNOWLEDGE, SlimefunItems.ELYTRA_SCALE, new ItemStack(Material.ELYTRA), SlimefunItems.ELYTRA_SCALE, SlimefunItems.FLASK_OF_KNOWLEDGE, SlimefunItems.ESSENCE_OF_AFTERLIFE, SlimefunItems.FLASK_OF_KNOWLEDGE}) - .register(plugin); + new ItemStack[] {SlimefunItems.FLASK_OF_KNOWLEDGE.item(), SlimefunItems.ESSENCE_OF_AFTERLIFE.item(), SlimefunItems.FLASK_OF_KNOWLEDGE.item(), SlimefunItems.ELYTRA_SCALE.item(), new ItemStack(Material.ELYTRA), SlimefunItems.ELYTRA_SCALE.item(), SlimefunItems.FLASK_OF_KNOWLEDGE.item(), SlimefunItems.ESSENCE_OF_AFTERLIFE.item(), SlimefunItems.FLASK_OF_KNOWLEDGE.item()}) + .register(plugin); new VanillaItem(itemGroups.magicalGadgets, new ItemStack(Material.TRIDENT), "TRIDENT", RecipeType.ANCIENT_ALTAR, - new ItemStack[] { new ItemStack(Material.NAUTILUS_SHELL), SlimefunItems.REINFORCED_ALLOY_INGOT, new ItemStack(Material.NAUTILUS_SHELL), SlimefunItems.STAFF_WATER, new ItemStack(Material.DIAMOND_SWORD), SlimefunItems.STAFF_WATER, SlimefunItems.MAGIC_LUMP_3, new ItemStack(Material.NETHER_STAR), SlimefunItems.MAGIC_LUMP_3}) - .register(plugin); + new ItemStack[] { new ItemStack(Material.NAUTILUS_SHELL), SlimefunItems.REINFORCED_ALLOY_INGOT.item(), new ItemStack(Material.NAUTILUS_SHELL), SlimefunItems.STAFF_WATER.item(), new ItemStack(Material.DIAMOND_SWORD), SlimefunItems.STAFF_WATER.item(), SlimefunItems.MAGIC_LUMP_3.item(), new ItemStack(Material.NETHER_STAR), SlimefunItems.MAGIC_LUMP_3.item()}) + .register(plugin); new VanillaItem(itemGroups.magicalGadgets, new ItemStack(Material.TOTEM_OF_UNDYING), "TOTEM_OF_UNDYING", RecipeType.ANCIENT_ALTAR, - new ItemStack[] {SlimefunItems.ESSENCE_OF_AFTERLIFE, new ItemStack(Material.EMERALD_BLOCK), SlimefunItems.ESSENCE_OF_AFTERLIFE, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.COMMON_TALISMAN, SlimefunItems.MAGIC_LUMP_3, SlimefunItems.ESSENCE_OF_AFTERLIFE, new ItemStack(Material.EMERALD_BLOCK), SlimefunItems.ESSENCE_OF_AFTERLIFE}) - .register(plugin); + new ItemStack[] {SlimefunItems.ESSENCE_OF_AFTERLIFE.item(), new ItemStack(Material.EMERALD_BLOCK), SlimefunItems.ESSENCE_OF_AFTERLIFE.item(), SlimefunItems.MAGIC_LUMP_3.item(), SlimefunItems.COMMON_TALISMAN.item(), SlimefunItems.MAGIC_LUMP_3.item(), SlimefunItems.ESSENCE_OF_AFTERLIFE.item(), new ItemStack(Material.EMERALD_BLOCK), SlimefunItems.ESSENCE_OF_AFTERLIFE.item()}) + .register(plugin); new RainbowBlock(itemGroups.magicalGadgets, SlimefunItems.RAINBOW_WOOL, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.WHITE_WOOL), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.WHITE_WOOL)}, - new SlimefunItemStack(SlimefunItems.RAINBOW_WOOL, 8), new RainbowTickHandler(ColoredMaterial.WOOL)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.WHITE_WOOL), SlimefunItems.RAINBOW_RUNE.item(), new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.WHITE_WOOL)}, + new SlimefunItemStack(SlimefunItems.RAINBOW_WOOL, 8).item(), new RainbowTickHandler(ColoredMaterial.WOOL)) + .register(plugin); new RainbowBlock(itemGroups.magicalGadgets, SlimefunItems.RAINBOW_GLASS, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {new ItemStack(Material.WHITE_STAINED_GLASS), new ItemStack(Material.WHITE_STAINED_GLASS), new ItemStack(Material.WHITE_STAINED_GLASS), new ItemStack(Material.WHITE_STAINED_GLASS), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_STAINED_GLASS), new ItemStack(Material.WHITE_STAINED_GLASS), new ItemStack(Material.WHITE_STAINED_GLASS), new ItemStack(Material.WHITE_STAINED_GLASS)}, - new SlimefunItemStack(SlimefunItems.RAINBOW_GLASS, 8), new RainbowTickHandler(ColoredMaterial.STAINED_GLASS)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.WHITE_STAINED_GLASS), new ItemStack(Material.WHITE_STAINED_GLASS), new ItemStack(Material.WHITE_STAINED_GLASS), new ItemStack(Material.WHITE_STAINED_GLASS), SlimefunItems.RAINBOW_RUNE.item(), new ItemStack(Material.WHITE_STAINED_GLASS), new ItemStack(Material.WHITE_STAINED_GLASS), new ItemStack(Material.WHITE_STAINED_GLASS), new ItemStack(Material.WHITE_STAINED_GLASS)}, + new SlimefunItemStack(SlimefunItems.RAINBOW_GLASS, 8).item(), new RainbowTickHandler(ColoredMaterial.STAINED_GLASS)) + .register(plugin); new RainbowBlock(itemGroups.magicalGadgets, SlimefunItems.RAINBOW_GLASS_PANE, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {new ItemStack(Material.WHITE_STAINED_GLASS_PANE), new ItemStack(Material.WHITE_STAINED_GLASS_PANE), new ItemStack(Material.WHITE_STAINED_GLASS_PANE), new ItemStack(Material.WHITE_STAINED_GLASS_PANE), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_STAINED_GLASS_PANE), new ItemStack(Material.WHITE_STAINED_GLASS_PANE), new ItemStack(Material.WHITE_STAINED_GLASS_PANE), new ItemStack(Material.WHITE_STAINED_GLASS_PANE)}, - new SlimefunItemStack(SlimefunItems.RAINBOW_GLASS_PANE, 8), new RainbowTickHandler(ColoredMaterial.STAINED_GLASS_PANE)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.WHITE_STAINED_GLASS_PANE), new ItemStack(Material.WHITE_STAINED_GLASS_PANE), new ItemStack(Material.WHITE_STAINED_GLASS_PANE), new ItemStack(Material.WHITE_STAINED_GLASS_PANE), SlimefunItems.RAINBOW_RUNE.item(), new ItemStack(Material.WHITE_STAINED_GLASS_PANE), new ItemStack(Material.WHITE_STAINED_GLASS_PANE), new ItemStack(Material.WHITE_STAINED_GLASS_PANE), new ItemStack(Material.WHITE_STAINED_GLASS_PANE)}, + new SlimefunItemStack(SlimefunItems.RAINBOW_GLASS_PANE, 8).item(), new RainbowTickHandler(ColoredMaterial.STAINED_GLASS_PANE)) + .register(plugin); new RainbowBlock(itemGroups.magicalGadgets, SlimefunItems.RAINBOW_CLAY, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {new ItemStack(Material.WHITE_TERRACOTTA), new ItemStack(Material.WHITE_TERRACOTTA), new ItemStack(Material.WHITE_TERRACOTTA), new ItemStack(Material.WHITE_TERRACOTTA), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_TERRACOTTA), new ItemStack(Material.WHITE_TERRACOTTA), new ItemStack(Material.WHITE_TERRACOTTA), new ItemStack(Material.WHITE_TERRACOTTA)}, - new SlimefunItemStack(SlimefunItems.RAINBOW_CLAY, 8), new RainbowTickHandler(ColoredMaterial.TERRACOTTA)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.WHITE_TERRACOTTA), new ItemStack(Material.WHITE_TERRACOTTA), new ItemStack(Material.WHITE_TERRACOTTA), new ItemStack(Material.WHITE_TERRACOTTA), SlimefunItems.RAINBOW_RUNE.item(), new ItemStack(Material.WHITE_TERRACOTTA), new ItemStack(Material.WHITE_TERRACOTTA), new ItemStack(Material.WHITE_TERRACOTTA), new ItemStack(Material.WHITE_TERRACOTTA)}, + new SlimefunItemStack(SlimefunItems.RAINBOW_CLAY, 8).item(), new RainbowTickHandler(ColoredMaterial.TERRACOTTA)) + .register(plugin); new RainbowBlock(itemGroups.magicalGadgets, SlimefunItems.RAINBOW_CONCRETE, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {new ItemStack(Material.WHITE_CONCRETE), new ItemStack(Material.WHITE_CONCRETE), new ItemStack(Material.WHITE_CONCRETE), new ItemStack(Material.WHITE_CONCRETE), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_CONCRETE), new ItemStack(Material.WHITE_CONCRETE), new ItemStack(Material.WHITE_CONCRETE), new ItemStack(Material.WHITE_CONCRETE)}, - new SlimefunItemStack(SlimefunItems.RAINBOW_CONCRETE, 8), new RainbowTickHandler(ColoredMaterial.CONCRETE)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.WHITE_CONCRETE), new ItemStack(Material.WHITE_CONCRETE), new ItemStack(Material.WHITE_CONCRETE), new ItemStack(Material.WHITE_CONCRETE), SlimefunItems.RAINBOW_RUNE.item(), new ItemStack(Material.WHITE_CONCRETE), new ItemStack(Material.WHITE_CONCRETE), new ItemStack(Material.WHITE_CONCRETE), new ItemStack(Material.WHITE_CONCRETE)}, + new SlimefunItemStack(SlimefunItems.RAINBOW_CONCRETE, 8).item(), new RainbowTickHandler(ColoredMaterial.CONCRETE)) + .register(plugin); new RainbowBlock(itemGroups.magicalGadgets, SlimefunItems.RAINBOW_GLAZED_TERRACOTTA, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), new ItemStack(Material.WHITE_GLAZED_TERRACOTTA)}, - new SlimefunItemStack(SlimefunItems.RAINBOW_GLAZED_TERRACOTTA, 8), new RainbowTickHandler(ColoredMaterial.GLAZED_TERRACOTTA)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), SlimefunItems.RAINBOW_RUNE.item(), new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), new ItemStack(Material.WHITE_GLAZED_TERRACOTTA)}, + new SlimefunItemStack(SlimefunItems.RAINBOW_GLAZED_TERRACOTTA, 8).item(), new RainbowTickHandler(ColoredMaterial.GLAZED_TERRACOTTA)) + .register(plugin); // Christmas new RainbowBlock(itemGroups.christmas, SlimefunItems.RAINBOW_WOOL_XMAS, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {new ItemStack(Material.RED_DYE), SlimefunItems.CHRISTMAS_COOKIE, new ItemStack(Material.GREEN_DYE), new ItemStack(Material.WHITE_WOOL), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.GREEN_DYE), SlimefunItems.CHRISTMAS_COOKIE, new ItemStack(Material.RED_DYE)}, - new SlimefunItemStack(SlimefunItems.RAINBOW_WOOL_XMAS, 2), new RainbowTickHandler(Material.RED_WOOL, Material.GREEN_WOOL)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.RED_DYE), SlimefunItems.CHRISTMAS_COOKIE.item(), new ItemStack(Material.GREEN_DYE), new ItemStack(Material.WHITE_WOOL), SlimefunItems.RAINBOW_RUNE.item(), new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.GREEN_DYE), SlimefunItems.CHRISTMAS_COOKIE.item(), new ItemStack(Material.RED_DYE)}, + new SlimefunItemStack(SlimefunItems.RAINBOW_WOOL_XMAS, 2).item(), new RainbowTickHandler(Material.RED_WOOL, Material.GREEN_WOOL)) + .register(plugin); new RainbowBlock(itemGroups.christmas, SlimefunItems.RAINBOW_GLASS_XMAS, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {new ItemStack(Material.RED_DYE), SlimefunItems.CHRISTMAS_COOKIE, new ItemStack(Material.GREEN_DYE), new ItemStack(Material.WHITE_STAINED_GLASS), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_STAINED_GLASS), new ItemStack(Material.GREEN_DYE), SlimefunItems.CHRISTMAS_COOKIE, new ItemStack(Material.RED_DYE)}, - new SlimefunItemStack(SlimefunItems.RAINBOW_GLASS_XMAS, 2), new RainbowTickHandler(Material.RED_STAINED_GLASS, Material.GREEN_STAINED_GLASS)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.RED_DYE), SlimefunItems.CHRISTMAS_COOKIE.item(), new ItemStack(Material.GREEN_DYE), new ItemStack(Material.WHITE_STAINED_GLASS), SlimefunItems.RAINBOW_RUNE.item(), new ItemStack(Material.WHITE_STAINED_GLASS), new ItemStack(Material.GREEN_DYE), SlimefunItems.CHRISTMAS_COOKIE.item(), new ItemStack(Material.RED_DYE)}, + new SlimefunItemStack(SlimefunItems.RAINBOW_GLASS_XMAS, 2).item(), new RainbowTickHandler(Material.RED_STAINED_GLASS, Material.GREEN_STAINED_GLASS)) + .register(plugin); new RainbowBlock(itemGroups.christmas, SlimefunItems.RAINBOW_GLASS_PANE_XMAS, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {new ItemStack(Material.RED_DYE), SlimefunItems.CHRISTMAS_COOKIE, new ItemStack(Material.GREEN_DYE), new ItemStack(Material.WHITE_STAINED_GLASS_PANE), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_STAINED_GLASS_PANE), new ItemStack(Material.GREEN_DYE), SlimefunItems.CHRISTMAS_COOKIE, new ItemStack(Material.RED_DYE)}, - new SlimefunItemStack(SlimefunItems.RAINBOW_GLASS_PANE_XMAS, 2), new RainbowTickHandler(Material.RED_STAINED_GLASS_PANE, Material.GREEN_STAINED_GLASS_PANE)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.RED_DYE), SlimefunItems.CHRISTMAS_COOKIE.item(), new ItemStack(Material.GREEN_DYE), new ItemStack(Material.WHITE_STAINED_GLASS_PANE), SlimefunItems.RAINBOW_RUNE.item(), new ItemStack(Material.WHITE_STAINED_GLASS_PANE), new ItemStack(Material.GREEN_DYE), SlimefunItems.CHRISTMAS_COOKIE.item(), new ItemStack(Material.RED_DYE)}, + new SlimefunItemStack(SlimefunItems.RAINBOW_GLASS_PANE_XMAS, 2).item(), new RainbowTickHandler(Material.RED_STAINED_GLASS_PANE, Material.GREEN_STAINED_GLASS_PANE)) + .register(plugin); new RainbowBlock(itemGroups.christmas, SlimefunItems.RAINBOW_CLAY_XMAS, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {new ItemStack(Material.RED_DYE), SlimefunItems.CHRISTMAS_COOKIE, new ItemStack(Material.GREEN_DYE), new ItemStack(Material.WHITE_TERRACOTTA), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_TERRACOTTA), new ItemStack(Material.GREEN_DYE), SlimefunItems.CHRISTMAS_COOKIE, new ItemStack(Material.RED_DYE)}, - new SlimefunItemStack(SlimefunItems.RAINBOW_CLAY_XMAS, 2), new RainbowTickHandler(Material.RED_TERRACOTTA, Material.GREEN_TERRACOTTA)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.RED_DYE), SlimefunItems.CHRISTMAS_COOKIE.item(), new ItemStack(Material.GREEN_DYE), new ItemStack(Material.WHITE_TERRACOTTA), SlimefunItems.RAINBOW_RUNE.item(), new ItemStack(Material.WHITE_TERRACOTTA), new ItemStack(Material.GREEN_DYE), SlimefunItems.CHRISTMAS_COOKIE.item(), new ItemStack(Material.RED_DYE)}, + new SlimefunItemStack(SlimefunItems.RAINBOW_CLAY_XMAS, 2).item(), new RainbowTickHandler(Material.RED_TERRACOTTA, Material.GREEN_TERRACOTTA)) + .register(plugin); new RainbowBlock(itemGroups.christmas, SlimefunItems.RAINBOW_CONCRETE_XMAS, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {new ItemStack(Material.RED_DYE), SlimefunItems.CHRISTMAS_COOKIE, new ItemStack(Material.GREEN_DYE), new ItemStack(Material.WHITE_CONCRETE), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_CONCRETE), new ItemStack(Material.GREEN_DYE), SlimefunItems.CHRISTMAS_COOKIE, new ItemStack(Material.RED_DYE)}, - new SlimefunItemStack(SlimefunItems.RAINBOW_CONCRETE_XMAS, 2), new RainbowTickHandler(Material.RED_CONCRETE, Material.GREEN_CONCRETE)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.RED_DYE), SlimefunItems.CHRISTMAS_COOKIE.item(), new ItemStack(Material.GREEN_DYE), new ItemStack(Material.WHITE_CONCRETE), SlimefunItems.RAINBOW_RUNE.item(), new ItemStack(Material.WHITE_CONCRETE), new ItemStack(Material.GREEN_DYE), SlimefunItems.CHRISTMAS_COOKIE.item(), new ItemStack(Material.RED_DYE)}, + new SlimefunItemStack(SlimefunItems.RAINBOW_CONCRETE_XMAS, 2).item(), new RainbowTickHandler(Material.RED_CONCRETE, Material.GREEN_CONCRETE)) + .register(plugin); new RainbowBlock(itemGroups.christmas, SlimefunItems.RAINBOW_GLAZED_TERRACOTTA_XMAS, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {new ItemStack(Material.RED_DYE), SlimefunItems.CHRISTMAS_COOKIE, new ItemStack(Material.GREEN_DYE), new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), new ItemStack(Material.GREEN_DYE), SlimefunItems.CHRISTMAS_COOKIE, new ItemStack(Material.RED_DYE)}, - new SlimefunItemStack(SlimefunItems.RAINBOW_GLAZED_TERRACOTTA_XMAS, 2), new RainbowTickHandler(Material.RED_GLAZED_TERRACOTTA, Material.GREEN_GLAZED_TERRACOTTA)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.RED_DYE), SlimefunItems.CHRISTMAS_COOKIE.item(), new ItemStack(Material.GREEN_DYE), new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), SlimefunItems.RAINBOW_RUNE.item(), new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), new ItemStack(Material.GREEN_DYE), SlimefunItems.CHRISTMAS_COOKIE.item(), new ItemStack(Material.RED_DYE)}, + new SlimefunItemStack(SlimefunItems.RAINBOW_GLAZED_TERRACOTTA_XMAS, 2).item(), new RainbowTickHandler(Material.RED_GLAZED_TERRACOTTA, Material.GREEN_GLAZED_TERRACOTTA)) + .register(plugin); // Valentines Day new RainbowBlock(itemGroups.valentinesDay, SlimefunItems.RAINBOW_WOOL_VALENTINE, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {new ItemStack(Material.RED_DYE), new ItemStack(Material.POPPY), new ItemStack(Material.PINK_DYE), new ItemStack(Material.WHITE_WOOL), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.PINK_DYE), new ItemStack(Material.POPPY), new ItemStack(Material.RED_DYE)}, - new SlimefunItemStack(SlimefunItems.RAINBOW_WOOL_VALENTINE, 2), new RainbowTickHandler(Material.MAGENTA_WOOL, Material.PINK_WOOL)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.RED_DYE), new ItemStack(Material.POPPY), new ItemStack(Material.PINK_DYE), new ItemStack(Material.WHITE_WOOL), SlimefunItems.RAINBOW_RUNE.item(), new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.PINK_DYE), new ItemStack(Material.POPPY), new ItemStack(Material.RED_DYE)}, + new SlimefunItemStack(SlimefunItems.RAINBOW_WOOL_VALENTINE, 2).item(), new RainbowTickHandler(Material.MAGENTA_WOOL, Material.PINK_WOOL)) + .register(plugin); new RainbowBlock(itemGroups.valentinesDay, SlimefunItems.RAINBOW_GLASS_VALENTINE, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {new ItemStack(Material.RED_DYE), new ItemStack(Material.POPPY), new ItemStack(Material.PINK_DYE), new ItemStack(Material.WHITE_STAINED_GLASS), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_STAINED_GLASS), new ItemStack(Material.PINK_DYE), new ItemStack(Material.POPPY), new ItemStack(Material.RED_DYE)}, - new SlimefunItemStack(SlimefunItems.RAINBOW_GLASS_VALENTINE, 2), new RainbowTickHandler(Material.MAGENTA_STAINED_GLASS, Material.PINK_STAINED_GLASS)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.RED_DYE), new ItemStack(Material.POPPY), new ItemStack(Material.PINK_DYE), new ItemStack(Material.WHITE_STAINED_GLASS), SlimefunItems.RAINBOW_RUNE.item(), new ItemStack(Material.WHITE_STAINED_GLASS), new ItemStack(Material.PINK_DYE), new ItemStack(Material.POPPY), new ItemStack(Material.RED_DYE)}, + new SlimefunItemStack(SlimefunItems.RAINBOW_GLASS_VALENTINE, 2).item(), new RainbowTickHandler(Material.MAGENTA_STAINED_GLASS, Material.PINK_STAINED_GLASS)) + .register(plugin); new RainbowBlock(itemGroups.valentinesDay, SlimefunItems.RAINBOW_GLASS_PANE_VALENTINE, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {new ItemStack(Material.RED_DYE), new ItemStack(Material.POPPY), new ItemStack(Material.PINK_DYE), new ItemStack(Material.WHITE_STAINED_GLASS_PANE), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_STAINED_GLASS_PANE), new ItemStack(Material.PINK_DYE), new ItemStack(Material.POPPY), new ItemStack(Material.RED_DYE)}, - new SlimefunItemStack(SlimefunItems.RAINBOW_GLASS_PANE_VALENTINE, 2), new RainbowTickHandler(Material.MAGENTA_STAINED_GLASS_PANE, Material.PINK_STAINED_GLASS_PANE)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.RED_DYE), new ItemStack(Material.POPPY), new ItemStack(Material.PINK_DYE), new ItemStack(Material.WHITE_STAINED_GLASS_PANE), SlimefunItems.RAINBOW_RUNE.item(), new ItemStack(Material.WHITE_STAINED_GLASS_PANE), new ItemStack(Material.PINK_DYE), new ItemStack(Material.POPPY), new ItemStack(Material.RED_DYE)}, + new SlimefunItemStack(SlimefunItems.RAINBOW_GLASS_PANE_VALENTINE, 2).item(), new RainbowTickHandler(Material.MAGENTA_STAINED_GLASS_PANE, Material.PINK_STAINED_GLASS_PANE)) + .register(plugin); new RainbowBlock(itemGroups.valentinesDay, SlimefunItems.RAINBOW_CLAY_VALENTINE, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {new ItemStack(Material.RED_DYE), new ItemStack(Material.POPPY), new ItemStack(Material.PINK_DYE), new ItemStack(Material.WHITE_TERRACOTTA), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_TERRACOTTA), new ItemStack(Material.PINK_DYE), new ItemStack(Material.POPPY), new ItemStack(Material.RED_DYE)}, - new SlimefunItemStack(SlimefunItems.RAINBOW_CLAY_VALENTINE, 2), new RainbowTickHandler(Material.MAGENTA_TERRACOTTA, Material.PINK_TERRACOTTA)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.RED_DYE), new ItemStack(Material.POPPY), new ItemStack(Material.PINK_DYE), new ItemStack(Material.WHITE_TERRACOTTA), SlimefunItems.RAINBOW_RUNE.item(), new ItemStack(Material.WHITE_TERRACOTTA), new ItemStack(Material.PINK_DYE), new ItemStack(Material.POPPY), new ItemStack(Material.RED_DYE)}, + new SlimefunItemStack(SlimefunItems.RAINBOW_CLAY_VALENTINE, 2).item(), new RainbowTickHandler(Material.MAGENTA_TERRACOTTA, Material.PINK_TERRACOTTA)) + .register(plugin); new RainbowBlock(itemGroups.valentinesDay, SlimefunItems.RAINBOW_CONCRETE_VALENTINE, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {new ItemStack(Material.RED_DYE), new ItemStack(Material.POPPY), new ItemStack(Material.PINK_DYE), new ItemStack(Material.WHITE_CONCRETE), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_CONCRETE), new ItemStack(Material.PINK_DYE), new ItemStack(Material.POPPY), new ItemStack(Material.RED_DYE)}, - new SlimefunItemStack(SlimefunItems.RAINBOW_CONCRETE_VALENTINE, 2), new RainbowTickHandler(Material.MAGENTA_CONCRETE, Material.PINK_CONCRETE)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.RED_DYE), new ItemStack(Material.POPPY), new ItemStack(Material.PINK_DYE), new ItemStack(Material.WHITE_CONCRETE), SlimefunItems.RAINBOW_RUNE.item(), new ItemStack(Material.WHITE_CONCRETE), new ItemStack(Material.PINK_DYE), new ItemStack(Material.POPPY), new ItemStack(Material.RED_DYE)}, + new SlimefunItemStack(SlimefunItems.RAINBOW_CONCRETE_VALENTINE, 2).item(), new RainbowTickHandler(Material.MAGENTA_CONCRETE, Material.PINK_CONCRETE)) + .register(plugin); new RainbowBlock(itemGroups.valentinesDay, SlimefunItems.RAINBOW_GLAZED_TERRACOTTA_VALENTINE, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {new ItemStack(Material.RED_DYE), new ItemStack(Material.POPPY), new ItemStack(Material.PINK_DYE), new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), new ItemStack(Material.PINK_DYE), new ItemStack(Material.POPPY), new ItemStack(Material.RED_DYE)}, - new SlimefunItemStack(SlimefunItems.RAINBOW_GLAZED_TERRACOTTA_VALENTINE, 2), new RainbowTickHandler(Material.MAGENTA_GLAZED_TERRACOTTA, Material.PINK_GLAZED_TERRACOTTA)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.RED_DYE), new ItemStack(Material.POPPY), new ItemStack(Material.PINK_DYE), new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), SlimefunItems.RAINBOW_RUNE.item(), new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), new ItemStack(Material.PINK_DYE), new ItemStack(Material.POPPY), new ItemStack(Material.RED_DYE)}, + new SlimefunItemStack(SlimefunItems.RAINBOW_GLAZED_TERRACOTTA_VALENTINE, 2).item(), new RainbowTickHandler(Material.MAGENTA_GLAZED_TERRACOTTA, Material.PINK_GLAZED_TERRACOTTA)) + .register(plugin); // Halloween new RainbowBlock(itemGroups.halloween, SlimefunItems.RAINBOW_WOOL_HALLOWEEN, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {new ItemStack(Material.ORANGE_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(Material.BLACK_DYE), new ItemStack(Material.WHITE_WOOL), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.BLACK_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(Material.ORANGE_DYE)}, - new SlimefunItemStack(SlimefunItems.RAINBOW_WOOL_HALLOWEEN, 2), new RainbowTickHandler(Material.ORANGE_WOOL, Material.BLACK_WOOL)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.ORANGE_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(Material.BLACK_DYE), new ItemStack(Material.WHITE_WOOL), SlimefunItems.RAINBOW_RUNE.item(), new ItemStack(Material.WHITE_WOOL), new ItemStack(Material.BLACK_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(Material.ORANGE_DYE)}, + new SlimefunItemStack(SlimefunItems.RAINBOW_WOOL_HALLOWEEN, 2).item(), new RainbowTickHandler(Material.ORANGE_WOOL, Material.BLACK_WOOL)) + .register(plugin); new RainbowBlock(itemGroups.halloween, SlimefunItems.RAINBOW_GLASS_HALLOWEEN, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {new ItemStack(Material.ORANGE_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(Material.BLACK_DYE), new ItemStack(Material.WHITE_STAINED_GLASS), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_STAINED_GLASS), new ItemStack(Material.BLACK_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(Material.ORANGE_DYE)}, - new SlimefunItemStack(SlimefunItems.RAINBOW_GLASS_HALLOWEEN, 2), new RainbowTickHandler(Material.ORANGE_STAINED_GLASS, Material.BLACK_STAINED_GLASS)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.ORANGE_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(Material.BLACK_DYE), new ItemStack(Material.WHITE_STAINED_GLASS), SlimefunItems.RAINBOW_RUNE.item(), new ItemStack(Material.WHITE_STAINED_GLASS), new ItemStack(Material.BLACK_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(Material.ORANGE_DYE)}, + new SlimefunItemStack(SlimefunItems.RAINBOW_GLASS_HALLOWEEN, 2).item(), new RainbowTickHandler(Material.ORANGE_STAINED_GLASS, Material.BLACK_STAINED_GLASS)) + .register(plugin); new RainbowBlock(itemGroups.halloween, SlimefunItems.RAINBOW_GLASS_PANE_HALLOWEEN, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {new ItemStack(Material.ORANGE_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(Material.BLACK_DYE), new ItemStack(Material.WHITE_STAINED_GLASS_PANE), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_STAINED_GLASS_PANE), new ItemStack(Material.BLACK_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(Material.ORANGE_DYE)}, - new SlimefunItemStack(SlimefunItems.RAINBOW_GLASS_PANE_HALLOWEEN, 2), new RainbowTickHandler(Material.ORANGE_STAINED_GLASS_PANE, Material.BLACK_STAINED_GLASS_PANE)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.ORANGE_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(Material.BLACK_DYE), new ItemStack(Material.WHITE_STAINED_GLASS_PANE), SlimefunItems.RAINBOW_RUNE.item(), new ItemStack(Material.WHITE_STAINED_GLASS_PANE), new ItemStack(Material.BLACK_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(Material.ORANGE_DYE)}, + new SlimefunItemStack(SlimefunItems.RAINBOW_GLASS_PANE_HALLOWEEN, 2).item(), new RainbowTickHandler(Material.ORANGE_STAINED_GLASS_PANE, Material.BLACK_STAINED_GLASS_PANE)) + .register(plugin); new RainbowBlock(itemGroups.halloween, SlimefunItems.RAINBOW_CLAY_HALLOWEEN, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {new ItemStack(Material.ORANGE_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(Material.BLACK_DYE), new ItemStack(Material.WHITE_TERRACOTTA), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_TERRACOTTA), new ItemStack(Material.BLACK_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(Material.ORANGE_DYE)}, - new SlimefunItemStack(SlimefunItems.RAINBOW_CLAY_HALLOWEEN, 2), new RainbowTickHandler(Material.ORANGE_TERRACOTTA, Material.BLACK_TERRACOTTA)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.ORANGE_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(Material.BLACK_DYE), new ItemStack(Material.WHITE_TERRACOTTA), SlimefunItems.RAINBOW_RUNE.item(), new ItemStack(Material.WHITE_TERRACOTTA), new ItemStack(Material.BLACK_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(Material.ORANGE_DYE)}, + new SlimefunItemStack(SlimefunItems.RAINBOW_CLAY_HALLOWEEN, 2).item(), new RainbowTickHandler(Material.ORANGE_TERRACOTTA, Material.BLACK_TERRACOTTA)) + .register(plugin); new RainbowBlock(itemGroups.halloween, SlimefunItems.RAINBOW_CONCRETE_HALLOWEEN, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {new ItemStack(Material.ORANGE_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(Material.BLACK_DYE), new ItemStack(Material.WHITE_CONCRETE), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_CONCRETE), new ItemStack(Material.BLACK_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(Material.ORANGE_DYE)}, - new SlimefunItemStack(SlimefunItems.RAINBOW_CONCRETE_HALLOWEEN, 2), new RainbowTickHandler(Material.ORANGE_CONCRETE, Material.BLACK_CONCRETE)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.ORANGE_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(Material.BLACK_DYE), new ItemStack(Material.WHITE_CONCRETE), SlimefunItems.RAINBOW_RUNE.item(), new ItemStack(Material.WHITE_CONCRETE), new ItemStack(Material.BLACK_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(Material.ORANGE_DYE)}, + new SlimefunItemStack(SlimefunItems.RAINBOW_CONCRETE_HALLOWEEN, 2).item(), new RainbowTickHandler(Material.ORANGE_CONCRETE, Material.BLACK_CONCRETE)) + .register(plugin); new RainbowBlock(itemGroups.halloween, SlimefunItems.RAINBOW_GLAZED_TERRACOTTA_HALLOWEEN, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {new ItemStack(Material.ORANGE_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(Material.BLACK_DYE), new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), new ItemStack(Material.BLACK_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(Material.ORANGE_DYE)}, - new SlimefunItemStack(SlimefunItems.RAINBOW_GLAZED_TERRACOTTA_HALLOWEEN, 2), new RainbowTickHandler(Material.ORANGE_GLAZED_TERRACOTTA, Material.BLACK_GLAZED_TERRACOTTA)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.ORANGE_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(Material.BLACK_DYE), new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), SlimefunItems.RAINBOW_RUNE.item(), new ItemStack(Material.WHITE_GLAZED_TERRACOTTA), new ItemStack(Material.BLACK_DYE), new ItemStack(Material.PUMPKIN), new ItemStack(Material.ORANGE_DYE)}, + new SlimefunItemStack(SlimefunItems.RAINBOW_GLAZED_TERRACOTTA_HALLOWEEN, 2).item(), new RainbowTickHandler(Material.ORANGE_GLAZED_TERRACOTTA, Material.BLACK_GLAZED_TERRACOTTA)) + .register(plugin); new WitherProofBlock(itemGroups.technicalComponents, SlimefunItems.WITHER_PROOF_GLASS, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.LEAD_INGOT, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.LEAD_INGOT, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.HARDENED_GLASS, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.LEAD_INGOT, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.LEAD_INGOT}, - new SlimefunItemStack(SlimefunItems.WITHER_PROOF_GLASS, 4)) - .register(plugin); + new ItemStack[] {SlimefunItems.LEAD_INGOT.item(), SlimefunItems.WITHER_PROOF_OBSIDIAN.item(), SlimefunItems.LEAD_INGOT.item(), SlimefunItems.WITHER_PROOF_OBSIDIAN.item(), SlimefunItems.HARDENED_GLASS.item(), SlimefunItems.WITHER_PROOF_OBSIDIAN.item(), SlimefunItems.LEAD_INGOT.item(), SlimefunItems.WITHER_PROOF_OBSIDIAN.item(), SlimefunItems.LEAD_INGOT.item()}, + new SlimefunItemStack(SlimefunItems.WITHER_PROOF_GLASS, 4).item()) + .register(plugin); new GEOScanner(itemGroups.gps, SlimefunItems.GPS_GEO_SCANNER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, null, SlimefunItems.ELECTRO_MAGNET, null, SlimefunItems.STEEL_INGOT, SlimefunItems.STEEL_INGOT, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ELECTRO_MAGNET}) - .register(plugin); + new ItemStack[] {null, null, SlimefunItems.ELECTRO_MAGNET.item(), null, SlimefunItems.STEEL_INGOT.item(), SlimefunItems.STEEL_INGOT.item(), SlimefunItems.ELECTRO_MAGNET.item(), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.ELECTRO_MAGNET.item()}) + .register(plugin); new PortableGEOScanner(itemGroups.gps, SlimefunItems.PORTABLE_GEO_SCANNER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.ELECTRO_MAGNET, new ItemStack(Material.COMPASS), SlimefunItems.ELECTRO_MAGNET, SlimefunItems.STEEL_INGOT, SlimefunItems.GPS_MARKER_TOOL, SlimefunItems.STEEL_INGOT, SlimefunItems.SOLDER_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.SOLDER_INGOT}) - .register(plugin); + new ItemStack[] {SlimefunItems.ELECTRO_MAGNET.item(), new ItemStack(Material.COMPASS), SlimefunItems.ELECTRO_MAGNET.item(), SlimefunItems.STEEL_INGOT.item(), SlimefunItems.GPS_MARKER_TOOL.item(), SlimefunItems.STEEL_INGOT.item(), SlimefunItems.SOLDER_INGOT.item(), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.SOLDER_INGOT.item()}) + .register(plugin); new OilPump(itemGroups.gps, SlimefunItems.OIL_PUMP, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.STEEL_INGOT, SlimefunItems.MEDIUM_CAPACITOR, SlimefunItems.STEEL_INGOT, SlimefunItems.STEEL_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.STEEL_INGOT, null, new ItemStack(Material.BUCKET), null}) - .setCapacity(256) - .setEnergyConsumption(14) - .setProcessingSpeed(1) - .register(plugin); + new ItemStack[] {SlimefunItems.STEEL_INGOT.item(), SlimefunItems.MEDIUM_CAPACITOR.item(), SlimefunItems.STEEL_INGOT.item(), SlimefunItems.STEEL_INGOT.item(), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.STEEL_INGOT.item(), null, new ItemStack(Material.BUCKET), null}) + .setCapacity(256) + .setEnergyConsumption(14) + .setProcessingSpeed(1) + .register(plugin); new GEOMiner(itemGroups.gps, SlimefunItems.GEO_MINER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.DIAMOND_PICKAXE), SlimefunItems.MEDIUM_CAPACITOR, new ItemStack(Material.DIAMOND_PICKAXE), SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.OIL_PUMP, SlimefunItems.REINFORCED_ALLOY_INGOT, null, SlimefunItems.ELECTRIC_MOTOR, null}) - .setCapacity(512) - .setEnergyConsumption(24) - .setProcessingSpeed(1) - .register(plugin); + new ItemStack[] {new ItemStack(Material.DIAMOND_PICKAXE), SlimefunItems.MEDIUM_CAPACITOR.item(), new ItemStack(Material.DIAMOND_PICKAXE), SlimefunItems.REINFORCED_ALLOY_INGOT.item(), SlimefunItems.OIL_PUMP.item(), SlimefunItems.REINFORCED_ALLOY_INGOT.item(), null, SlimefunItems.ELECTRIC_MOTOR.item(), null}) + .setCapacity(512) + .setEnergyConsumption(24) + .setProcessingSpeed(1) + .register(plugin); new SlimefunItem(itemGroups.resources, SlimefunItems.OIL_BUCKET, new RecipeType(new NamespacedKey(plugin, "oil_pump"), SlimefunItems.OIL_PUMP), - new ItemStack[] {null, null, null, null, new ItemStack(Material.BUCKET), null, null, null, null}) - .register(plugin); + new ItemStack[] {null, null, null, null, new ItemStack(Material.BUCKET), null, null, null, null}) + .register(plugin); new SlimefunItem(itemGroups.resources, SlimefunItems.FUEL_BUCKET, RecipeType.REFINERY, - new ItemStack[] {null, null, null, null, SlimefunItems.OIL_BUCKET, null, null, null, null}) - .register(plugin); + new ItemStack[] {null, null, null, null, SlimefunItems.OIL_BUCKET.item(), null, null, null, null}) + .register(plugin); new RadioactiveItem(itemGroups.resources, Radioactivity.MODERATE, SlimefunItems.NETHER_ICE, RecipeType.GEO_MINER, - new ItemStack[] {null, null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {null, null, null, null, null, null, null, null, null}) + .register(plugin); new Refinery(itemGroups.electricity, SlimefunItems.REFINERY, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.HARDENED_GLASS, SlimefunItems.REDSTONE_ALLOY, SlimefunItems.HARDENED_GLASS, SlimefunItems.HARDENED_GLASS, SlimefunItems.REDSTONE_ALLOY, SlimefunItems.HARDENED_GLASS, new ItemStack(Material.PISTON), SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.PISTON)}) - .setCapacity(256) - .setEnergyConsumption(16) - .setProcessingSpeed(1) - .register(plugin); + new ItemStack[] {SlimefunItems.HARDENED_GLASS.item(), SlimefunItems.REDSTONE_ALLOY.item(), SlimefunItems.HARDENED_GLASS.item(), SlimefunItems.HARDENED_GLASS.item(), SlimefunItems.REDSTONE_ALLOY.item(), SlimefunItems.HARDENED_GLASS.item(), new ItemStack(Material.PISTON), SlimefunItems.ELECTRIC_MOTOR.item(), new ItemStack(Material.PISTON)}) + .setCapacity(256) + .setEnergyConsumption(16) + .setProcessingSpeed(1) + .register(plugin); new LavaGenerator(itemGroups.electricity, SlimefunItems.LAVA_GENERATOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.GOLD_16K, null, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.HEATING_COIL, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.HEATING_COIL}) - .setCapacity(512) - .setEnergyProduction(10) - .register(plugin); + new ItemStack[] {null, SlimefunItems.GOLD_16K.item(), null, SlimefunItems.DAMASCUS_STEEL_INGOT.item(), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.DAMASCUS_STEEL_INGOT.item(), SlimefunItems.HEATING_COIL.item(), SlimefunItems.DAMASCUS_STEEL_INGOT.item(), SlimefunItems.HEATING_COIL.item()}) + .setCapacity(512) + .setEnergyProduction(10) + .register(plugin); new LavaGenerator(itemGroups.electricity, SlimefunItems.LAVA_GENERATOR_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.COMPRESSED_CARBON, SlimefunItems.LAVA_GENERATOR, SlimefunItems.COMPRESSED_CARBON, SlimefunItems.HEATING_COIL, SlimefunItems.COMPRESSED_CARBON, SlimefunItems.HEATING_COIL}) - .setCapacity(1024) - .setEnergyProduction(20) - .register(plugin); + new ItemStack[] {SlimefunItems.CORINTHIAN_BRONZE_INGOT.item(), SlimefunItems.CORINTHIAN_BRONZE_INGOT.item(), SlimefunItems.CORINTHIAN_BRONZE_INGOT.item(), SlimefunItems.COMPRESSED_CARBON.item(), SlimefunItems.LAVA_GENERATOR.item(), SlimefunItems.COMPRESSED_CARBON.item(), SlimefunItems.HEATING_COIL.item(), SlimefunItems.COMPRESSED_CARBON.item(), SlimefunItems.HEATING_COIL.item()}) + .setCapacity(1024) + .setEnergyProduction(20) + .register(plugin); new CombustionGenerator(itemGroups.electricity, SlimefunItems.COMBUSTION_REACTOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.STEEL_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.STEEL_INGOT, SlimefunItems.HEATING_COIL, SlimefunItems.STEEL_INGOT, SlimefunItems.HEATING_COIL}) - .setCapacity(256) - .setEnergyProduction(12) - .register(plugin); + new ItemStack[] {null, SlimefunItems.STEEL_INGOT.item(), null, SlimefunItems.STEEL_INGOT.item(), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.STEEL_INGOT.item(), SlimefunItems.HEATING_COIL.item(), SlimefunItems.STEEL_INGOT.item(), SlimefunItems.HEATING_COIL.item()}) + .setCapacity(256) + .setEnergyProduction(12) + .register(plugin); new TeleporterPylon(itemGroups.gps, SlimefunItems.GPS_TELEPORTER_PYLON, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.ZINC_INGOT, new ItemStack(Material.GLASS), SlimefunItems.ZINC_INGOT, new ItemStack(Material.GLASS), SlimefunItems.HEATING_COIL, new ItemStack(Material.GLASS), SlimefunItems.ZINC_INGOT, new ItemStack(Material.GLASS), SlimefunItems.ZINC_INGOT}, - new SlimefunItemStack(SlimefunItems.GPS_TELEPORTER_PYLON, 8)) - .register(plugin); + new ItemStack[] {SlimefunItems.ZINC_INGOT.item(), new ItemStack(Material.GLASS), SlimefunItems.ZINC_INGOT.item(), new ItemStack(Material.GLASS), SlimefunItems.HEATING_COIL.item(), new ItemStack(Material.GLASS), SlimefunItems.ZINC_INGOT.item(), new ItemStack(Material.GLASS), SlimefunItems.ZINC_INGOT.item()}, + new SlimefunItemStack(SlimefunItems.GPS_TELEPORTER_PYLON, 8).item()) + .register(plugin); new Teleporter(itemGroups.gps, SlimefunItems.GPS_TELEPORTATION_MATRIX, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.GPS_TELEPORTER_PYLON, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.GPS_TELEPORTER_PYLON, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.GPS_CONTROL_PANEL, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.GPS_TELEPORTER_PYLON, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.GPS_TELEPORTER_PYLON}) - .register(plugin); + new ItemStack[] {SlimefunItems.GPS_TELEPORTER_PYLON.item(), SlimefunItems.REINFORCED_ALLOY_INGOT.item(), SlimefunItems.GPS_TELEPORTER_PYLON.item(), SlimefunItems.ELECTRO_MAGNET.item(), SlimefunItems.GPS_CONTROL_PANEL.item(), SlimefunItems.ELECTRO_MAGNET.item(), SlimefunItems.GPS_TELEPORTER_PYLON.item(), SlimefunItems.REINFORCED_ALLOY_INGOT.item(), SlimefunItems.GPS_TELEPORTER_PYLON.item()}) + .register(plugin); new PortableTeleporter(itemGroups.gps, SlimefunItems.PORTABLE_TELEPORTER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.ELECTRO_MAGNET, SlimefunItems.GPS_TRANSMITTER_3, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.REINFORCED_PLATE, SlimefunItems.GPS_TELEPORTATION_MATRIX, SlimefunItems.REINFORCED_PLATE, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.MEDIUM_CAPACITOR, SlimefunItems.BLISTERING_INGOT_3}) - .register(plugin); + new ItemStack[] {SlimefunItems.ELECTRO_MAGNET.item(), SlimefunItems.GPS_TRANSMITTER_3.item(), SlimefunItems.ELECTRO_MAGNET.item(), SlimefunItems.REINFORCED_PLATE.item(), SlimefunItems.GPS_TELEPORTATION_MATRIX.item(), SlimefunItems.REINFORCED_PLATE.item(), SlimefunItems.BLISTERING_INGOT_3.item(), SlimefunItems.MEDIUM_CAPACITOR.item(), SlimefunItems.BLISTERING_INGOT_3.item()}) + .register(plugin); new SharedActivationPlate(itemGroups.gps, SlimefunItems.GPS_ACTIVATION_DEVICE_SHARED, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.STONE_PRESSURE_PLATE), null, new ItemStack(Material.REDSTONE), SlimefunItems.GPS_TRANSMITTER, new ItemStack(Material.REDSTONE), SlimefunItems.BILLON_INGOT, SlimefunItems.BILLON_INGOT, SlimefunItems.BILLON_INGOT}) - .register(plugin); + new ItemStack[] {null, new ItemStack(Material.STONE_PRESSURE_PLATE), null, new ItemStack(Material.REDSTONE), SlimefunItems.GPS_TRANSMITTER.item(), new ItemStack(Material.REDSTONE), SlimefunItems.BILLON_INGOT.item(), SlimefunItems.BILLON_INGOT.item(), SlimefunItems.BILLON_INGOT.item()}) + .register(plugin); new PersonalActivationPlate(itemGroups.gps, SlimefunItems.GPS_ACTIVATION_DEVICE_PERSONAL, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.LEAD_INGOT, null, SlimefunItems.COBALT_INGOT, SlimefunItems.GPS_ACTIVATION_DEVICE_SHARED, SlimefunItems.COBALT_INGOT, null, SlimefunItems.LEAD_INGOT, null}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.LEAD_INGOT.item(), null, SlimefunItems.COBALT_INGOT.item(), SlimefunItems.GPS_ACTIVATION_DEVICE_SHARED.item(), SlimefunItems.COBALT_INGOT.item(), null, SlimefunItems.LEAD_INGOT.item(), null}) + .register(plugin); new InfusedHopper(itemGroups.magicalGadgets, SlimefunItems.INFUSED_HOPPER, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {new ItemStack(Material.OBSIDIAN), SlimefunItems.EARTH_RUNE, new ItemStack(Material.HOPPER), SlimefunItems.ENDER_RUNE, SlimefunItems.INFUSED_MAGNET, SlimefunItems.ENDER_RUNE, new ItemStack(Material.HOPPER), SlimefunItems.EARTH_RUNE, new ItemStack(Material.OBSIDIAN)}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.OBSIDIAN), SlimefunItems.EARTH_RUNE.item(), new ItemStack(Material.HOPPER), SlimefunItems.ENDER_RUNE.item(), SlimefunItems.INFUSED_MAGNET.item(), SlimefunItems.ENDER_RUNE.item(), new ItemStack(Material.HOPPER), SlimefunItems.EARTH_RUNE.item(), new ItemStack(Material.OBSIDIAN)}) + .register(plugin); new RadioactiveItem(itemGroups.resources, Radioactivity.HIGH, SlimefunItems.BLISTERING_INGOT, RecipeType.HEATED_PRESSURE_CHAMBER, - new ItemStack[] {SlimefunItems.GOLD_24K, SlimefunItems.URANIUM, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.GOLD_24K.item(), SlimefunItems.URANIUM.item(), null, null, null, null, null, null, null}) + .register(plugin); new RadioactiveItem(itemGroups.resources, Radioactivity.VERY_HIGH, SlimefunItems.BLISTERING_INGOT_2, RecipeType.HEATED_PRESSURE_CHAMBER, - new ItemStack[] {SlimefunItems.BLISTERING_INGOT, SlimefunItems.CARBONADO, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.BLISTERING_INGOT.item(), SlimefunItems.CARBONADO.item(), null, null, null, null, null, null, null}) + .register(plugin); new RadioactiveItem(itemGroups.resources, Radioactivity.VERY_HIGH, SlimefunItems.BLISTERING_INGOT_3, RecipeType.HEATED_PRESSURE_CHAMBER, - new ItemStack[] {SlimefunItems.BLISTERING_INGOT_2, new ItemStack(Material.NETHER_STAR), null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.BLISTERING_INGOT_2.item(), new ItemStack(Material.NETHER_STAR), null, null, null, null, null, null, null}) + .register(plugin); new RadioactiveItem(itemGroups.resources, Radioactivity.VERY_HIGH, SlimefunItems.ENRICHED_NETHER_ICE, RecipeType.HEATED_PRESSURE_CHAMBER, - new ItemStack[] {SlimefunItems.NETHER_ICE, SlimefunItems.PLUTONIUM, null, null, null, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.ENRICHED_NETHER_ICE, 4)) - .register(plugin); + new ItemStack[] {SlimefunItems.NETHER_ICE.item(), SlimefunItems.PLUTONIUM.item(), null, null, null, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.ENRICHED_NETHER_ICE, 4).item()) + .register(plugin); new ElevatorPlate(itemGroups.gps, SlimefunItems.ELEVATOR_PLATE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.STONE_PRESSURE_PLATE), null, new ItemStack(Material.PISTON), SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.PISTON), SlimefunItems.ALUMINUM_BRONZE_INGOT, SlimefunItems.ALUMINUM_BRONZE_INGOT, SlimefunItems.ALUMINUM_BRONZE_INGOT}, - new SlimefunItemStack(SlimefunItems.ELEVATOR_PLATE, 2)) - .register(plugin); + new ItemStack[] {null, new ItemStack(Material.STONE_PRESSURE_PLATE), null, new ItemStack(Material.PISTON), SlimefunItems.ELECTRIC_MOTOR.item(), new ItemStack(Material.PISTON), SlimefunItems.ALUMINUM_BRONZE_INGOT.item(), SlimefunItems.ALUMINUM_BRONZE_INGOT.item(), SlimefunItems.ALUMINUM_BRONZE_INGOT.item()}, + new SlimefunItemStack(SlimefunItems.ELEVATOR_PLATE, 2).item()) + .register(plugin); new FoodFabricator(itemGroups.electricity, SlimefunItems.FOOD_FABRICATOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.BILLON_INGOT, SlimefunItems.SILVER_INGOT, SlimefunItems.BILLON_INGOT, SlimefunItems.TIN_CAN, SlimefunItems.SMALL_CAPACITOR, SlimefunItems.TIN_CAN, null, SlimefunItems.ELECTRIC_MOTOR, null}) - .setCapacity(256) - .setEnergyConsumption(7) - .setProcessingSpeed(1) - .register(plugin); + new ItemStack[] {SlimefunItems.BILLON_INGOT.item(), SlimefunItems.SILVER_INGOT.item(), SlimefunItems.BILLON_INGOT.item(), SlimefunItems.TIN_CAN.item(), SlimefunItems.SMALL_CAPACITOR.item(), SlimefunItems.TIN_CAN.item(), null, SlimefunItems.ELECTRIC_MOTOR.item(), null}) + .setCapacity(256) + .setEnergyConsumption(7) + .setProcessingSpeed(1) + .register(plugin); new FoodFabricator(itemGroups.electricity, SlimefunItems.FOOD_FABRICATOR_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.HARDENED_METAL_INGOT, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.HARDENED_METAL_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.FOOD_FABRICATOR, SlimefunItems.ELECTRIC_MOTOR, null, SlimefunItems.ELECTRO_MAGNET, null}) - .setCapacity(512) - .setEnergyConsumption(24) - .setProcessingSpeed(6) - .register(plugin); + new ItemStack[] {SlimefunItems.HARDENED_METAL_INGOT.item(), SlimefunItems.REINFORCED_ALLOY_INGOT.item(), SlimefunItems.HARDENED_METAL_INGOT.item(), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.FOOD_FABRICATOR.item(), SlimefunItems.ELECTRIC_MOTOR.item(), null, SlimefunItems.ELECTRO_MAGNET.item(), null}) + .setCapacity(512) + .setEnergyConsumption(24) + .setProcessingSpeed(6) + .register(plugin); new OrganicFood(itemGroups.misc, SlimefunItems.WHEAT_ORGANIC_FOOD, Material.WHEAT) - .register(plugin); + .register(plugin); new OrganicFood(itemGroups.misc, SlimefunItems.CARROT_ORGANIC_FOOD, Material.CARROT) - .register(plugin); + .register(plugin); new OrganicFood(itemGroups.misc, SlimefunItems.POTATO_ORGANIC_FOOD, Material.POTATO) - .register(plugin); + .register(plugin); new OrganicFood(itemGroups.misc, SlimefunItems.SEEDS_ORGANIC_FOOD, Material.WHEAT_SEEDS) - .register(plugin); + .register(plugin); new OrganicFood(itemGroups.misc, SlimefunItems.BEETROOT_ORGANIC_FOOD, Material.BEETROOT) - .register(plugin); + .register(plugin); new OrganicFood(itemGroups.misc, SlimefunItems.MELON_ORGANIC_FOOD, Material.MELON_SLICE) - .register(plugin); + .register(plugin); new OrganicFood(itemGroups.misc, SlimefunItems.APPLE_ORGANIC_FOOD, Material.APPLE) - .register(plugin); + .register(plugin); new OrganicFood(itemGroups.misc, SlimefunItems.SWEET_BERRIES_ORGANIC_FOOD, Material.SWEET_BERRIES) - .register(plugin); + .register(plugin); new OrganicFood(itemGroups.misc, SlimefunItems.KELP_ORGANIC_FOOD, Material.DRIED_KELP) - .register(plugin); + .register(plugin); new OrganicFood(itemGroups.misc, SlimefunItems.COCOA_ORGANIC_FOOD, Material.COCOA_BEANS) - .register(plugin); + .register(plugin); new OrganicFood(itemGroups.misc, SlimefunItems.SEAGRASS_ORGANIC_FOOD, Material.SEAGRASS) - .register(plugin); + .register(plugin); new AutoBreeder(itemGroups.electricity, SlimefunItems.AUTO_BREEDER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.GOLD_18K, SlimefunItems.TIN_CAN, SlimefunItems.GOLD_18K, SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.HAY_BLOCK), SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.LEAD_INGOT, SlimefunItems.FOOD_FABRICATOR, SlimefunItems.LEAD_INGOT}) - .register(plugin); + new ItemStack[] {SlimefunItems.GOLD_18K.item(), SlimefunItems.TIN_CAN.item(), SlimefunItems.GOLD_18K.item(), SlimefunItems.ELECTRIC_MOTOR.item(), new ItemStack(Material.HAY_BLOCK), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.LEAD_INGOT.item(), SlimefunItems.FOOD_FABRICATOR.item(), SlimefunItems.LEAD_INGOT.item()}) + .register(plugin); new AnimalGrowthAccelerator(itemGroups.electricity, SlimefunItems.ANIMAL_GROWTH_ACCELERATOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.BLISTERING_INGOT_3, null, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.WHEAT_ORGANIC_FOOD, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.AUTO_BREEDER, SlimefunItems.REINFORCED_ALLOY_INGOT}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.BLISTERING_INGOT_3.item(), null, SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.WHEAT_ORGANIC_FOOD.item(), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.REINFORCED_ALLOY_INGOT.item(), SlimefunItems.AUTO_BREEDER.item(), SlimefunItems.REINFORCED_ALLOY_INGOT.item()}) + .register(plugin); new TreeGrowthAccelerator(itemGroups.electricity, SlimefunItems.TREE_GROWTH_ACCELERATOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.CARBONADO, null, SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.DIAMOND_AXE), SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.MAGNESIUM_SALT, SlimefunItems.BIG_CAPACITOR, SlimefunItems.MAGNESIUM_SALT}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.CARBONADO.item(), null, SlimefunItems.ELECTRIC_MOTOR.item(), new ItemStack(Material.DIAMOND_AXE), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.MAGNESIUM_SALT.item(), SlimefunItems.BIG_CAPACITOR.item(), SlimefunItems.MAGNESIUM_SALT.item()}) + .register(plugin); new ExpCollector(itemGroups.electricity, SlimefunItems.EXP_COLLECTOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.BLISTERING_INGOT_3, null, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.AUTO_ENCHANTER, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.ALUMINUM_BRONZE_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ALUMINUM_BRONZE_INGOT}) + new ItemStack[] {null, SlimefunItems.BLISTERING_INGOT_3.item(), null, SlimefunItems.WITHER_PROOF_OBSIDIAN.item(), SlimefunItems.AUTO_ENCHANTER.item(), SlimefunItems.WITHER_PROOF_OBSIDIAN.item(), SlimefunItems.ALUMINUM_BRONZE_INGOT.item(), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.ALUMINUM_BRONZE_INGOT.item()}) + .setEnergyConsumption(10) + .setCapacity(1024) .register(plugin); new FoodComposter(itemGroups.electricity, SlimefunItems.FOOD_COMPOSTER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.FOOD_FABRICATOR, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.TIN_CAN, SlimefunItems.MEDIUM_CAPACITOR, SlimefunItems.TIN_CAN, null, SlimefunItems.ELECTRIC_MOTOR, null}) - .setCapacity(256) - .setEnergyConsumption(8) - .setProcessingSpeed(1) - .register(plugin); + new ItemStack[] {SlimefunItems.DAMASCUS_STEEL_INGOT.item(), SlimefunItems.FOOD_FABRICATOR.item(), SlimefunItems.DAMASCUS_STEEL_INGOT.item(), SlimefunItems.TIN_CAN.item(), SlimefunItems.MEDIUM_CAPACITOR.item(), SlimefunItems.TIN_CAN.item(), null, SlimefunItems.ELECTRIC_MOTOR.item(), null}) + .setCapacity(256) + .setEnergyConsumption(8) + .setProcessingSpeed(1) + .register(plugin); new FoodComposter(itemGroups.electricity, SlimefunItems.FOOD_COMPOSTER_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.HARDENED_METAL_INGOT, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.HARDENED_METAL_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.FOOD_COMPOSTER, SlimefunItems.ELECTRIC_MOTOR, null, SlimefunItems.ELECTRO_MAGNET, null}) - .setCapacity(512) - .setEnergyConsumption(26) - .setProcessingSpeed(10) - .register(plugin); + new ItemStack[] {SlimefunItems.HARDENED_METAL_INGOT.item(), SlimefunItems.REINFORCED_ALLOY_INGOT.item(), SlimefunItems.HARDENED_METAL_INGOT.item(), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.FOOD_COMPOSTER.item(), SlimefunItems.ELECTRIC_MOTOR.item(), null, SlimefunItems.ELECTRO_MAGNET.item(), null}) + .setCapacity(512) + .setEnergyConsumption(26) + .setProcessingSpeed(10) + .register(plugin); new OrganicFertilizer(itemGroups.misc, SlimefunItems.WHEAT_FERTILIZER, SlimefunItems.WHEAT_ORGANIC_FOOD) - .register(plugin); + .register(plugin); new OrganicFertilizer(itemGroups.misc, SlimefunItems.CARROT_FERTILIZER, SlimefunItems.CARROT_ORGANIC_FOOD) - .register(plugin); + .register(plugin); new OrganicFertilizer(itemGroups.misc, SlimefunItems.POTATO_FERTILIZER, SlimefunItems.POTATO_ORGANIC_FOOD) - .register(plugin); + .register(plugin); new OrganicFertilizer(itemGroups.misc, SlimefunItems.SEEDS_FERTILIZER, SlimefunItems.SEEDS_ORGANIC_FOOD) - .register(plugin); + .register(plugin); new OrganicFertilizer(itemGroups.misc, SlimefunItems.BEETROOT_FERTILIZER, SlimefunItems.BEETROOT_ORGANIC_FOOD) - .register(plugin); + .register(plugin); new OrganicFertilizer(itemGroups.misc, SlimefunItems.MELON_FERTILIZER, SlimefunItems.MELON_ORGANIC_FOOD) - .register(plugin); + .register(plugin); new OrganicFertilizer(itemGroups.misc, SlimefunItems.APPLE_FERTILIZER, SlimefunItems.APPLE_ORGANIC_FOOD) - .register(plugin); + .register(plugin); new OrganicFertilizer(itemGroups.misc, SlimefunItems.SWEET_BERRIES_FERTILIZER, SlimefunItems.SWEET_BERRIES_ORGANIC_FOOD) - .register(plugin); + .register(plugin); new OrganicFertilizer(itemGroups.misc, SlimefunItems.KELP_FERTILIZER, SlimefunItems.KELP_ORGANIC_FOOD) - .register(plugin); + .register(plugin); new OrganicFertilizer(itemGroups.misc, SlimefunItems.COCOA_FERTILIZER, SlimefunItems.COCOA_ORGANIC_FOOD) - .register(plugin); + .register(plugin); new OrganicFertilizer(itemGroups.misc, SlimefunItems.SEAGRASS_FERTILIZER, SlimefunItems.SEAGRASS_ORGANIC_FOOD) - .register(plugin); + .register(plugin); new CropGrowthAccelerator(itemGroups.electricity, SlimefunItems.CROP_GROWTH_ACCELERATOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.BLISTERING_INGOT_3, null, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.PROGRAMMABLE_ANDROID_FARMER, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.ANIMAL_GROWTH_ACCELERATOR, SlimefunItems.ELECTRO_MAGNET}) { + new ItemStack[] {null, SlimefunItems.BLISTERING_INGOT_3.item(), null, SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.PROGRAMMABLE_ANDROID_FARMER.item(), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.ELECTRO_MAGNET.item(), SlimefunItems.ANIMAL_GROWTH_ACCELERATOR.item(), SlimefunItems.ELECTRO_MAGNET.item()}) { @Override public int getEnergyConsumption() { @@ -2457,7 +2459,7 @@ public int getSpeed() { }.register(plugin); new CropGrowthAccelerator(itemGroups.electricity, SlimefunItems.CROP_GROWTH_ACCELERATOR_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.BLISTERING_INGOT_3, null, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.CROP_GROWTH_ACCELERATOR, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.ADVANCED_CIRCUIT_BOARD, SlimefunItems.ELECTRO_MAGNET}) { + new ItemStack[] {null, SlimefunItems.BLISTERING_INGOT_3.item(), null, SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.CROP_GROWTH_ACCELERATOR.item(), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.ELECTRO_MAGNET.item(), SlimefunItems.ADVANCED_CIRCUIT_BOARD.item(), SlimefunItems.ELECTRO_MAGNET.item()}) { @Override public int getEnergyConsumption() { @@ -2477,49 +2479,49 @@ public int getSpeed() { }.register(plugin); new Freezer(itemGroups.electricity, SlimefunItems.FREEZER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.SILVER_INGOT, null, SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.PACKED_ICE), SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.COOLING_UNIT, SlimefunItems.MEDIUM_CAPACITOR, SlimefunItems.COOLING_UNIT}) - .setCapacity(256) - .setEnergyConsumption(9) - .setProcessingSpeed(1) - .register(plugin); + new ItemStack[] {null, SlimefunItems.SILVER_INGOT.item(), null, SlimefunItems.ELECTRIC_MOTOR.item(), new ItemStack(Material.PACKED_ICE), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.COOLING_UNIT.item(), SlimefunItems.MEDIUM_CAPACITOR.item(), SlimefunItems.COOLING_UNIT.item()}) + .setCapacity(256) + .setEnergyConsumption(9) + .setProcessingSpeed(1) + .register(plugin); new Freezer(itemGroups.electricity, SlimefunItems.FREEZER_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.SILVER_INGOT, null, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.FREEZER, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.COOLING_UNIT, SlimefunItems.ALUMINUM_BRASS_INGOT, SlimefunItems.COOLING_UNIT}) - .setCapacity(256) - .setEnergyConsumption(15) - .setProcessingSpeed(2) - .register(plugin); + new ItemStack[] {null, SlimefunItems.SILVER_INGOT.item(), null, SlimefunItems.ELECTRO_MAGNET.item(), SlimefunItems.FREEZER.item(), SlimefunItems.ELECTRO_MAGNET.item(), SlimefunItems.COOLING_UNIT.item(), SlimefunItems.ALUMINUM_BRASS_INGOT.item(), SlimefunItems.COOLING_UNIT.item()}) + .setCapacity(256) + .setEnergyConsumption(15) + .setProcessingSpeed(2) + .register(plugin); new Freezer(itemGroups.electricity, SlimefunItems.FREEZER_3, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.FREEZER_2, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.COOLING_UNIT, SlimefunItems.COOLING_UNIT, SlimefunItems.COOLING_UNIT}) - .setCapacity(256) - .setEnergyConsumption(21) - .setProcessingSpeed(3) - .register(plugin); + new ItemStack[] {SlimefunItems.REINFORCED_ALLOY_INGOT.item(), SlimefunItems.REINFORCED_ALLOY_INGOT.item(), SlimefunItems.REINFORCED_ALLOY_INGOT.item(), SlimefunItems.ELECTRO_MAGNET.item(), SlimefunItems.FREEZER_2.item(), SlimefunItems.ELECTRO_MAGNET.item(), SlimefunItems.COOLING_UNIT.item(), SlimefunItems.COOLING_UNIT.item(), SlimefunItems.COOLING_UNIT.item()}) + .setCapacity(256) + .setEnergyConsumption(21) + .setProcessingSpeed(3) + .register(plugin); new CoolantCell(itemGroups.technicalComponents, SlimefunItems.REACTOR_COOLANT_CELL, RecipeType.FREEZER, - new ItemStack[] {new ItemStack(Material.BLUE_ICE), null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.BLUE_ICE), null, null, null, null, null, null, null, null}) + .register(plugin); new CoolantCell(itemGroups.technicalComponents, SlimefunItems.NETHER_ICE_COOLANT_CELL, RecipeType.HEATED_PRESSURE_CHAMBER, - new ItemStack[] {SlimefunItems.ENRICHED_NETHER_ICE, null, null, null, null, null, null, null, null}, - new SlimefunItemStack(SlimefunItems.NETHER_ICE_COOLANT_CELL, 8)) - .register(plugin); + new ItemStack[] {SlimefunItems.ENRICHED_NETHER_ICE.item(), null, null, null, null, null, null, null, null}, + new SlimefunItemStack(SlimefunItems.NETHER_ICE_COOLANT_CELL, 8).item()) + .register(plugin); new RadioactiveItem(itemGroups.resources, Radioactivity.HIGH, SlimefunItems.NEPTUNIUM, RecipeType.NUCLEAR_REACTOR, - new ItemStack[] {SlimefunItems.URANIUM, null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.URANIUM.item(), null, null, null, null, null, null, null, null}) + .register(plugin); new RadioactiveItem(itemGroups.resources, Radioactivity.VERY_HIGH, SlimefunItems.PLUTONIUM, RecipeType.NUCLEAR_REACTOR, - new ItemStack[] {SlimefunItems.NEPTUNIUM, null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.NEPTUNIUM.item(), null, null, null, null, null, null, null, null}) + .register(plugin); new RadioactiveItem(itemGroups.resources, Radioactivity.VERY_HIGH, SlimefunItems.BOOSTED_URANIUM, RecipeType.HEATED_PRESSURE_CHAMBER, - new ItemStack[] {SlimefunItems.PLUTONIUM, SlimefunItems.URANIUM, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.PLUTONIUM.item(), SlimefunItems.URANIUM.item(), null, null, null, null, null, null, null}) + .register(plugin); new NuclearReactor(itemGroups.electricity, SlimefunItems.NUCLEAR_REACTOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.CARBONADO_EDGED_CAPACITOR, SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.REINFORCED_PLATE, SlimefunItems.COOLING_UNIT, SlimefunItems.REINFORCED_PLATE, SlimefunItems.LEAD_INGOT, SlimefunItems.REINFORCED_PLATE, SlimefunItems.LEAD_INGOT}){ + new ItemStack[] {SlimefunItems.BLISTERING_INGOT_3.item(), SlimefunItems.CARBONADO_EDGED_CAPACITOR.item(), SlimefunItems.BLISTERING_INGOT_3.item(), SlimefunItems.REINFORCED_PLATE.item(), SlimefunItems.COOLING_UNIT.item(), SlimefunItems.REINFORCED_PLATE.item(), SlimefunItems.LEAD_INGOT.item(), SlimefunItems.REINFORCED_PLATE.item(), SlimefunItems.LEAD_INGOT.item()}){ @Override public int getEnergyProduction() { @@ -2534,7 +2536,7 @@ public int getCapacity() { }.register(plugin); new NetherStarReactor(itemGroups.electricity, SlimefunItems.NETHER_STAR_REACTOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.BOOSTED_URANIUM, SlimefunItems.CARBONADO_EDGED_CAPACITOR, SlimefunItems.BOOSTED_URANIUM, SlimefunItems.REINFORCED_PLATE, new ItemStack(Material.NETHER_STAR), SlimefunItems.REINFORCED_PLATE, SlimefunItems.CORINTHIAN_BRONZE_INGOT, SlimefunItems.REINFORCED_PLATE, SlimefunItems.CORINTHIAN_BRONZE_INGOT}){ + new ItemStack[] {SlimefunItems.BOOSTED_URANIUM.item(), SlimefunItems.CARBONADO_EDGED_CAPACITOR.item(), SlimefunItems.BOOSTED_URANIUM.item(), SlimefunItems.REINFORCED_PLATE.item(), new ItemStack(Material.NETHER_STAR), SlimefunItems.REINFORCED_PLATE.item(), SlimefunItems.CORINTHIAN_BRONZE_INGOT.item(), SlimefunItems.REINFORCED_PLATE.item(), SlimefunItems.CORINTHIAN_BRONZE_INGOT.item()}){ @Override public int getEnergyProduction() { @@ -2549,169 +2551,174 @@ public int getCapacity() { }.register(plugin); new UnplaceableBlock(itemGroups.cargo, SlimefunItems.CARGO_MOTOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.HARDENED_GLASS, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.HARDENED_GLASS, SlimefunItems.SILVER_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.SILVER_INGOT, SlimefunItems.HARDENED_GLASS, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.HARDENED_GLASS}, - new SlimefunItemStack(SlimefunItems.CARGO_MOTOR, 4)) - .register(plugin); + new ItemStack[] {SlimefunItems.HARDENED_GLASS.item(), SlimefunItems.ELECTRO_MAGNET.item(), SlimefunItems.HARDENED_GLASS.item(), SlimefunItems.SILVER_INGOT.item(), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.SILVER_INGOT.item(), SlimefunItems.HARDENED_GLASS.item(), SlimefunItems.ELECTRO_MAGNET.item(), SlimefunItems.HARDENED_GLASS.item()}, + new SlimefunItemStack(SlimefunItems.CARGO_MOTOR, 4).item()) + .register(plugin); new CargoManager(itemGroups.cargo, SlimefunItems.CARGO_MANAGER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.HOLOGRAM_PROJECTOR, null, SlimefunItems.REINFORCED_PLATE, SlimefunItems.CARGO_MOTOR, SlimefunItems.REINFORCED_PLATE, SlimefunItems.ALUMINUM_BRONZE_INGOT, SlimefunItems.ANDROID_MEMORY_CORE, SlimefunItems.ALUMINUM_BRONZE_INGOT}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.HOLOGRAM_PROJECTOR.item(), null, SlimefunItems.REINFORCED_PLATE.item(), SlimefunItems.CARGO_MOTOR.item(), SlimefunItems.REINFORCED_PLATE.item(), SlimefunItems.ALUMINUM_BRONZE_INGOT.item(), SlimefunItems.ANDROID_MEMORY_CORE.item(), SlimefunItems.ALUMINUM_BRONZE_INGOT.item()}) + .register(plugin); new CargoConnectorNode(itemGroups.cargo, SlimefunItems.CARGO_CONNECTOR_NODE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.BRONZE_INGOT, SlimefunItems.SILVER_INGOT, SlimefunItems.BRONZE_INGOT, SlimefunItems.SILVER_INGOT, SlimefunItems.CARGO_MOTOR, SlimefunItems.SILVER_INGOT, SlimefunItems.BRONZE_INGOT, SlimefunItems.SILVER_INGOT, SlimefunItems.BRONZE_INGOT}, - new SlimefunItemStack(SlimefunItems.CARGO_CONNECTOR_NODE, 4)) - .register(plugin); + new ItemStack[] {SlimefunItems.BRONZE_INGOT.item(), SlimefunItems.SILVER_INGOT.item(), SlimefunItems.BRONZE_INGOT.item(), SlimefunItems.SILVER_INGOT.item(), SlimefunItems.CARGO_MOTOR.item(), SlimefunItems.SILVER_INGOT.item(), SlimefunItems.BRONZE_INGOT.item(), SlimefunItems.SILVER_INGOT.item(), SlimefunItems.BRONZE_INGOT.item()}, + new SlimefunItemStack(SlimefunItems.CARGO_CONNECTOR_NODE, 4).item()) + .register(plugin); new CargoInputNode(itemGroups.cargo, SlimefunItems.CARGO_INPUT_NODE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.HOPPER), null, SlimefunItems.BILLON_INGOT, SlimefunItems.CARGO_CONNECTOR_NODE, SlimefunItems.BILLON_INGOT, null, new ItemStack(Material.HOPPER), null}, - new SlimefunItemStack(SlimefunItems.CARGO_INPUT_NODE, 2)) - .register(plugin); + new ItemStack[] {null, new ItemStack(Material.HOPPER), null, SlimefunItems.BILLON_INGOT.item(), SlimefunItems.CARGO_CONNECTOR_NODE.item(), SlimefunItems.BILLON_INGOT.item(), null, new ItemStack(Material.HOPPER), null}, + new SlimefunItemStack(SlimefunItems.CARGO_INPUT_NODE, 2).item()) + .register(plugin); new CargoOutputNode(itemGroups.cargo, SlimefunItems.CARGO_OUTPUT_NODE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.HOPPER), null, SlimefunItems.BRASS_INGOT, SlimefunItems.CARGO_CONNECTOR_NODE, SlimefunItems.BRASS_INGOT, null, new ItemStack(Material.HOPPER), null}, - new SlimefunItemStack(SlimefunItems.CARGO_OUTPUT_NODE, 2)) - .register(plugin); + new ItemStack[] {null, new ItemStack(Material.HOPPER), null, SlimefunItems.BRASS_INGOT.item(), SlimefunItems.CARGO_CONNECTOR_NODE.item(), SlimefunItems.BRASS_INGOT.item(), null, new ItemStack(Material.HOPPER), null}, + new SlimefunItemStack(SlimefunItems.CARGO_OUTPUT_NODE, 2).item()) + .register(plugin); new AdvancedCargoOutputNode(itemGroups.cargo, SlimefunItems.CARGO_OUTPUT_NODE_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.CARGO_MOTOR, null, SlimefunItems.COBALT_INGOT, SlimefunItems.CARGO_OUTPUT_NODE, SlimefunItems.COBALT_INGOT, null, SlimefunItems.CARGO_MOTOR, null}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.CARGO_MOTOR.item(), null, SlimefunItems.COBALT_INGOT.item(), SlimefunItems.CARGO_OUTPUT_NODE.item(), SlimefunItems.COBALT_INGOT.item(), null, SlimefunItems.CARGO_MOTOR.item(), null}) + .register(plugin); new ReactorAccessPort(itemGroups.cargo, SlimefunItems.REACTOR_ACCESS_PORT, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.BLISTERING_INGOT_3, null, SlimefunItems.LEAD_INGOT, SlimefunItems.CARGO_MOTOR, SlimefunItems.LEAD_INGOT, null, SlimefunItems.ELECTRIC_MOTOR, null}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.BLISTERING_INGOT_3.item(), null, SlimefunItems.LEAD_INGOT.item(), SlimefunItems.CARGO_MOTOR.item(), SlimefunItems.LEAD_INGOT.item(), null, SlimefunItems.ELECTRIC_MOTOR.item(), null}) + .register(plugin); new FluidPump(itemGroups.electricity, SlimefunItems.FLUID_PUMP, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.MEDIUM_CAPACITOR, null, new ItemStack(Material.BUCKET), SlimefunItems.CARGO_MOTOR, new ItemStack(Material.BUCKET), null, SlimefunItems.OIL_PUMP, null}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.MEDIUM_CAPACITOR.item(), null, new ItemStack(Material.BUCKET), SlimefunItems.CARGO_MOTOR.item(), new ItemStack(Material.BUCKET), null, SlimefunItems.OIL_PUMP.item(), null}) + .register(plugin); new TrashCan(itemGroups.cargo, SlimefunItems.TRASH_CAN, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.PORTABLE_DUSTBIN, null, SlimefunItems.LEAD_INGOT, SlimefunItems.CARGO_MOTOR, SlimefunItems.LEAD_INGOT, SlimefunItems.ALUMINUM_INGOT, SlimefunItems.LEAD_INGOT, SlimefunItems.ALUMINUM_INGOT}) - .register(plugin); + new ItemStack[] {null, SlimefunItems.PORTABLE_DUSTBIN.item(), null, SlimefunItems.LEAD_INGOT.item(), SlimefunItems.CARGO_MOTOR.item(), SlimefunItems.LEAD_INGOT.item(), SlimefunItems.ALUMINUM_INGOT.item(), SlimefunItems.LEAD_INGOT.item(), SlimefunItems.ALUMINUM_INGOT.item()}) + .register(plugin); new CarbonPress(itemGroups.electricity, SlimefunItems.CARBON_PRESS, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.CARBON, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.CARBON, SlimefunItems.CARBON, SlimefunItems.HEATED_PRESSURE_CHAMBER, SlimefunItems.CARBON, SlimefunItems.HEATING_COIL, SlimefunItems.CARBONADO, SlimefunItems.HEATING_COIL}) - .setCapacity(256) - .setEnergyConsumption(10) - .setProcessingSpeed(1) - .register(plugin); + new ItemStack[] {SlimefunItems.CARBON.item(), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.CARBON.item(), SlimefunItems.CARBON.item(), SlimefunItems.HEATED_PRESSURE_CHAMBER.item(), SlimefunItems.CARBON.item(), SlimefunItems.HEATING_COIL.item(), SlimefunItems.CARBONADO.item(), SlimefunItems.HEATING_COIL.item()}) + .setCapacity(256) + .setEnergyConsumption(10) + .setProcessingSpeed(1) + .register(plugin); new CarbonPress(itemGroups.electricity, SlimefunItems.CARBON_PRESS_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.CARBONADO, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.CARBONADO, SlimefunItems.CARBON, SlimefunItems.CARBON_PRESS, SlimefunItems.CARBON, SlimefunItems.HEATING_COIL, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.HEATING_COIL}) - .setCapacity(512) - .setEnergyConsumption(25) - .setProcessingSpeed(3) - .register(plugin); + new ItemStack[] {SlimefunItems.CARBONADO.item(), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.CARBONADO.item(), SlimefunItems.CARBON.item(), SlimefunItems.CARBON_PRESS.item(), SlimefunItems.CARBON.item(), SlimefunItems.HEATING_COIL.item(), SlimefunItems.ELECTRO_MAGNET.item(), SlimefunItems.HEATING_COIL.item()}) + .setCapacity(512) + .setEnergyConsumption(25) + .setProcessingSpeed(3) + .register(plugin); new CarbonPress(itemGroups.electricity, SlimefunItems.CARBON_PRESS_3, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.CARBONADO, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.CARBONADO, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.CARBON_PRESS_2, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.HEATING_COIL, SlimefunItems.ELECTRO_MAGNET, SlimefunItems.HEATING_COIL}) - .setCapacity(512) - .setEnergyConsumption(90) - .setProcessingSpeed(15) - .register(plugin); + new ItemStack[] {SlimefunItems.CARBONADO.item(), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.CARBONADO.item(), SlimefunItems.REINFORCED_ALLOY_INGOT.item(), SlimefunItems.CARBON_PRESS_2.item(), SlimefunItems.REINFORCED_ALLOY_INGOT.item(), SlimefunItems.HEATING_COIL.item(), SlimefunItems.ELECTRO_MAGNET.item(), SlimefunItems.HEATING_COIL.item()}) + .setCapacity(512) + .setEnergyConsumption(90) + .setProcessingSpeed(15) + .register(plugin); new ElectricSmeltery(itemGroups.electricity, SlimefunItems.ELECTRIC_SMELTERY, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.NETHER_BRICKS), SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.NETHER_BRICKS), SlimefunItems.HEATING_COIL, SlimefunItems.ELECTRIC_INGOT_FACTORY, SlimefunItems.HEATING_COIL, SlimefunItems.GILDED_IRON, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.GILDED_IRON}) - .setCapacity(512) - .setEnergyConsumption(10) - .setProcessingSpeed(1) - .register(plugin); + new ItemStack[] {new ItemStack(Material.NETHER_BRICKS), SlimefunItems.ELECTRIC_MOTOR.item(), new ItemStack(Material.NETHER_BRICKS), SlimefunItems.HEATING_COIL.item(), SlimefunItems.ELECTRIC_INGOT_FACTORY.item(), SlimefunItems.HEATING_COIL.item(), SlimefunItems.GILDED_IRON.item(), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.GILDED_IRON.item()}) + .setCapacity(512) + .setEnergyConsumption(10) + .setProcessingSpeed(1) + .register(plugin); new ElectricSmeltery(itemGroups.electricity, SlimefunItems.ELECTRIC_SMELTERY_2, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.POWER_CRYSTAL, SlimefunItems.DAMASCUS_STEEL_INGOT, SlimefunItems.HEATING_COIL, SlimefunItems.ELECTRIC_SMELTERY, SlimefunItems.HEATING_COIL, SlimefunItems.GILDED_IRON, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.GILDED_IRON}) - .setCapacity(1024) - .setEnergyConsumption(20) - .setProcessingSpeed(3) - .register(plugin); + new ItemStack[] {SlimefunItems.DAMASCUS_STEEL_INGOT.item(), SlimefunItems.POWER_CRYSTAL.item(), SlimefunItems.DAMASCUS_STEEL_INGOT.item(), SlimefunItems.HEATING_COIL.item(), SlimefunItems.ELECTRIC_SMELTERY.item(), SlimefunItems.HEATING_COIL.item(), SlimefunItems.GILDED_IRON.item(), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.GILDED_IRON.item()}) + .setCapacity(1024) + .setEnergyConsumption(20) + .setProcessingSpeed(3) + .register(plugin); new IronGolemAssembler(itemGroups.electricity, SlimefunItems.IRON_GOLEM_ASSEMBLER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.ADVANCED_CIRCUIT_BOARD, SlimefunItems.BLISTERING_INGOT_3, new ItemStack(Material.IRON_BLOCK), SlimefunItems.ANDROID_MEMORY_CORE, new ItemStack(Material.IRON_BLOCK), SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.CARBONADO_EDGED_CAPACITOR}) - .register(plugin); + new ItemStack[] {SlimefunItems.BLISTERING_INGOT_3.item(), SlimefunItems.ADVANCED_CIRCUIT_BOARD.item(), SlimefunItems.BLISTERING_INGOT_3.item(), new ItemStack(Material.IRON_BLOCK), SlimefunItems.ANDROID_MEMORY_CORE.item(), new ItemStack(Material.IRON_BLOCK), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.REINFORCED_ALLOY_INGOT.item(), SlimefunItems.CARBONADO_EDGED_CAPACITOR.item()}) + .register(plugin); new WitherAssembler(itemGroups.electricity, SlimefunItems.WITHER_ASSEMBLER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.BLISTERING_INGOT_3, new ItemStack(Material.NETHER_STAR), SlimefunItems.BLISTERING_INGOT_3, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.ANDROID_MEMORY_CORE, SlimefunItems.WITHER_PROOF_OBSIDIAN, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.REINFORCED_ALLOY_INGOT, SlimefunItems.CARBONADO_EDGED_CAPACITOR}) - .register(plugin); + new ItemStack[] {SlimefunItems.BLISTERING_INGOT_3.item(), new ItemStack(Material.NETHER_STAR), SlimefunItems.BLISTERING_INGOT_3.item(), SlimefunItems.WITHER_PROOF_OBSIDIAN.item(), SlimefunItems.ANDROID_MEMORY_CORE.item(), SlimefunItems.WITHER_PROOF_OBSIDIAN.item(), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.REINFORCED_ALLOY_INGOT.item(), SlimefunItems.CARBONADO_EDGED_CAPACITOR.item()}) + .register(plugin); new TapeMeasure(itemGroups.usefulItems, SlimefunItems.TAPE_MEASURE, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {SlimefunItems.SILICON, new ItemStack(Material.YELLOW_DYE), SlimefunItems.SILICON, new ItemStack(Material.YELLOW_DYE), new ItemStack(Material.STRING), new ItemStack(Material.YELLOW_DYE), SlimefunItems.GILDED_IRON, new ItemStack(Material.YELLOW_DYE), SlimefunItems.SILICON}) - .register(plugin); + new ItemStack[] {SlimefunItems.SILICON.item(), new ItemStack(Material.YELLOW_DYE), SlimefunItems.SILICON.item(), new ItemStack(Material.YELLOW_DYE), new ItemStack(Material.STRING), new ItemStack(Material.YELLOW_DYE), SlimefunItems.GILDED_IRON.item(), new ItemStack(Material.YELLOW_DYE), SlimefunItems.SILICON.item()}) + .register(plugin); MinecraftVersion minecraftVersion = Slimefun.getMinecraftVersion(); new SlimefunItem(itemGroups.magicalArmor, SlimefunItems.BEE_HELMET, RecipeType.ARMOR_FORGE, - new ItemStack[] {SlimefunItems.GOLD_8K, new ItemStack(Material.HONEY_BLOCK), SlimefunItems.GOLD_8K, new ItemStack(Material.HONEYCOMB_BLOCK), null, new ItemStack(Material.HONEYCOMB_BLOCK), null, null, null}) - .register(plugin); + new ItemStack[] {SlimefunItems.GOLD_8K.item(), new ItemStack(Material.HONEY_BLOCK), SlimefunItems.GOLD_8K.item(), new ItemStack(Material.HONEYCOMB_BLOCK), null, new ItemStack(Material.HONEYCOMB_BLOCK), null, null, null}) + .register(plugin); new BeeWings(itemGroups.magicalArmor, SlimefunItems.BEE_WINGS, RecipeType.ARMOR_FORGE, - new ItemStack[] {SlimefunItems.GOLD_8K, null, SlimefunItems.GOLD_8K, new ItemStack(Material.HONEYCOMB_BLOCK), new ItemStack(Material.ELYTRA), new ItemStack(Material.HONEYCOMB_BLOCK), new ItemStack(Material.HONEY_BLOCK), SlimefunItems.GOLD_8K, new ItemStack(Material.HONEY_BLOCK)}) - .register(plugin); + new ItemStack[] {SlimefunItems.GOLD_8K.item(), null, SlimefunItems.GOLD_8K.item(), new ItemStack(Material.HONEYCOMB_BLOCK), new ItemStack(Material.ELYTRA), new ItemStack(Material.HONEYCOMB_BLOCK), new ItemStack(Material.HONEY_BLOCK), SlimefunItems.GOLD_8K.item(), new ItemStack(Material.HONEY_BLOCK)}) + .register(plugin); new SlimefunItem(itemGroups.magicalArmor, SlimefunItems.BEE_LEGGINGS, RecipeType.ARMOR_FORGE, - new ItemStack[] {SlimefunItems.GOLD_8K, new ItemStack(Material.HONEY_BLOCK), SlimefunItems.GOLD_8K, new ItemStack(Material.HONEYCOMB_BLOCK), null, new ItemStack(Material.HONEYCOMB_BLOCK), new ItemStack(Material.HONEYCOMB_BLOCK), null, new ItemStack(Material.HONEYCOMB_BLOCK)}) - .register(plugin); + new ItemStack[] {SlimefunItems.GOLD_8K.item(), new ItemStack(Material.HONEY_BLOCK), SlimefunItems.GOLD_8K.item(), new ItemStack(Material.HONEYCOMB_BLOCK), null, new ItemStack(Material.HONEYCOMB_BLOCK), new ItemStack(Material.HONEYCOMB_BLOCK), null, new ItemStack(Material.HONEYCOMB_BLOCK)}) + .register(plugin); new LongFallBoots(itemGroups.magicalArmor, SlimefunItems.BEE_BOOTS, RecipeType.ARMOR_FORGE, - new ItemStack[] {null, null, null, SlimefunItems.GOLD_8K, null, SlimefunItems.GOLD_8K, new ItemStack(Material.HONEY_BLOCK), null, new ItemStack(Material.HONEY_BLOCK)}, - new PotionEffect[] {new PotionEffect(VersionedPotionEffectType.JUMP_BOOST, 300, 2)}, - SoundEffect.BEE_BOOTS_FALL_SOUND) - .register(plugin); + new ItemStack[] {null, null, null, SlimefunItems.GOLD_8K.item(), null, SlimefunItems.GOLD_8K.item(), new ItemStack(Material.HONEY_BLOCK), null, new ItemStack(Material.HONEY_BLOCK)}, + new PotionEffect[] {new PotionEffect(VersionedPotionEffectType.JUMP_BOOST, 300, 2)}, + SoundEffect.BEE_BOOTS_FALL_SOUND) + .register(plugin); new VillagerRune(itemGroups.magicalResources, SlimefunItems.VILLAGER_RUNE, RecipeType.ANCIENT_ALTAR, - new ItemStack[] {SlimefunItems.MAGIC_LUMP_3, SlimefunItems.MAGICAL_GLASS, new ItemStack(Material.CRYING_OBSIDIAN), SlimefunItems.STRANGE_NETHER_GOO, SlimefunItems.FIRE_RUNE, SlimefunItems.STRANGE_NETHER_GOO, new ItemStack(Material.CRYING_OBSIDIAN), SlimefunItems.MAGICAL_GLASS, SlimefunItems.MAGIC_LUMP_3}, - new SlimefunItemStack(SlimefunItems.VILLAGER_RUNE, 3)) - .register(plugin); + new ItemStack[] {SlimefunItems.MAGIC_LUMP_3.item(), SlimefunItems.MAGICAL_GLASS.item(), new ItemStack(Material.CRYING_OBSIDIAN), SlimefunItems.STRANGE_NETHER_GOO.item(), SlimefunItems.FIRE_RUNE.item(), SlimefunItems.STRANGE_NETHER_GOO.item(), new ItemStack(Material.CRYING_OBSIDIAN), SlimefunItems.MAGICAL_GLASS.item(), SlimefunItems.MAGIC_LUMP_3.item()}, + new SlimefunItemStack(SlimefunItems.VILLAGER_RUNE, 3).item()) + .register(plugin); new StrangeNetherGoo(itemGroups.magicalResources, SlimefunItems.STRANGE_NETHER_GOO, RecipeType.BARTER_DROP, - new ItemStack[] {null, null, null, null, new CustomItemStack(HeadTexture.PIGLIN_HEAD.getAsItemStack(), "&fPiglin"), null, null, null, null}) - .register(plugin); + new ItemStack[] {null, null, null, null, CustomItemStack.create(HeadTexture.PIGLIN_HEAD.getAsItemStack(), "&fPiglin"), null, null, null, null}) + .register(plugin); if (minecraftVersion.isAtLeast(MinecraftVersion.MINECRAFT_1_17)) { new Juice(itemGroups.food, SlimefunItems.GLOW_BERRY_JUICE, RecipeType.JUICER, - new ItemStack[] {new ItemStack(Material.GLOW_BERRIES), null, null, null, null, null, null, null, null}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.GLOW_BERRIES), null, null, null, null, null, null, null, null}) + .register(plugin); } new ElytraCap(itemGroups.magicalArmor, SlimefunItems.ELYTRA_CAP, RecipeType.ARMOR_FORGE, - new ItemStack[] {new ItemStack(Material.SLIME_BALL), new ItemStack(Material.SLIME_BALL), new ItemStack(Material.SLIME_BALL), SlimefunItems.ELYTRA_SCALE, SlimefunItems.ELYTRA_SCALE, SlimefunItems.ELYTRA_SCALE, new ItemStack(Material.SLIME_BALL), new ItemStack(Material.LEATHER_HELMET), new ItemStack(Material.SLIME_BALL)}) - .register(plugin); + new ItemStack[] {new ItemStack(Material.SLIME_BALL), new ItemStack(Material.SLIME_BALL), new ItemStack(Material.SLIME_BALL), SlimefunItems.ELYTRA_SCALE.item(), SlimefunItems.ELYTRA_SCALE.item(), SlimefunItems.ELYTRA_SCALE.item(), new ItemStack(Material.SLIME_BALL), new ItemStack(Material.LEATHER_HELMET), new ItemStack(Material.SLIME_BALL)}) + .register(plugin); new SlimefunItem(itemGroups.magicalResources, SlimefunItems.RAINBOW_LEATHER, RecipeType.ANCIENT_ALTAR, - new ItemStack[] { new ItemStack(Material.EMERALD), new ItemStack(Material.LEATHER), SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.RABBIT_HIDE), SlimefunItems.RAINBOW_RUNE, new ItemStack(Material.RABBIT_HIDE), SlimefunItems.MAGIC_LUMP_2, new ItemStack(Material.LEATHER), new ItemStack(Material.EMERALD) }, - new SlimefunItemStack(SlimefunItems.RAINBOW_LEATHER, 4)) + new ItemStack[] { new ItemStack(Material.EMERALD), new ItemStack(Material.LEATHER), SlimefunItems.MAGIC_LUMP_2.item(), new ItemStack(Material.RABBIT_HIDE), SlimefunItems.RAINBOW_RUNE.item(), new ItemStack(Material.RABBIT_HIDE), SlimefunItems.MAGIC_LUMP_2.item(), new ItemStack(Material.LEATHER), new ItemStack(Material.EMERALD) }, + new SlimefunItemStack(SlimefunItems.RAINBOW_LEATHER, 4).item()) .register(plugin); new UnplaceableBlock(itemGroups.cargo, SlimefunItems.CRAFTING_MOTOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {new ItemStack(Material.CRAFTING_TABLE), SlimefunItems.BLISTERING_INGOT_3, new ItemStack(Material.CRAFTING_TABLE), SlimefunItems.REDSTONE_ALLOY, SlimefunItems.CARGO_MOTOR, SlimefunItems.REDSTONE_ALLOY, new ItemStack(Material.CRAFTING_TABLE), SlimefunItems.BLISTERING_INGOT_3, new ItemStack(Material.CRAFTING_TABLE)}, - new SlimefunItemStack(SlimefunItems.CRAFTING_MOTOR, 2)) - .register(plugin); + new ItemStack[] {new ItemStack(Material.CRAFTING_TABLE), SlimefunItems.BLISTERING_INGOT_3.item(), new ItemStack(Material.CRAFTING_TABLE), SlimefunItems.REDSTONE_ALLOY.item(), SlimefunItems.CARGO_MOTOR.item(), SlimefunItems.REDSTONE_ALLOY.item(), new ItemStack(Material.CRAFTING_TABLE), SlimefunItems.BLISTERING_INGOT_3.item(), new ItemStack(Material.CRAFTING_TABLE)}, + new SlimefunItemStack(SlimefunItems.CRAFTING_MOTOR, 2).item()) + .register(plugin); new VanillaAutoCrafter(itemGroups.cargo, SlimefunItems.VANILLA_AUTO_CRAFTER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.CARGO_MOTOR, null, new ItemStack(Material.CRAFTING_TABLE), SlimefunItems.CRAFTING_MOTOR, new ItemStack(Material.CRAFTING_TABLE), null, SlimefunItems.ELECTRIC_MOTOR, null}) - .setCapacity(256) - .setEnergyConsumption(16) - .register(plugin); + new ItemStack[] {null, SlimefunItems.CARGO_MOTOR.item(), null, new ItemStack(Material.CRAFTING_TABLE), SlimefunItems.CRAFTING_MOTOR.item(), new ItemStack(Material.CRAFTING_TABLE), null, SlimefunItems.ELECTRIC_MOTOR.item(), null}) + .setCapacity(256) + .setEnergyConsumption(16) + .register(plugin); new EnhancedAutoCrafter(itemGroups.cargo, SlimefunItems.ENHANCED_AUTO_CRAFTER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.CRAFTING_MOTOR, null, new ItemStack(Material.CRAFTING_TABLE), new ItemStack(Material.DISPENSER), new ItemStack(Material.CRAFTING_TABLE), null, SlimefunItems.CARGO_MOTOR, null}) - .setCapacity(256) - .setEnergyConsumption(16) - .register(plugin); + new ItemStack[] {null, SlimefunItems.CRAFTING_MOTOR.item(), null, new ItemStack(Material.CRAFTING_TABLE), new ItemStack(Material.DISPENSER), new ItemStack(Material.CRAFTING_TABLE), null, SlimefunItems.CARGO_MOTOR.item(), null}) + .setCapacity(256) + .setEnergyConsumption(16) + .register(plugin); new ArmorAutoCrafter(itemGroups.cargo, SlimefunItems.ARMOR_AUTO_CRAFTER, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, SlimefunItems.CRAFTING_MOTOR, null, new ItemStack(Material.DISPENSER), new ItemStack(Material.ANVIL), new ItemStack(Material.DISPENSER), new ItemStack(Material.CRAFTING_TABLE), SlimefunItems.ELECTRIC_MOTOR, new ItemStack(Material.CRAFTING_TABLE)}) - .setCapacity(256) - .setEnergyConsumption(32) - .register(plugin); + new ItemStack[] {null, SlimefunItems.CRAFTING_MOTOR.item(), null, new ItemStack(Material.DISPENSER), new ItemStack(Material.ANVIL), new ItemStack(Material.DISPENSER), new ItemStack(Material.CRAFTING_TABLE), SlimefunItems.ELECTRIC_MOTOR.item(), new ItemStack(Material.CRAFTING_TABLE)}) + .setCapacity(256) + .setEnergyConsumption(32) + .register(plugin); new ProduceCollector(itemGroups.electricity, SlimefunItems.PRODUCE_COLLECTOR, RecipeType.ENHANCED_CRAFTING_TABLE, - new ItemStack[] {null, new ItemStack(Material.HAY_BLOCK), null, new ItemStack(Material.BUCKET), SlimefunItems.MEDIUM_CAPACITOR, new ItemStack(Material.BUCKET), SlimefunItems.ALUMINUM_BRASS_INGOT, SlimefunItems.ELECTRIC_MOTOR, SlimefunItems.ALUMINUM_BRASS_INGOT}) - .setCapacity(256) - .setProcessingSpeed(1) - .setEnergyConsumption(16) - .register(plugin); + new ItemStack[] {null, new ItemStack(Material.HAY_BLOCK), null, new ItemStack(Material.BUCKET), SlimefunItems.MEDIUM_CAPACITOR.item(), new ItemStack(Material.BUCKET), SlimefunItems.ALUMINUM_BRASS_INGOT.item(), SlimefunItems.ELECTRIC_MOTOR.item(), SlimefunItems.ALUMINUM_BRASS_INGOT.item()}) + .setCapacity(256) + .setProcessingSpeed(1) + .setEnergyConsumption(16) + .register(plugin); // @formatter:on } + @ParametersAreNonnullByDefault + private static void registerArmorSet(ItemGroup itemGroup, SlimefunItemStack baseComponent, ItemStack[] items, String idSyntax, boolean vanilla, PotionEffect[][] effects, SlimefunAddon addon) { + registerArmorSet(itemGroup, baseComponent.item(), items, idSyntax, vanilla, effects, addon); + } + @ParametersAreNonnullByDefault private static void registerArmorSet(ItemGroup itemGroup, ItemStack baseComponent, ItemStack[] items, String idSyntax, boolean vanilla, PotionEffect[][] effects, SlimefunAddon addon) { String[] components = new String[] { "_HELMET", "_CHESTPLATE", "_LEGGINGS", "_BOOTS" }; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/ArmorTask.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/ArmorTask.java index 051f931460..d0ab1ec05b 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/ArmorTask.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/ArmorTask.java @@ -163,8 +163,9 @@ private boolean checkAndApplyRadiation(@Nonnull Player p, @Nullable ItemStack it Set radioactiveItems = Slimefun.getRegistry().getRadioactiveItems(); ItemStack itemStack = item; + SlimefunItem slimefunItem = SlimefunItem.getByItem(item); - if (!(item instanceof SlimefunItemStack) && radioactiveItems.size() > 1) { + if (slimefunItem != null && radioactiveItems.size() > 1) { // Performance optimization to reduce ItemMeta calls itemStack = ItemStackWrapper.wrap(item); } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/TickerTask.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/TickerTask.java index cbf6e42eb1..91525994fb 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/TickerTask.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/TickerTask.java @@ -44,6 +44,7 @@ public class TickerTask implements Runnable { /** * This Map holds all currently actively ticking locations. + * The value of this map (Set entries) MUST be thread-safe and mutable. */ private final Map> tickingLocations = new ConcurrentHashMap<>(); @@ -329,7 +330,7 @@ public Map> getLocations() { public Set getLocations(@Nonnull Chunk chunk) { Validate.notNull(chunk, "The Chunk cannot be null!"); - Set locations = tickingLocations.getOrDefault(new ChunkPosition(chunk), new HashSet<>()); + Set locations = tickingLocations.getOrDefault(new ChunkPosition(chunk), Collections.emptySet()); return Collections.unmodifiableSet(locations); } @@ -343,7 +344,14 @@ public void enableTicker(@Nonnull Location l) { Validate.notNull(l, "Location cannot be null!"); ChunkPosition chunk = new ChunkPosition(l.getWorld(), l.getBlockX() >> 4, l.getBlockZ() >> 4); - Set newValue = new HashSet<>(); + + /* + Note that all the values in #tickingLocations must be thread-safe. + Thus, the choice is between the CHM KeySet or a synchronized set. + The CHM KeySet was chosen since it at least permits multiple concurrent + reads without blocking. + */ + Set newValue = ConcurrentHashMap.newKeySet(); Set oldValue = tickingLocations.putIfAbsent(chunk, newValue); /** diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/ChestMenuUtils.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/ChestMenuUtils.java index 928233eb5d..dc31cf2b76 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/ChestMenuUtils.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/ChestMenuUtils.java @@ -28,22 +28,22 @@ public final class ChestMenuUtils { private ChestMenuUtils() {} - private static final ItemStack UI_BACKGROUND = new SlimefunItemStack("_UI_BACKGROUND", Material.GRAY_STAINED_GLASS_PANE, " "); - private static final ItemStack INPUT_SLOT = new SlimefunItemStack("_UI_INPUT_SLOT", Material.CYAN_STAINED_GLASS_PANE, " "); - private static final ItemStack OUTPUT_SLOT = new SlimefunItemStack("_UI_OUTPUT_SLOT", Material.ORANGE_STAINED_GLASS_PANE, " "); + private static final ItemStack UI_BACKGROUND = new SlimefunItemStack("_UI_BACKGROUND", Material.GRAY_STAINED_GLASS_PANE, " ").item(); + private static final ItemStack INPUT_SLOT = new SlimefunItemStack("_UI_INPUT_SLOT", Material.CYAN_STAINED_GLASS_PANE, " ").item(); + private static final ItemStack OUTPUT_SLOT = new SlimefunItemStack("_UI_OUTPUT_SLOT", Material.ORANGE_STAINED_GLASS_PANE, " ").item(); - private static final ItemStack NO_PERMISSION = new SlimefunItemStack("_UI_NO_PERMISSION", Material.BARRIER, "No Permission"); - private static final ItemStack NOT_RESEARCHED = new SlimefunItemStack("_UI_NOT_RESEARCHED", Material.BARRIER, "Not researched"); + private static final ItemStack NO_PERMISSION = new SlimefunItemStack("_UI_NO_PERMISSION", Material.BARRIER, "No Permission").item(); + private static final ItemStack NOT_RESEARCHED = new SlimefunItemStack("_UI_NOT_RESEARCHED", Material.BARRIER, "Not researched").item(); - private static final ItemStack BACK_BUTTON = new SlimefunItemStack("_UI_BACK", Material.ENCHANTED_BOOK, "&7\u21E6 Back", meta -> meta.addItemFlags(ItemFlag.HIDE_ENCHANTS)); - private static final ItemStack MENU_BUTTON = new SlimefunItemStack("_UI_MENU", Material.COMPARATOR, "&eSettings / Info", "", "&7\u21E8 Click to see more"); - private static final ItemStack SEARCH_BUTTON = new SlimefunItemStack("_UI_SEARCH", Material.NAME_TAG, "&bSearch"); - private static final ItemStack WIKI_BUTTON = new SlimefunItemStack("_UI_WIKI", Material.KNOWLEDGE_BOOK, "&3Slimefun Wiki"); + private static final ItemStack BACK_BUTTON = new SlimefunItemStack("_UI_BACK", Material.ENCHANTED_BOOK, "&7\u21E6 Back", meta -> meta.addItemFlags(ItemFlag.HIDE_ENCHANTS)).item(); + private static final ItemStack MENU_BUTTON = new SlimefunItemStack("_UI_MENU", Material.COMPARATOR, "&eSettings / Info", "", "&7\u21E8 Click to see more").item(); + private static final ItemStack SEARCH_BUTTON = new SlimefunItemStack("_UI_SEARCH", Material.NAME_TAG, "&bSearch").item(); + private static final ItemStack WIKI_BUTTON = new SlimefunItemStack("_UI_WIKI", Material.KNOWLEDGE_BOOK, "&3Slimefun Wiki").item(); - private static final ItemStack PREV_BUTTON_ACTIVE = new SlimefunItemStack("_UI_PREVIOUS_ACTIVE", Material.LIME_STAINED_GLASS_PANE, "&r\u21E6 Previous Page"); - private static final ItemStack NEXT_BUTTON_ACTIVE = new SlimefunItemStack("_UI_NEXT_ACTIVE", Material.LIME_STAINED_GLASS_PANE, "&rNext Page \u21E8"); - private static final ItemStack PREV_BUTTON_INACTIVE = new SlimefunItemStack("_UI_PREVIOUS_INACTIVE", Material.BLACK_STAINED_GLASS_PANE, "&8\u21E6 Previous Page"); - private static final ItemStack NEXT_BUTTON_INACTIVE = new SlimefunItemStack("_UI_NEXT_INACTIVE", Material.BLACK_STAINED_GLASS_PANE, "&8Next Page \u21E8"); + private static final ItemStack PREV_BUTTON_ACTIVE = new SlimefunItemStack("_UI_PREVIOUS_ACTIVE", Material.LIME_STAINED_GLASS_PANE, "&r\u21E6 Previous Page").item(); + private static final ItemStack NEXT_BUTTON_ACTIVE = new SlimefunItemStack("_UI_NEXT_ACTIVE", Material.LIME_STAINED_GLASS_PANE, "&rNext Page \u21E8").item(); + private static final ItemStack PREV_BUTTON_INACTIVE = new SlimefunItemStack("_UI_PREVIOUS_INACTIVE", Material.BLACK_STAINED_GLASS_PANE, "&8\u21E6 Previous Page").item(); + private static final ItemStack NEXT_BUTTON_INACTIVE = new SlimefunItemStack("_UI_NEXT_INACTIVE", Material.BLACK_STAINED_GLASS_PANE, "&8Next Page \u21E8").item(); private static final ChestMenu.AdvancedMenuClickHandler OUTPUT_HANDLER = new ChestMenu.AdvancedMenuClickHandler() { @@ -89,15 +89,15 @@ public boolean onClick(InventoryClickEvent e, Player p, int slot, ItemStack curs } public static @Nonnull ItemStack getBackButton(@Nonnull Player p, String... lore) { - return new CustomItemStack(BACK_BUTTON, "&7\u21E6 " + Slimefun.getLocalization().getMessage(p, "guide.back.title"), lore); + return CustomItemStack.create(BACK_BUTTON, "&7\u21E6 " + Slimefun.getLocalization().getMessage(p, "guide.back.title"), lore); } public static @Nonnull ItemStack getMenuButton(@Nonnull Player p) { - return new CustomItemStack(MENU_BUTTON, ChatColor.YELLOW + Slimefun.getLocalization().getMessage(p, "guide.title.settings"), "", "&7\u21E8 " + Slimefun.getLocalization().getMessage(p, "guide.tooltips.open-itemgroup")); + return CustomItemStack.create(MENU_BUTTON, ChatColor.YELLOW + Slimefun.getLocalization().getMessage(p, "guide.title.settings"), "", "&7\u21E8 " + Slimefun.getLocalization().getMessage(p, "guide.tooltips.open-itemgroup")); } public static @Nonnull ItemStack getSearchButton(@Nonnull Player p) { - return new CustomItemStack(SEARCH_BUTTON, meta -> { + return CustomItemStack.create(SEARCH_BUTTON, meta -> { meta.setDisplayName(ChatColors.color(Slimefun.getLocalization().getMessage(p, "guide.search.name"))); List lore = Arrays.asList("", ChatColor.GRAY + "\u21E8 " + Slimefun.getLocalization().getMessage(p, "guide.search.tooltip")); @@ -112,12 +112,12 @@ public boolean onClick(InventoryClickEvent e, Player p, int slot, ItemStack curs public static @Nonnull ItemStack getPreviousButton(@Nonnull Player p, int page, int pages) { if (pages == 1 || page == 1) { - return new CustomItemStack(PREV_BUTTON_INACTIVE, meta -> { + return CustomItemStack.create(PREV_BUTTON_INACTIVE, meta -> { meta.setDisplayName(ChatColor.DARK_GRAY + "\u21E6 " + Slimefun.getLocalization().getMessage(p, "guide.pages.previous")); meta.setLore(Arrays.asList("", ChatColor.GRAY + "(" + page + " / " + pages + ")")); }); } else { - return new CustomItemStack(PREV_BUTTON_ACTIVE, meta -> { + return CustomItemStack.create(PREV_BUTTON_ACTIVE, meta -> { meta.setDisplayName(ChatColor.WHITE + "\u21E6 " + Slimefun.getLocalization().getMessage(p, "guide.pages.previous")); meta.setLore(Arrays.asList("", ChatColor.GRAY + "(" + page + " / " + pages + ")")); }); @@ -126,12 +126,12 @@ public boolean onClick(InventoryClickEvent e, Player p, int slot, ItemStack curs public static @Nonnull ItemStack getNextButton(@Nonnull Player p, int page, int pages) { if (pages == 1 || page == pages) { - return new CustomItemStack(NEXT_BUTTON_INACTIVE, meta -> { + return CustomItemStack.create(NEXT_BUTTON_INACTIVE, meta -> { meta.setDisplayName(ChatColor.DARK_GRAY + Slimefun.getLocalization().getMessage(p, "guide.pages.next") + " \u21E8"); meta.setLore(Arrays.asList("", ChatColor.GRAY + "(" + page + " / " + pages + ")")); }); } else { - return new CustomItemStack(NEXT_BUTTON_ACTIVE, meta -> { + return CustomItemStack.create(NEXT_BUTTON_ACTIVE, meta -> { meta.setDisplayName(ChatColor.WHITE + Slimefun.getLocalization().getMessage(p, "guide.pages.next") + " \u21E8"); meta.setLore(Arrays.asList("", ChatColor.GRAY + "(" + page + " / " + pages + ")")); }); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/SlimefunUtils.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/SlimefunUtils.java index a509b207f3..ed5bdb9b4d 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/SlimefunUtils.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/SlimefunUtils.java @@ -36,7 +36,6 @@ import io.github.thebusybiscuit.slimefun4.api.exceptions.PrematureCodeException; import io.github.thebusybiscuit.slimefun4.api.items.ItemSpawnReason; import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem; -import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack; import io.github.thebusybiscuit.slimefun4.core.attributes.DistinctiveItem; import io.github.thebusybiscuit.slimefun4.core.attributes.Radioactive; import io.github.thebusybiscuit.slimefun4.core.attributes.Soulbound; @@ -252,7 +251,8 @@ public static boolean containsSimilarItem(Inventory inventory, ItemStack item, b } // Performance optimization - if (!(item instanceof SlimefunItemStack)) { + SlimefunItem slimefunItem = SlimefunItem.getByItem(item); + if (slimefunItem != null) { item = ItemStackWrapper.wrap(item); } @@ -340,25 +340,29 @@ public static boolean isItemSimilar(@Nullable ItemStack item, @Nullable ItemStac return false; } else if (checkAmount && item.getAmount() < sfitem.getAmount()) { return false; - } else if (sfitem instanceof SlimefunItemStack stackOne && item instanceof SlimefunItemStack stackTwo) { - if (stackOne.getItemId().equals(stackTwo.getItemId())) { - /* - * PR #3417 - * - * Some items can't rely on just IDs matching and will implement {@link DistinctiveItem} - * in which case we want to use the method provided to compare - */ - if (checkDistinction && stackOne instanceof DistinctiveItem distinctive && stackTwo instanceof DistinctiveItem) { - return distinctive.canStack(stackOne.getItemMeta(), stackTwo.getItemMeta()); - } - return true; + } + SlimefunItem sf_sfitem = SlimefunItem.getByItem(sfitem); + SlimefunItem sf_item = SlimefunItem.getByItem(item); + + if (sf_sfitem != null && sf_item != null) { + if (!sf_sfitem.getId().equals(sf_item.getId())) { + return false; } - return false; + /* + * PR #3417 + * + * Some items can't rely on just IDs matching and will implement {@link DistinctiveItem} + * in which case we want to use the method provided to compare + */ + if (checkDistinction && sf_sfitem instanceof DistinctiveItem distinctive && sf_item instanceof DistinctiveItem) { + return distinctive.canStack(sf_sfitem.getItem().getItemMeta(), sf_item.getItem().getItemMeta()); + } + return true; } else if (item.hasItemMeta()) { Debug.log(TestCase.CARGO_INPUT_TESTING, "SlimefunUtils#isItemSimilar - item.hasItemMeta()"); ItemMeta itemMeta = item.getItemMeta(); - if (sfitem instanceof SlimefunItemStack) { + if (sf_sfitem != null) { String id = Slimefun.getItemDataService().getItemData(itemMeta).orElse(null); if (id != null) { @@ -375,10 +379,10 @@ public static boolean isItemSimilar(@Nullable ItemStack item, @Nullable ItemStac return optionalDistinctive.get().canStack(sfItemMeta, itemMeta); } } - return id.equals(((SlimefunItemStack) sfitem).getItemId()); + return id.equals((sf_sfitem.getId())); } - ItemMetaSnapshot meta = ((SlimefunItemStack) sfitem).getItemMetaSnapshot(); + ItemMeta meta = sf_sfitem.getItem().getItemMeta(); return equalsItemMeta(itemMeta, meta, checkLore); } else if (sfitem instanceof ItemStackWrapper && sfitem.hasItemMeta()) { Debug.log(TestCase.CARGO_INPUT_TESTING, " is wrapper"); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/biomes/BiomeMap.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/biomes/BiomeMap.java index 872972c687..6f652a017e 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/biomes/BiomeMap.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/biomes/BiomeMap.java @@ -4,7 +4,7 @@ import java.io.IOException; import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; -import java.util.EnumMap; +import java.util.HashMap; import java.util.Map; import java.util.stream.Collectors; @@ -34,7 +34,7 @@ * The most common type is {@link Integer}, if you are using complex objects and try to read * your {@link BiomeMap} from a {@link JsonElement}, make sure to provide an adequate * {@link BiomeDataConverter} to convert the raw json data. - * + * * @author TheBusyBiscuit * * @param @@ -43,9 +43,9 @@ public class BiomeMap implements Keyed { /** - * Our internal {@link EnumMap} holding all the data. + * Our internal {@link HashMap} holding all the data. */ - private final Map dataMap = new EnumMap<>(Biome.class); + private final Map dataMap = new HashMap<>(); /** * The {@link NamespacedKey} to identify this {@link BiomeMap}. @@ -54,7 +54,7 @@ public class BiomeMap implements Keyed { /** * This constructs a new {@link BiomeMap} with the given {@link NamespacedKey}. - * + * * @param namespacedKey * The {@link NamespacedKey} for this {@link BiomeMap} */ @@ -92,7 +92,7 @@ public boolean containsValue(@Nonnull T value) { /** * This returns whether this {@link BiomeMap} is empty. * An empty {@link BiomeMap} contains no biomes or values. - * + * * @return Whether this {@link BiomeMap} is empty. */ public boolean isEmpty() { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/biomes/BiomeMapParser.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/biomes/BiomeMapParser.java index 62d345acf8..d1e3483938 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/biomes/BiomeMapParser.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/biomes/BiomeMapParser.java @@ -1,7 +1,8 @@ package io.github.thebusybiscuit.slimefun4.utils.biomes; -import java.util.EnumMap; -import java.util.EnumSet; + +import java.util.HashMap; +import java.util.HashSet; import java.util.Locale; import java.util.Map; import java.util.Set; @@ -25,12 +26,12 @@ /** * The {@link BiomeMapParser} allows you to parse json data into a {@link BiomeMap}. - * + * * @author TheBusyBiscuit * * @param * The data type of the resulting {@link BiomeMap} - * + * * @see BiomeMap */ public class BiomeMapParser { @@ -40,7 +41,7 @@ public class BiomeMapParser { private final NamespacedKey key; private final BiomeDataConverter valueConverter; - private final Map map = new EnumMap<>(Biome.class); + private final Map map = new HashMap<>(); /** * This flag specifies whether the parsing is "lenient" or not. @@ -54,7 +55,7 @@ public class BiomeMapParser { * This constructs a new {@link BiomeMapParser}. *

* To parse data, use the {@link #read(JsonArray)} or {@link #read(String)} method. - * + * * @param key * The {@link NamespacedKey} for the resulting {@link BiomeMap} * @param valueConverter @@ -75,7 +76,7 @@ public BiomeMapParser(NamespacedKey key, BiomeDataConverter valueConverter) { * A lenient parser will not throw a {@link BiomeMapException} if the {@link Biome} * could not be found. * The default value is false. - * + * * @param isLenient * Whether this parser should be lenient or not. */ @@ -89,7 +90,7 @@ public void setLenient(boolean isLenient) { * A lenient parser will not throw a {@link BiomeMapException} if the {@link Biome} * could not be found. * The default value is false. - * + * * @return Whether this parser is lenient or not. */ public boolean isLenient() { @@ -159,7 +160,7 @@ private void readEntry(@Nonnull JsonObject entry) throws BiomeMapException { private @Nonnull Set readBiomes(@Nonnull JsonArray array) throws BiomeMapException { Validate.notNull(array, "The JSON array should not be null!"); - Set biomes = EnumSet.noneOf(Biome.class); + Set biomes = new HashSet<>(); for (JsonElement element : array) { if (element.isJsonPrimitive() && element.getAsJsonPrimitive().isString()) { @@ -196,7 +197,7 @@ private void readEntry(@Nonnull JsonObject entry) throws BiomeMapException { *

* Make sure to parse data via {@link #read(JsonArray)} or {@link #read(String)} * before calling this method! Otherwise the resulting {@link BiomeMap} will be empty. - * + * * @return The resulting {@link BiomeMap} */ @Nonnull diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/itemstack/ColoredFireworkStar.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/itemstack/ColoredFireworkStar.java index 063d91f8d1..36ccef1cb8 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/itemstack/ColoredFireworkStar.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/itemstack/ColoredFireworkStar.java @@ -1,10 +1,7 @@ package io.github.thebusybiscuit.slimefun4.utils.itemstack; -import java.util.ArrayList; -import java.util.List; - -import javax.annotation.ParametersAreNonnullByDefault; - +import io.github.bakedlibs.dough.items.ItemStackEditor; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedItemFlag; import org.bukkit.Color; import org.bukkit.FireworkEffect; import org.bukkit.FireworkEffect.Type; @@ -12,40 +9,26 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.FireworkEffectMeta; -import io.github.bakedlibs.dough.common.ChatColors; -import io.github.bakedlibs.dough.items.CustomItemStack; -import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedItemFlag; +import javax.annotation.ParametersAreNonnullByDefault; /** * This simple {@link ItemStack} implementation allows us to obtain * a colored {@code Material.FIREWORK_STAR} {@link ItemStack} quickly. - * + * * @author TheBusyBiscuit * */ -public class ColoredFireworkStar extends CustomItemStack { +public class ColoredFireworkStar { @ParametersAreNonnullByDefault - public ColoredFireworkStar(Color color, String name, String... lore) { - super(Material.FIREWORK_STAR, im -> { - if (name != null) { - im.setDisplayName(ChatColors.color(name)); - } - - ((FireworkEffectMeta) im).setEffect(FireworkEffect.builder().with(Type.BURST).withColor(color).build()); - - if (lore.length > 0) { - List lines = new ArrayList<>(); - - for (String line : lore) { - lines.add(ChatColors.color(line)); - } - - im.setLore(lines); - } - - im.addItemFlags(VersionedItemFlag.HIDE_ADDITIONAL_TOOLTIP); - }); + public static ItemStack create(Color color, String name, String... lore) { + FireworkEffect effect = FireworkEffect.builder().with(Type.BURST).withColor(color).build(); + return new ItemStackEditor(Material.FIREWORK_STAR) + .setDisplayName(name) + .setLore(lore) + .addFlags(VersionedItemFlag.HIDE_ADDITIONAL_TOOLTIP) + .andMetaConsumer(FireworkEffectMeta.class, meta -> meta.setEffect(effect)) + .create(); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java index 7962c7b027..7eab9b680f 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/SlimefunTag.java @@ -1,7 +1,6 @@ package io.github.thebusybiscuit.slimefun4.utils.tags; import java.util.Collections; -import java.util.EnumSet; import java.util.HashMap; import java.util.HashSet; import java.util.Locale; @@ -298,7 +297,7 @@ public enum SlimefunTag implements Tag { } private final NamespacedKey key; - private final Set includedMaterials = EnumSet.noneOf(Material.class); + private final Set includedMaterials = new HashSet<>(); private final Set> additionalTags = new HashSet<>(); /** @@ -370,8 +369,7 @@ public boolean isTagged(@Nonnull Material item) { if (additionalTags.isEmpty()) { return Collections.unmodifiableSet(includedMaterials); } else { - Set materials = EnumSet.noneOf(Material.class); - materials.addAll(includedMaterials); + Set materials = new HashSet<>(includedMaterials); for (Tag tag : additionalTags) { materials.addAll(tag.getValues()); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/TagParser.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/TagParser.java index 76ef463645..7667e9ceed 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/TagParser.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/tags/TagParser.java @@ -4,7 +4,6 @@ import java.io.IOException; import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; -import java.util.EnumSet; import java.util.HashSet; import java.util.Locale; import java.util.Set; @@ -35,9 +34,9 @@ /** * The {@link TagParser} is responsible for parsing a JSON input into a {@link SlimefunTag}. - * + * * @author TheBusyBiscuit - * + * * @see SlimefunTag * */ @@ -51,7 +50,7 @@ public class TagParser implements Keyed { /** * This constructs a new {@link TagParser}. - * + * * @param key * The {@link NamespacedKey} of the resulting {@link SlimefunTag} */ @@ -61,7 +60,7 @@ public TagParser(@Nonnull NamespacedKey key) { /** * This constructs a new {@link TagParser} for the given {@link SlimefunTag} - * + * * @param tag * The {@link SlimefunTag} to parse inputs for */ @@ -82,12 +81,12 @@ void parse(@Nonnull SlimefunTag tag, @Nonnull BiConsumer, Set, Set materials = EnumSet.noneOf(Material.class); + Set materials = new HashSet<>(); Set> tags = new HashSet<>(); JsonObject root = JsonUtils.parseString(json).getAsJsonObject(); diff --git a/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/abstractItems/AContainer.java b/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/abstractItems/AContainer.java index 04747b4f84..723cb46426 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/abstractItems/AContainer.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/abstractItems/AContainer.java @@ -1,6 +1,7 @@ package me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -108,7 +109,7 @@ protected void constructMenu(BlockMenuPreset preset) { preset.addItem(i, ChestMenuUtils.getOutputSlotTexture(), ChestMenuUtils.getEmptyClickHandler()); } - preset.addItem(22, new CustomItemStack(Material.BLACK_STAINED_GLASS_PANE, " "), ChestMenuUtils.getEmptyClickHandler()); + preset.addItem(22, CustomItemStack.create(Material.BLACK_STAINED_GLASS_PANE, " "), ChestMenuUtils.getEmptyClickHandler()); for (int i : getOutputSlots()) { preset.addMenuClickHandler(i, ChestMenuUtils.getDefaultOutputHandler()); @@ -118,9 +119,9 @@ protected void constructMenu(BlockMenuPreset preset) { /** * This method returns the title that is used for the {@link Inventory} of an * {@link AContainer} that has been opened by a Player. - * + * * Override this method to set the title. - * + * * @return The title of the {@link Inventory} of this {@link AContainer} */ @Nonnull @@ -131,16 +132,16 @@ public String getInventoryTitle() { /** * This method returns the {@link ItemStack} that this {@link AContainer} will * use as a progress bar. - * + * * Override this method to set the progress bar. - * + * * @return The {@link ItemStack} to use as the progress bar */ public abstract ItemStack getProgressBar(); /** * This method returns the max amount of electricity this machine can hold. - * + * * @return The max amount of electricity this Block can store. */ @Override @@ -150,7 +151,7 @@ public int getCapacity() { /** * This method returns the amount of energy that is consumed per operation. - * + * * @return The rate of energy consumption */ public int getEnergyConsumption() { @@ -161,7 +162,7 @@ public int getEnergyConsumption() { * This method returns the speed at which this machine will operate. * This can be implemented on an instantiation-level to create different tiers * of machines. - * + * * @return The speed of this machine */ public int getSpeed() { @@ -172,10 +173,10 @@ public int getSpeed() { * This sets the energy capacity for this machine. * This method must be called before registering the item * and only before registering. - * + * * @param capacity * The amount of energy this machine can store - * + * * @return This method will return the current instance of {@link AContainer}, so that can be chained. */ public final AContainer setCapacity(int capacity) { @@ -191,10 +192,10 @@ public final AContainer setCapacity(int capacity) { /** * This sets the speed of this machine. - * + * * @param speed * The speed multiplier for this machine, must be above zero - * + * * @return This method will return the current instance of {@link AContainer}, so that can be chained. */ public final AContainer setProcessingSpeed(int speed) { @@ -206,10 +207,10 @@ public final AContainer setProcessingSpeed(int speed) { /** * This method sets the energy consumed by this machine per tick. - * + * * @param energyConsumption * The energy consumed per tick - * + * * @return This method will return the current instance of {@link AContainer}, so that can be chained. */ public final AContainer setEnergyConsumption(int energyConsumption) { @@ -251,13 +252,13 @@ public void register(@Nonnull SlimefunAddon addon) { /** * This method returns an internal identifier that is used to identify this {@link AContainer} * and its recipes. - * + * * When adding recipes to an {@link AContainer} we will use this identifier to * identify all instances of the same {@link AContainer}. * This way we can add the recipes to all instances of the same machine. - * + * * This method will be deprecated and replaced in the future - * + * * @return The identifier of this machine */ @Nonnull @@ -317,6 +318,22 @@ public void registerRecipe(int seconds, ItemStack input, ItemStack output) { registerRecipe(new MachineRecipe(seconds, new ItemStack[] { input }, new ItemStack[] { output })); } + public void registerRecipe(int seconds, SlimefunItemStack input, SlimefunItemStack output) { + registerRecipe(seconds, input.item(), output.item()); + } + + public void registerRecipe(int seconds, SlimefunItemStack[] input, SlimefunItemStack[] output) { + var inputAsItemStack = Arrays.stream(input) + .map(SlimefunItemStack::item) + .toArray(ItemStack[]::new); + + var outputAsItemStack = Arrays.stream(output) + .map(SlimefunItemStack::item) + .toArray(ItemStack[]::new); + + registerRecipe(seconds, inputAsItemStack, outputAsItemStack); + } + @Override public void preRegister() { addItemHandler(new BlockTicker() { @@ -344,7 +361,7 @@ protected void tick(Block b) { processor.updateProgressBar(inv, 22, currentOperation); currentOperation.addProgress(1); } else { - inv.replaceExistingItem(22, new CustomItemStack(Material.BLACK_STAINED_GLASS_PANE, " ")); + inv.replaceExistingItem(22, CustomItemStack.create(Material.BLACK_STAINED_GLASS_PANE, " ")); for (ItemStack output : currentOperation.getResults()) { inv.pushItem(output.clone(), getOutputSlots()); diff --git a/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/abstractItems/AGenerator.java b/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/abstractItems/AGenerator.java index db5555f6c9..b8bc7a92cb 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/abstractItems/AGenerator.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/abstractItems/AGenerator.java @@ -122,7 +122,7 @@ private void constructMenu(BlockMenuPreset preset) { preset.addMenuClickHandler(i, ChestMenuUtils.getDefaultOutputHandler()); } - preset.addItem(22, new CustomItemStack(Material.BLACK_STAINED_GLASS_PANE, " "), ChestMenuUtils.getEmptyClickHandler()); + preset.addItem(22, CustomItemStack.create(Material.BLACK_STAINED_GLASS_PANE, " "), ChestMenuUtils.getEmptyClickHandler()); } @Override @@ -164,7 +164,7 @@ public int getGeneratedOutput(Location l, Config data) { inv.pushItem(new ItemStack(Material.BUCKET), getOutputSlots()); } - inv.replaceExistingItem(22, new CustomItemStack(Material.BLACK_STAINED_GLASS_PANE, " ")); + inv.replaceExistingItem(22, CustomItemStack.create(Material.BLACK_STAINED_GLASS_PANE, " ")); processor.endOperation(l); return 0; @@ -191,7 +191,7 @@ private boolean isBucket(@Nullable ItemStack item) { } ItemStackWrapper wrapper = ItemStackWrapper.wrap(item); - return item.getType() == Material.LAVA_BUCKET || SlimefunUtils.isItemSimilar(wrapper, SlimefunItems.FUEL_BUCKET, true) || SlimefunUtils.isItemSimilar(wrapper, SlimefunItems.OIL_BUCKET, true); + return item.getType() == Material.LAVA_BUCKET || SlimefunUtils.isItemSimilar(wrapper, SlimefunItems.FUEL_BUCKET.item(), true) || SlimefunUtils.isItemSimilar(wrapper, SlimefunItems.OIL_BUCKET.item(), true); } private MachineFuel findRecipe(BlockMenu menu, Map found) { @@ -209,7 +209,7 @@ private MachineFuel findRecipe(BlockMenu menu, Map found) { /** * This method returns the max amount of electricity this machine can hold. - * + * * @return The max amount of electricity this Block can store. */ public int getCapacity() { @@ -218,7 +218,7 @@ public int getCapacity() { /** * This method returns the amount of energy that is consumed per operation. - * + * * @return The rate of energy consumption */ @Override @@ -230,10 +230,10 @@ public int getEnergyProduction() { * This sets the energy capacity for this machine. * This method must be called before registering the item * and only before registering. - * + * * @param capacity * The amount of energy this machine can store - * + * * @return This method will return the current instance of {@link AGenerator}, so that can be chained. */ public final AGenerator setCapacity(int capacity) { @@ -249,10 +249,10 @@ public final AGenerator setCapacity(int capacity) { /** * This method sets the energy produced by this machine per tick. - * + * * @param energyProduced * The energy produced per tick - * + * * @return This method will return the current instance of {@link AGenerator}, so that can be chained. */ public final AGenerator setEnergyProduction(int energyProduced) { diff --git a/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/abstractItems/MachineFuel.java b/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/abstractItems/MachineFuel.java index b333bde74f..6d1c0fcbed 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/abstractItems/MachineFuel.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/abstractItems/MachineFuel.java @@ -2,6 +2,7 @@ import java.util.function.Predicate; +import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack; import org.apache.commons.lang.Validate; import org.bukkit.inventory.ItemStack; @@ -32,6 +33,20 @@ public MachineFuel(int seconds, ItemStack fuel, ItemStack output) { this.output = output; } + public MachineFuel(int seconds, SlimefunItemStack fuel) { + this(seconds, fuel.item(), null); + } + + public MachineFuel(int seconds, SlimefunItemStack fuel, SlimefunItemStack output) { + Validate.notNull(fuel, "Fuel must never be null!"); + Validate.isTrue(seconds > 0, "Fuel must last at least one second!"); + + this.ticks = seconds * 2; + this.fuel = fuel.item(); + this.wrapper = ItemStackWrapper.wrap(this.fuel); + this.output = output != null ? output.item() : null; + } + public ItemStack getInput() { return fuel; } diff --git a/src/main/java/me/mrCookieSlime/Slimefun/api/BlockStorage.java b/src/main/java/me/mrCookieSlime/Slimefun/api/BlockStorage.java index c2df4fd2c9..78c9cc90a7 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/api/BlockStorage.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/api/BlockStorage.java @@ -35,6 +35,7 @@ import com.google.gson.JsonParser; import com.google.gson.stream.JsonWriter; +import io.github.bakedlibs.dough.blocks.BlockPosition; import io.github.bakedlibs.dough.common.CommonPatterns; import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; @@ -201,7 +202,7 @@ private void loadBlock(File file, FileConfiguration cfg, String key) { * error to the console (if enabled). */ if (Slimefun.getRegistry().logDuplicateBlockEntries()) { - Slimefun.logger().log(Level.INFO, "Ignoring duplicate block @ {0}, {1}, {2} ({3} -> {4})", new Object[] { l.getBlockX(), l.getBlockY(), l.getBlockZ(), blockInfo.getString("id"), storage.get(l).getString("id") }); + Slimefun.logger().log(Level.INFO, "Ignoring duplicate block @ %d, %d, %d (%s -> %s)".formatted(l.getBlockX(), l.getBlockY(), l.getBlockZ(), blockInfo.getString("id"), storage.get(l).getString("id"))); } return; @@ -513,10 +514,18 @@ public static String getLocationInfo(Location l, String key) { return getLocationInfo(l).getString(key); } + public static String getLocationInfo(BlockPosition l, String key) { + return getLocationInfo(l.toLocation()).getString(key); + } + public static void addBlockInfo(Location l, String key, String value) { addBlockInfo(l, key, value, false); } + public static void addBlockInfo(BlockPosition l, String key, String value) { + addBlockInfo(l.toLocation(), key, value, false); + } + public static void addBlockInfo(Block block, String key, String value) { addBlockInfo(block.getLocation(), key, value); } @@ -525,6 +534,10 @@ public static void addBlockInfo(Block block, String key, String value, boolean u addBlockInfo(block.getLocation(), key, value, updateTicker); } + public static void addBlockInfo(BlockPosition l, String key, String value, boolean updateTicker) { + addBlockInfo(l.toLocation(), key, value, updateTicker); + } + public static void addBlockInfo(Location l, String key, String value, boolean updateTicker) { Config cfg = getLocationInfo(l); diff --git a/src/main/java/me/mrCookieSlime/Slimefun/api/inventory/DirtyChestMenu.java b/src/main/java/me/mrCookieSlime/Slimefun/api/inventory/DirtyChestMenu.java index bf7cfee93b..dd2bf8cd12 100644 --- a/src/main/java/me/mrCookieSlime/Slimefun/api/inventory/DirtyChestMenu.java +++ b/src/main/java/me/mrCookieSlime/Slimefun/api/inventory/DirtyChestMenu.java @@ -33,7 +33,7 @@ public DirtyChestMenu(@Nonnull BlockMenuPreset preset) { /** * This method checks whether this {@link DirtyChestMenu} is currently viewed by a {@link Player}. - * + * * @return Whether anyone is currently viewing this {@link Inventory} */ public boolean hasViewer() { @@ -136,7 +136,7 @@ public ItemStack pushItem(ItemStack item, int... slots) { } if (amount > 0) { - return new CustomItemStack(item, amount); + return CustomItemStack.create(item, amount); } else { return null; } diff --git a/src/main/resources/languages/de/messages.yml b/src/main/resources/languages/de/messages.yml index 55f8ead5ae..5debea0c8e 100644 --- a/src/main/resources/languages/de/messages.yml +++ b/src/main/resources/languages/de/messages.yml @@ -148,6 +148,7 @@ messages: bee-suit-slow-fall: '&eDeine Bienenflügel haben dir eine sichere Landung ermöglicht' deprecated-item: '&4Dieses Item ist veraltet und wird bald aus Slimefun entfernt.' researching-is-disabled: '&cDas Freischalten von Items wurde auf diesem Server deaktiviert. Alles ist bereits automatisch freigeschaltet!' + await-deletion: '&cDu kannst keinen Slimefun Block so kurz nach dem Abbauen eines anderen platzieren. Versuche es in Kürze erneut.' multi-tool: mode-change: '&bDer Modus von deinem Multi-Tool wurde geändert zu: &9%mode%' not-shears: '&cEinMulti Tool kann nicht als Schere verwendet werden!' diff --git a/src/main/resources/languages/fa/messages.yml b/src/main/resources/languages/fa/messages.yml index 1daccfc6ff..eadfe05e13 100644 --- a/src/main/resources/languages/fa/messages.yml +++ b/src/main/resources/languages/fa/messages.yml @@ -109,7 +109,7 @@ android: editor: 'ویرایش برنامه' uploaded: - '&bدرحال آپلود...' - - '&aSuccessfully uploaded your script!' + - '&aآپلود اسکریپت کامل شد!' languages: default: 'پیشفرض سرور' en: 'انگلیسی' @@ -118,9 +118,11 @@ languages: it: 'ایتالیایی' es: 'اسپانیایی' pl: 'لهستانی' + sv: 'سوئدی' nl: 'هلندی' cs: 'کشور چک' hu: 'مجارستانی' + lv: 'لاتویایی' ru: 'روسی' zh-TW: 'چینی (تایوان)' vi: 'ویتنامی' diff --git a/src/main/resources/languages/he/messages.yml b/src/main/resources/languages/he/messages.yml index a6294cdf1e..00041a9ad0 100644 --- a/src/main/resources/languages/he/messages.yml +++ b/src/main/resources/languages/he/messages.yml @@ -124,6 +124,8 @@ guide: wiki: '&3ויקי עורך ' resourcepack: '&c אמן חבילת משאבים' translator: '&9מתרגם' +actionbar: + radiation: '&6רמת חשיפה לקרינה: &c%level%&7/&e100' messages: not-researched: '&4אין לך מספיק ידע להבין זאת. &c אתה צריך לשחרר את &f"%item%&f"' not-enough-xp: "&4אין לך מספיק נקודות ניסיון\nכדי לפתוח את זה " diff --git a/src/main/resources/languages/hu/messages.yml b/src/main/resources/languages/hu/messages.yml index 4f99929461..9f135acb48 100644 --- a/src/main/resources/languages/hu/messages.yml +++ b/src/main/resources/languages/hu/messages.yml @@ -124,6 +124,8 @@ guide: wiki: '&3Wiki szerkesztő' resourcepack: '&cForráscsomag művész' translator: '&9Fordító' +actionbar: + radiation: '&6Sugárterhelési szint: &c%level%&7/&e100' messages: not-researched: '&4Nincs elég tudásod, hogy megértsd ezt.&cFel kel még oldanod ezt a tárgyat: &f"%item%&f"' not-enough-xp: '&4Nincs elég XP-d ennek a feloldásához' @@ -147,6 +149,8 @@ messages: piglin-barter: '&4Slimefun tárgyakat nem cserélhetsz el a piglinekkel.' bee-suit-slow-fall: '&eA Bee Wings segít neked visszatérni a földre lassan és biztonságosan' deprecated-item: '&4Ez a tárgy elavult, és hamarosan eltávolítjuk a Slimefunból.' + researching-is-disabled: '&cA kutatás le van tiltva ezen a szerveren. Alapértelmezés szerint minden fel van oldva!' + await-deletion: '&cNem tehetsz le egy Slimefun blockot ilyen gyorsan egy másik kiütése után. Próbáld újra később.' multi-tool: mode-change: '&b%device% mód átállítva: &9%mode%' not-shears: '&cA Multi Tool nem használható óllóként!' @@ -257,6 +261,9 @@ machines: pick-a-floor: '&3- Válassz emeletet -' current-floor: '&eEzen az emeleten tartózkodsz:' click-to-teleport: '&eKattints&7, hogy erre az emeletre teleportálj:' + enter-name: '&7Kérlek írd be a kívánt emelet nevét a Chatre. &f(Színkódok is használhatóak!)' + named: '&2Sikeresen elnevezted ezt az emeletet: &f%floor%' + editor-title: 'Lift konfigurálása' TELEPORTER: teleporting: '&3Teleportálás...' teleported: '&3Teleportálva!' @@ -272,6 +279,8 @@ machines: waypoints: 'Útpont áttekintése' CARGO_NODES: must-be-placed: '&4Ládára vagy gépre kell helyezni!' + connected: '&2Csatlakoztatva!' + not-connected: '&4Nincs csatlakoztatva!' INDUSTRIAL_MINER: no-fuel: '&cAz Industrial Miner-ednek elfogyott az üzemanyaga! Tedd az üzemanyagot a felette lévő ládába.' piston-facing: '&cAz Industrial Miner-edhez szükségesek dugattyúk, amik felfelé néznek!' @@ -301,6 +310,8 @@ cauldron: no-discoloring: '&4Nem színteleníthetsz Slimefun páncélt!' gps: deathpoint: '&4Halálpont: &7%date%' + status-online: 'ELÉRHETŐ' + status-offline: 'NEM ELÉRHETÔ' waypoint: new: '&eKérlek írd be az új útpont nevét chatre. &7(Színkódok használhatóak!)' added: '&aSikeresen létrehoztál egy útpontot' @@ -400,3 +411,5 @@ languages: mk: 'Macedón' sr: 'Szerb' be: 'Belarusz' + si-LK: 'Szingaléz' + lt: 'Litván' diff --git a/src/main/resources/languages/hu/researches.yml b/src/main/resources/languages/hu/researches.yml index d911b94f33..9cd0534ced 100644 --- a/src/main/resources/languages/hu/researches.yml +++ b/src/main/resources/languages/hu/researches.yml @@ -259,3 +259,4 @@ slimefun: medium_tier_auto_enchanting: Gyors Automata Varázslás és Varázslat törlése portable_teleporter: Teleportálás bárhonnan farmer_talisman: A Farmer talizmánja + rainbow_armor: Látni akarom a szivárványt magasan az égben diff --git a/src/main/resources/languages/id/messages.yml b/src/main/resources/languages/id/messages.yml index cc5c9157f0..d19eb84def 100644 --- a/src/main/resources/languages/id/messages.yml +++ b/src/main/resources/languages/id/messages.yml @@ -68,21 +68,24 @@ guide: text: - '&bAnimasi Pembelajaran: &aYa' - '' - - '&7You can now toggle whether you' - - '&7will see information about your pondering in chat' - - '&7upon researching an item.' + - '&7Sekarang Anda dapat beralih apakah Anda ingin' + - '&7akan melihat informasi tentang perenungan Anda dalam obrolan' + - '&7setelah meneliti suatu item.' + click: '&eKlik untuk menonaktifkan animasi pembelajaran Anda' disabled: text: - '&bAnimasi Pembelajaran: &4Tidak' - '' - - '&7You can now toggle whether you' - - '&7will see information about your pondering in chat' - - '&7upon researching an item.' + - '&7Sekarang Anda dapat beralih apakah Anda ingin' + - '&7akan melihat informasi tentang perenungan Anda dalam obrolan' + - '&7setelah meneliti suatu item.' + click: '&eKlik untuk mengaktifkan animasi pembelajaran Anda' title: main: 'Panduan Slimefun' settings: 'Pengaturan & Informasi' languages: 'Pilih Bahasa Yang Anda Inginkan' credits: 'Para Kontributor Slimefun4' + wiki: 'Slimefun4 Wiki' addons: 'Addons untuk Slimefun4' bugs: 'Laporkan masalah' source: 'Kode sumber' @@ -97,6 +100,7 @@ guide: resourcepack: '&cArtis Resourcepack' translator: '&9Penerjemah' messages: + not-researched: '&4Anda tidak memiliki cukup pengetahuan untuk memahami ini. &cAnda butuh membuka &f"%item%&f" terlebih dahulu' not-enough-xp: '&4Anda Tidak Memiliki Cukup XP untuk Membuka Ini' unlocked: '&bAnda Telah Membuka &7"%research%"' only-players: '&4Perintah Ini Hanya Untuk Para Pemain' @@ -115,6 +119,9 @@ messages: disabled-item: '&4&lBenda Ini Telah Dinonakrifkan! Bagaimana Anda Mendapatkannya?' no-tome-yourself: '&cKamu Tidak Bisa Menggunakan &4Tome Of Knowledge &cUntuk Diri Anda Sendiri...' multimeter: '&bEnergi Yang Telah Tersimpan: &3%stored% &b/ &3%capacity%' + deprecated-item: '&4Item ini telah lama tidak digunakan dan akan dihapus dari slimefun sebentar lagi.' + researching-is-disabled: "&cPembelajaran telah dimatikan di server ini.\nSemua ilmu terbuka gratis!" + await-deletion: '&cAnda tidak bisa menempatkan blok slimefun segera setelah menghancurkannya. Coba lagi sesaat kemudian.' auto-crafting: select: 'Pilih resep ini' talisman: diff --git a/src/main/resources/languages/pl/messages.yml b/src/main/resources/languages/pl/messages.yml index 60d1775a3c..bae152e144 100644 --- a/src/main/resources/languages/pl/messages.yml +++ b/src/main/resources/languages/pl/messages.yml @@ -22,6 +22,8 @@ commands: description: 'Uruchom debugowanie dla programistów' none-running: '&7Nie ma obecnie żadnego przypadku testowego!' disabled: '&7Wyłączono tryb debugowania.' +placeholderapi: + profile-loading: 'Ładowanie...' guide: locked: 'Zablokowany' work-in-progress: 'Ta funkcja nie została jeszcze ukończona!' @@ -80,7 +82,7 @@ guide: description: - '&7Slimefun jest projektem open-source' - '&7i utrzymywany przez dużą społeczność ludzi.' - - '&7Over &e%contributors% &7people have worked on' + - '&7Ponad &e%contributors% &7osoby pracowały nad' - '&7Slimefun przez te wszystkie lata.' roles: developer: '&6Deweloper' diff --git a/src/main/resources/languages/pt/messages.yml b/src/main/resources/languages/pt/messages.yml index 773cfd3682..23ddfacb86 100644 --- a/src/main/resources/languages/pt/messages.yml +++ b/src/main/resources/languages/pt/messages.yml @@ -52,6 +52,7 @@ guide: miner: 'Recursos que podes obter com este Miner' generator: 'Tipos de combustível disponíveis' gold-pan: 'Recursos que podes obter' + climbing-pick: 'Superfícies que podes escalar' pages: previous: 'Página anterior' next: 'Página seguinte' @@ -79,16 +80,18 @@ guide: text: - '&bAnimação de descoberta: &aSim' - '' - - '&7You can now toggle whether you' - - '&7will see information about your pondering in chat' - - '&7upon researching an item.' + - '&7Agora podes escolher se tu' + - '&7vais ver informações sobre a tua ponderação no chat' + - '&7ao pesquisar um item.' + click: '&eClica para desativar a tua animação de descoberta' disabled: text: - '&bAnimação de descoberta: &aNão' - '' - - '&7You can now toggle whether you' - - '&7will see information about your pondering in chat' - - '&7upon researching an item.' + - '&7Agora podes escolher se tu' + - '&7vais ver informações sobre a tua ponderação no chat' + - '&7ao pesquisar um item.' + click: '&eClica para desativar a tua animação de descoberta' title: main: 'Guia Slimefun' settings: 'Configurações e informação' @@ -110,6 +113,9 @@ guide: resourcepack: '&cArtista de Resourcepack' translator: '&9Tradutor' messages: + not-researched: '&4Não tens conhecimento suficiente para entender isto. &cVais precisar de desbloquear &f"%item%&f"' + not-enough-xp: '&4Não tens XP suficiente para desbloquear isto' + unlocked: '&bDesbloqueaste &7"%research%"' only-players: '&4Este comando é apenas para Jogadores' unknown-player: '&4Jogador Desconhecido: &c%player%' no-permission: '&4Não tens as permissões necessárias para fazer isto' @@ -121,19 +127,45 @@ messages: disabled-in-world: '&4&lEsse item foi desativado neste mundo' disabled-item: '&4&lEsse item foi desativado! Como é que o conseguiste?' piglin-barter: '&4Não podes trocar com piglins utilizando itens de Slimefun' + deprecated-item: '&4Este item foi descontinuado e será removido de Slimefun em breve.' + researching-is-disabled: '&cA pesquisa foi desativada neste servidor. Tudo está desbloqueado por padrão!' + await-deletion: '&cNão podes colocar um bloco do Slimefun logo após teres quebrado um. Tenta novamente.' auto-crafting: + select-a-recipe: '&eBaixa-te e faz Clique Direito &7neste bloco com o item que queres craftar.' + recipe-set: '&aDefiniste o item para esta máquina.' + recipe-removed: '&eRemoveste o item desta máquina. Podes mandá-la fazer um item novo.' + no-recipes: '&cNão conseguimos encontrar nenhuma maneira válida de fazer o item que tu seguras.' + missing-chest: '&cOs Auto-Crafters teem que ser colocados sobre um baú!' + select: 'Selecionar esta receita' + temporarily-disabled: '&eEste Auto-Crafter foi temporariamente desativado. Podes reativá-lo a qualquer momento!' + re-enabled: '&eEste Auto-Crafter foi reativado!' + recipe-unavailable: | + &cOu este item foi desativado pelo servidor, ou ainda não desbloqueaste. + &7Tenta fazer o item se nunca o fizeste antes para descbloqueares a receita. tooltips: + enabled: + - '&aEsta receita está ativada' + - '' + - '&eClique esquerdo &7para desativar a receita temporariamente' + - '&eClique direito &7para remover esta receita' disabled: - '&cEsta receita está desativada no momento' - '' - - '&eLeft Click &7to re-enable this recipe' - - '&eRight Click &7to remove this recipe' + - '&eClique direito &7para reativar esta receita' + - '&eClique direito &7para remover esta receita' + research: + progress: '&7Começas a ponderar &b%research% &e(%progress%)' no-pvp: '&cNão podes fazer pvp aqui!' opening-guide: '&bA abrir o guia, isto pode demorar alguns segundos...' opening-backpack: '&bA abrir a mochila, isto pode demorar alguns segundos...' link-prompt: '&eClique aqui:' machines: + pattern-not-found: '&eEu não reconheço esta receita. Coloca os itens no padrão correto no Dispenser.' full-inventory: '&eDesculpa, o meu inventário está cheio!' + in-use: '&cO inventário deste bloco foi aberto por um jogador diferente.' + ignition-chamber-no-flint: '&cA câmara de ignição não tem isqueiros.' + ANCIENT_ALTAR: + unknown-recipe: '&4Receita desconhecida! &cUsa a receita correta!' HOLOGRAM_PROJECTOR: inventory-title: 'Editor de Holograma' ELEVATOR: @@ -150,6 +182,9 @@ machines: GPS_CONTROL_PANEL: transmitters: 'Transmissores' waypoints: 'Waypoints' + CARGO_NODES: + connected: '&2Conectado!' + not-connected: '&4Não conectado!' anvil: not-working: '&4Não podes usar itens de Slimefun em uma bigorna!' mcmmo-salvaging: '&4Não podes destruir itens do Slimefun!' @@ -163,6 +198,9 @@ villagers: no-trading: '&4Não podes trocar itens de Slimefun com Villagers!' backpack: already-open: '&cEsta mochila está aberta em outro lugar!' +gps: + status-online: 'LIGADO' + status-offline: 'DESLIGADO' inventory: no-access: '&4Não tens permissão para aceder este bloco' android: @@ -221,6 +259,7 @@ languages: ru: 'Russo' sk: 'Eslovaco' zh-CN: 'Chines (China)' + zh-TW: 'Chinês (Taiwan)' vi: 'Vietnamita' id: 'Indonésio' el: 'Grego' @@ -246,3 +285,5 @@ languages: mk: 'Macedónio' sr: 'Sérvio' be: 'Bielorrusso' + si-LK: 'Cingalês' + lt: 'Lituano' diff --git a/src/main/resources/languages/ru/messages.yml b/src/main/resources/languages/ru/messages.yml index af6b255bf7..61b0dbfb5b 100644 --- a/src/main/resources/languages/ru/messages.yml +++ b/src/main/resources/languages/ru/messages.yml @@ -129,13 +129,28 @@ messages: mode-change: '&bРежим «%device%» изменён на: &9%mode%' not-shears: '&cМультиинструмент не может быть использован в качестве ножниц!' auto-crafting: + select-a-recipe: '&eПрисядьте и нажмите ПКМ &7по этому блоку предметом, который хотите создать.' + recipe-set: '&aВы успешно установили рецепт для этой машины.' + recipe-removed: '&eВы успешно удалили рецепт из этой машины. Вы можете установить новый рецепт в любое время!' + no-recipes: '&cНе удалось найти подходящие рецепты для предмета в руке.' + missing-chest: '&cОтсутствует сундук! Авто-крафтеры нужно размещать над сундуком.' select: 'Выбрать этот рецепт' + temporarily-disabled: '&eЭтот автоматический верстак был временно отключен. Вы можете снова включить его в любой момент!' + re-enabled: '&eЭтот Авто-крафтер был снова включен!' + recipe-unavailable: | + &cЭтот предмет либо отключен на сервере, либо вы еще не разблокировали его. + &7Попробуйте создать предмет, если вы еще не сделали этого, чтобы разблокировать рецепт. tooltips: enabled: - '&cЭтот рецепт сейчас включён' - '' - - '&eLeft Click &7to temporarily disable the recipe' - - '&eRight Click &7to remove this recipe' + - '&eЛевый клик &7для временного отключения рецепта' + - '&eПравый клик &7для удаления этого рецепта' + disabled: + - '&cЭтот рецепт сейчас отключён' + - '' + - '&eЛевый клик &7для включения рецепта' + - '&eПравый клик &7для удаления этого рецепта' talisman: anvil: '&a&oВаш талисман сохранил инструмент от поломки' miner: '&a&oВаш талисман удвоил Ваш дроп' @@ -214,6 +229,7 @@ machines: pick-a-floor: '&3- Выберите пункт назначения -' current-floor: '&eВаш текущий этаж:' click-to-teleport: '&eНажмите &7для перемещения на этот этаж:' + editor-title: 'Настроить этот лифт' TELEPORTER: teleporting: '&3Телепортация…' teleported: '&3Телепортировано!' diff --git a/src/main/resources/languages/sv/categories.yml b/src/main/resources/languages/sv/categories.yml index 3b31f79f7e..d82006ff2d 100644 --- a/src/main/resources/languages/sv/categories.yml +++ b/src/main/resources/languages/sv/categories.yml @@ -6,6 +6,7 @@ slimefun: food: 'Mat' basic_machines: 'Grundläggande Maskiner' electricity: 'Energi och El' + androids: 'Programerbara Androider' gps: 'GPS-baserade Maskiner' armor: 'Rustning' magical_items: 'Magiska Föremål' diff --git a/src/main/resources/languages/sv/messages.yml b/src/main/resources/languages/sv/messages.yml index 52713bca69..aa141bee30 100644 --- a/src/main/resources/languages/sv/messages.yml +++ b/src/main/resources/languages/sv/messages.yml @@ -13,6 +13,9 @@ commands: description: Låser upp/återställer en spelares forskningar reset: '&cDu har återställt %player%s kunskap' reset-target: '&cDin kunskap har blivit återställd' + backpack: + invalid-id: '&4ID måste vara ett icke-negativt tal!' + backpack-does-not-exist: '&4Den angivna ryggsäcken finns inte!' placeholderapi: profile-loading: 'Laddar...' guide: @@ -36,6 +39,7 @@ guide: miner: 'Resurser du kan få med denna Gruvarbetare' generator: 'Tillgängliga typer av bränsle' gold-pan: 'Resurser du kan få' + climbing-pick: 'Ytor som du kan klättra' cheat: no-multiblocks: '&4Du kan inte fuska fram Multiblocks, du måste bygga dem!' pages: @@ -59,6 +63,7 @@ guide: settings: 'Inställningar & Info' languages: 'Välj ditt föredragna språk' credits: 'Slimefun4-medhjälpare' + wiki: 'Slimefun4 Wiki' addons: 'Tilläg till Slimefun4' bugs: 'Bugg Rapporter' source: 'Källkoden' @@ -91,6 +96,8 @@ messages: disabled-item: '&4&lDetta föremål är inaktiverat! Hur fick du ens det?' no-tome-yourself: '&cDu kan inte använda &4Tome of Knowledge &cpå dig själv' multimeter: '&bLagrad energi: &3%stored% &b/ &3%capacity%' + auto-crafting: + select: 'Välj recept' talisman: anvil: '&a&oDin talisman förhindrade ditt verktyg från att gå sönder' miner: '&a&oDin talisman dubblade precis dina gruvfynd' diff --git a/src/main/resources/languages/sv/recipes.yml b/src/main/resources/languages/sv/recipes.yml index ed97d539c0..83042679a5 100644 --- a/src/main/resources/languages/sv/recipes.yml +++ b/src/main/resources/languages/sv/recipes.yml @@ -1 +1,6 @@ --- +slimefun: + multiblock: + name: 'Multiblock' + oil_pump: + name: 'Oljepump' diff --git a/src/main/resources/languages/tl/messages.yml b/src/main/resources/languages/tl/messages.yml index 051a7d8bbd..08d1463bbb 100644 --- a/src/main/resources/languages/tl/messages.yml +++ b/src/main/resources/languages/tl/messages.yml @@ -30,6 +30,7 @@ commands: debug: none-running: '&7Walang kaso ng pagsubok ang kasalukuyang pinapatakbo!' running: '&7Pinapatakbo ang debug mode kasama ang test: &6%test%' + disabled: '&7Hindi na tumatakbo ang debug mode.' placeholderapi: profile-loading: 'Naglo-load...' guide: @@ -80,19 +81,8 @@ guide: options: learning-animation: enabled: - text: - - '&bKarunungang Animasyon: &aYes' - - '' - - '&7You can now toggle whether you' - - '&7will see information about your pondering in chat' - - '&7upon researching an item.' + click: '&eI-click para huwag paganahin ang iyong learning animation' disabled: - text: - - '&bLearning Animation: &4No' - - '' - - '&7You can now toggle whether you' - - '&7makikita ang impormasyon na pinagtatakahan mo sa chat' - - '&7upon researching an item.' click: '&eI-click para paganahin ang iyong karunungang animasyon' title: main: 'Gabay para sa Slimefun' @@ -116,6 +106,7 @@ guide: roles: translator: '&9Tagapagsaling-wika' messages: + not-researched: '&4Kulang ang iyong Kaalaman upang ito ay maintindihan. &cKailangan mo I-unlock &f"%item%&f"' not-enough-xp: '&4Kulang ang iyong XP upang ito''y ma-unlock.' unlocked: '&bNa-unlock mo ang &7"%research%"' only-players: '&4Ang command na ito ay para lamang sa Players.' diff --git a/src/main/resources/languages/tr/messages.yml b/src/main/resources/languages/tr/messages.yml index 4cf08c8129..eb3a9f2276 100644 --- a/src/main/resources/languages/tr/messages.yml +++ b/src/main/resources/languages/tr/messages.yml @@ -78,6 +78,24 @@ guide: translations: name: '&aBir şeyler mi eksik?' lore: 'Kendi çevirinizi eklemek için tıklayın' + options: + learning-animation: + enabled: + text: + - '&bÖğrenme Animasyonu: &aAçık' + - '' + - '&7İstediğiniz zaman Eşyanın bilgilerini' + - '&7yazdığınız zaman' + - '&7kanalda görmenizi sağlar.' + click: '&eÖğrenme animasyonunu kapatmak için tıkla' + disabled: + text: + - '&bÖğrenme Animasyonu: &4Kapalı' + - '' + - '&7İstediğiniz zaman Eşyanın bilgilerini' + - '&7yazdığınız zaman' + - '&7kanalda görmenizi sağlar.' + click: '&eÖğrenme animasyonunu açmak için tıkla' title: main: 'Slimefun Rehberi' settings: 'Ayarlar & Bilgi' @@ -127,18 +145,24 @@ messages: mode-change: '&b%device% modül değiştirildi: &9%mode%' not-shears: '&cBir Multi Tool makas olarak kullanılamaz!' auto-crafting: + recipe-set: '&aBu makinenin tarifini başarıyla ayarladınız.' + recipe-removed: '&eTarifi bu makineden başarıyla kaldırdınız. İstediğiniz zaman yeni bir tarif ayarlayabilirsiniz!' + no-recipes: '&cTuttuğunuz öğe için geçerli herhangi bir tarif bulamadık.' + missing-chest: '&cKayıp göğüs! Otomatik zanaatkarlar bir sandığın üzerine yerleştirilmelidir.' select: 'Bu tarifi seçin' + temporarily-disabled: '&eBu otomatik Crafter geçici olarak devre dışı bırakıldı. İstediğiniz zaman yeniden etkinleştirebilirsiniz!' + re-enabled: '&eBu otomatik Crafter yeniden etkinleştirildi!' tooltips: enabled: - '&aBu tarif şu anda etkin' - '' - - '&eLeft Click &7to temporarily disable the recipe' - - '&eRight Click &7to remove this recipe' + - '&eSol Tıklama &7tarifi geçici olarak devre dışı bırakmak için' + - '&eSağ Tıklama &7bu tarifi kaldırmak için' disabled: - '&cBu tarif şu anda devre dışı' - '' - - '&eLeft Click &7to re-enable this recipe' - - '&eRight Click &7to remove this recipe' + - '&eSol Tıklama &7bu tarifi yeniden etkinleştirmek için' + - '&eSağ Tıklama &7bu tarifi kaldırmak için' talisman: anvil: '&a&oTılsım aletinizi kırılmadan kurtardı' miner: '&a&oTılsımın madenini ikiye katladı' @@ -235,6 +259,7 @@ machines: waypoints: 'Yer Noktası Genel Bakışı' CARGO_NODES: must-be-placed: '&4Mutlaka bir sandık veya makineye bağlanmalı!' + connected: '&2Bağlandı!' INDUSTRIAL_MINER: no-fuel: '&cIndustrial Miner''ınızın yakıtı bitti! Yukarıdaki sandığa yakıt koyun.' piston-facing: '&cIndustrial Miner''ınızın pistonu yukarıya bakmalı!' diff --git a/src/main/resources/languages/zh-CN/messages.yml b/src/main/resources/languages/zh-CN/messages.yml index ea7d7da109..e79b887552 100644 --- a/src/main/resources/languages/zh-CN/messages.yml +++ b/src/main/resources/languages/zh-CN/messages.yml @@ -81,7 +81,27 @@ guide: translations: name: '&a少了些什么?' lore: '单击添加你自己的翻译' + modes: + selected: 'Slimefun 指南类型: ' + change: '点击更改类型' + SURVIVAL_MODE: '生存模式' + CHEAT_MODE: '作弊模式' options: + fireworks: + enabled: + text: + - '&b烟花: &a是' + - '' + - '&7你现在可以选择是否' + - '&7启用研究物品时的烟花。' + click: '&e点击关闭烟花' + disabled: + text: + - '&b烟花: &4否' + - '' + - '&7你现在可以选择是否' + - '&7启用研究物品时的烟花。' + click: '&e点击开启烟花' learning-animation: enabled: text: @@ -124,6 +144,8 @@ guide: wiki: '&3Wiki 编辑者' resourcepack: '&c材质制作者' translator: '&9翻译者' +actionbar: + radiation: '&6辐射暴露等级:&c%level%&7/&e100' messages: not-researched: '&4你的知识还不足以理解这个物品. &c你需要先解锁 &f"%item%"&f' not-enough-xp: '&4你没有足够的经验来解锁这个研究' @@ -148,6 +170,7 @@ messages: bee-suit-slow-fall: '&e你的蜂翅将会让你安全缓降' deprecated-item: '&4该物品已被弃用,将在不久后从 Slimefun 中移除。' researching-is-disabled: '&c该服务器已禁用研究,所有物品都已解锁!' + await-deletion: '&c你不能在破坏一个 Slimefun 方块后立即放置一个 Slimefun 方块。请稍后再试。' multi-tool: mode-change: '&b%device% 的模式已切换为: &9%mode%' not-shears: '&c多功能工具 (Multi Tool) 不能作为剪刀使用!' diff --git a/src/main/resources/languages/zh-CN/researches.yml b/src/main/resources/languages/zh-CN/researches.yml index 8a9f87f32a..07398f94e8 100644 --- a/src/main/resources/languages/zh-CN/researches.yml +++ b/src/main/resources/languages/zh-CN/researches.yml @@ -226,7 +226,7 @@ slimefun: radiant_backpack: 金光闪闪的背包 auto_drier: 自动烘干机 diet_cookie: 减肥曲奇 - storm_staff: 风之法杖 + storm_staff: 雷之法杖 soulbound_rune: 灵魂绑定符文 geo_miner: 自然资源开采机 lightning_rune: 雷电符文 @@ -259,3 +259,4 @@ slimefun: medium_tier_auto_enchanting: 高速自动附魔/祛魔 portable_teleporter: 从任何地方传送 farmer_talisman: 农夫护身符 + rainbow_armor: 我想看到高空中的彩虹 diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/api/geo/TestResourceRegistration.java b/src/test/java/io/github/thebusybiscuit/slimefun4/api/geo/TestResourceRegistration.java index 53f9eb906b..9fba77c29f 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/api/geo/TestResourceRegistration.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/api/geo/TestResourceRegistration.java @@ -72,7 +72,7 @@ void testDoubleRegistration() { @DisplayName("Test oil generation") void testOilResource() { NamespacedKey key = new NamespacedKey(plugin, "oil"); - GEOResource resource = testResource(key, "Oil", SlimefunItems.OIL_BUCKET, false, 8); + GEOResource resource = testResource(key, "Oil", SlimefunItems.OIL_BUCKET.item(), false, 8); Assertions.assertEquals(0, resource.getDefaultSupply(Environment.NETHER, Biome.NETHER_WASTES)); @@ -90,7 +90,7 @@ void testOilResource() { @DisplayName("Test nether ice generation") void testNetherIceResource() { NamespacedKey key = new NamespacedKey(plugin, "nether_ice"); - GEOResource resource = testResource(key, "Nether Ice", SlimefunItems.NETHER_ICE, true, 6); + GEOResource resource = testResource(key, "Nether Ice", SlimefunItems.NETHER_ICE.item(), true, 6); Assertions.assertNotEquals(0, resource.getDefaultSupply(Environment.NETHER, Biome.NETHER_WASTES)); Assertions.assertEquals(0, resource.getDefaultSupply(Environment.NORMAL, Biome.DESERT)); @@ -100,7 +100,7 @@ void testNetherIceResource() { @DisplayName("Test uranium generation") void testUraniumResource() { NamespacedKey key = new NamespacedKey(plugin, "uranium"); - GEOResource resource = testResource(key, "Small Chunks of Uranium", SlimefunItems.SMALL_URANIUM, true, 2); + GEOResource resource = testResource(key, "Small Chunks of Uranium", SlimefunItems.SMALL_URANIUM.item(), true, 2); Assertions.assertNotEquals(0, resource.getDefaultSupply(Environment.NORMAL, Biome.COLD_OCEAN)); Assertions.assertEquals(0, resource.getDefaultSupply(Environment.NETHER, Biome.NETHER_WASTES)); @@ -111,7 +111,7 @@ void testUraniumResource() { @DisplayName("Test salt generation") void testSaltResource() { NamespacedKey key = new NamespacedKey(plugin, "salt"); - GEOResource resource = testResource(key, "Salt", SlimefunItems.SALT, true, 18); + GEOResource resource = testResource(key, "Salt", SlimefunItems.SALT.item(), true, 18); Assertions.assertEquals(0, resource.getDefaultSupply(Environment.THE_END, Biome.THE_END)); Assertions.assertNotEquals(0, resource.getDefaultSupply(Environment.NORMAL, Biome.COLD_OCEAN)); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestDoubleRangeSetting.java b/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestDoubleRangeSetting.java index de8e8b0179..d13d0db64b 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestDoubleRangeSetting.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestDoubleRangeSetting.java @@ -34,14 +34,14 @@ public static void unload() { @Test @DisplayName("Test Constructor validation") void testConstructorValidation() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "DOUBLE_RANGE_TEST_00", new CustomItemStack(Material.DIAMOND, "&cTest")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "DOUBLE_RANGE_TEST_00", CustomItemStack.create(Material.DIAMOND, "&cTest")); Assertions.assertThrows(IllegalArgumentException.class, () -> new DoubleRangeSetting(item, "test", min, -1.0, max)); } @Test @DisplayName("Test min and max getters") void testMinMaxGetters() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "DOUBLE_RANGE_TEST_0", new CustomItemStack(Material.DIAMOND, "&cTest")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "DOUBLE_RANGE_TEST_0", CustomItemStack.create(Material.DIAMOND, "&cTest")); DoubleRangeSetting setting = new DoubleRangeSetting(item, "test", min, 0.5, max); Assertions.assertEquals(min, setting.getMinimum()); @@ -51,7 +51,7 @@ void testMinMaxGetters() { @Test @DisplayName("Test illegal values") void testIllegalValues() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "DOUBLE_RANGE_TEST", new CustomItemStack(Material.DIAMOND, "&cTest")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "DOUBLE_RANGE_TEST", CustomItemStack.create(Material.DIAMOND, "&cTest")); DoubleRangeSetting setting = new DoubleRangeSetting(item, "test", min, 0.5, max); item.addItemSetting(setting); @@ -65,7 +65,7 @@ void testIllegalValues() { @Test @DisplayName("Test allowed value") void testAllowedValue() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "DOUBLE_RANGE_TEST_2", new CustomItemStack(Material.DIAMOND, "&cTest")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "DOUBLE_RANGE_TEST_2", CustomItemStack.create(Material.DIAMOND, "&cTest")); DoubleRangeSetting setting = new DoubleRangeSetting(item, "test", min, 0.25, max); item.addItemSetting(setting); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestEnumSetting.java b/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestEnumSetting.java index 9b41cd8807..46df470c91 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestEnumSetting.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestEnumSetting.java @@ -32,7 +32,7 @@ public static void unload() { @Test @DisplayName("Test Enum Getters") void testEnumGetters() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "MATERIAL_SETTING_TEST_0", new CustomItemStack(Material.DIAMOND, "&cTest")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "MATERIAL_SETTING_TEST_0", CustomItemStack.create(Material.DIAMOND, "&cTest")); EnumSetting setting = new EnumSetting<>(item, "test", Material.class, Material.DIAMOND); Assertions.assertArrayEquals(Material.values(), setting.getAllowedValues()); } @@ -40,7 +40,7 @@ void testEnumGetters() { @Test @DisplayName("Test illegal values") void testIllegalValues() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "ENUM_SETTING_TEST", new CustomItemStack(Material.DIAMOND, "&cTest")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "ENUM_SETTING_TEST", CustomItemStack.create(Material.DIAMOND, "&cTest")); EnumSetting setting = new EnumSetting<>(item, "test", Material.class, Material.DIAMOND); item.addItemSetting(setting); @@ -53,7 +53,7 @@ void testIllegalValues() { @Test @DisplayName("Test allowed value") void testAllowedValue() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "MATERIAL_SETTING_TEST_2", new CustomItemStack(Material.DIAMOND, "&cTest")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "MATERIAL_SETTING_TEST_2", CustomItemStack.create(Material.DIAMOND, "&cTest")); EnumSetting setting = new EnumSetting<>(item, "test", Material.class, Material.DIAMOND); item.addItemSetting(setting); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestIntRangeSetting.java b/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestIntRangeSetting.java index 24d644a45e..cfb12eb0fc 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestIntRangeSetting.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestIntRangeSetting.java @@ -34,14 +34,14 @@ public static void unload() { @Test @DisplayName("Test Constructor validation") void testConstructorValidation() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "INT_RANGE_TEST_00", new CustomItemStack(Material.DIAMOND, "&cTest")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "INT_RANGE_TEST_00", CustomItemStack.create(Material.DIAMOND, "&cTest")); Assertions.assertThrows(IllegalArgumentException.class, () -> new IntRangeSetting(item, "test", min, -50, max)); } @Test @DisplayName("Test min and max getters") void testMinMaxGetters() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "INT_RANGE_TEST_0", new CustomItemStack(Material.DIAMOND, "&cTest")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "INT_RANGE_TEST_0", CustomItemStack.create(Material.DIAMOND, "&cTest")); IntRangeSetting setting = new IntRangeSetting(item, "test", min, 1, max); Assertions.assertEquals(min, setting.getMinimum()); @@ -51,7 +51,7 @@ void testMinMaxGetters() { @Test @DisplayName("Test illegal values") void testIllegalValues() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "INT_RANGE_TEST", new CustomItemStack(Material.DIAMOND, "&cTest")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "INT_RANGE_TEST", CustomItemStack.create(Material.DIAMOND, "&cTest")); IntRangeSetting setting = new IntRangeSetting(item, "test", min, 1, max); item.addItemSetting(setting); @@ -65,7 +65,7 @@ void testIllegalValues() { @Test @DisplayName("Test allowed value") void testAllowedValue() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "INT_RANGE_TEST_2", new CustomItemStack(Material.DIAMOND, "&cTest")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "INT_RANGE_TEST_2", CustomItemStack.create(Material.DIAMOND, "&cTest")); IntRangeSetting setting = new IntRangeSetting(item, "test", min, 1, max); item.addItemSetting(setting); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestItemSettings.java b/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestItemSettings.java index 47004780a0..0e043ed7f2 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestItemSettings.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestItemSettings.java @@ -35,7 +35,7 @@ public static void unload() { @Test @DisplayName("Test illegal Item Settings arguments") void testIllegalItemSettings() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "ITEM_SETTINGS_TEST", new CustomItemStack(Material.DIAMOND, "&cTest")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "ITEM_SETTINGS_TEST", CustomItemStack.create(Material.DIAMOND, "&cTest")); item.register(plugin); Assertions.assertThrows(IllegalArgumentException.class, () -> item.addItemSetting()); @@ -46,7 +46,7 @@ void testIllegalItemSettings() { @Test @DisplayName("Test adding an Item Setting") void testAddItemSetting() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "ITEM_SETTINGS_TEST_2", new CustomItemStack(Material.DIAMOND, "&cTest")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "ITEM_SETTINGS_TEST_2", CustomItemStack.create(Material.DIAMOND, "&cTest")); ItemSetting setting = new ItemSetting<>(item, "test", "Hello World"); Assertions.assertTrue(setting.isType(String.class)); @@ -69,7 +69,7 @@ void testAddItemSetting() { @Test @DisplayName("Test updating an Item Settings value") void testUpdateItemSetting() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "ITEM_SETTINGS_TEST_3", new CustomItemStack(Material.DIAMOND, "&cTest")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "ITEM_SETTINGS_TEST_3", CustomItemStack.create(Material.DIAMOND, "&cTest")); ItemSetting setting = new ItemSetting<>(item, "test", "Hello World"); item.addItemSetting(setting); @@ -86,7 +86,7 @@ void testUpdateItemSetting() { @Test @DisplayName("Test Item Settings double-registration") void testAlreadyExistingItemSetting() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "ITEM_SETTINGS_TEST", new CustomItemStack(Material.DIAMOND, "&cTest")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "ITEM_SETTINGS_TEST", CustomItemStack.create(Material.DIAMOND, "&cTest")); ItemSetting setting = new ItemSetting<>(item, "test", "Hello World"); item.addItemSetting(setting); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestMaterialTagSetting.java b/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestMaterialTagSetting.java index 0154809ebe..a62928efec 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestMaterialTagSetting.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/api/items/settings/TestMaterialTagSetting.java @@ -40,7 +40,7 @@ public static void unload() { @Test @DisplayName("Test Constructor") void testConstructorValidation() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "MATERIAL_SETTING_TEST_0", new CustomItemStack(Material.DIAMOND, "&cTest")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "MATERIAL_SETTING_TEST_0", CustomItemStack.create(Material.DIAMOND, "&cTest")); MaterialTagSetting setting = new MaterialTagSetting(item, "test", tag); Assertions.assertEquals(tag, setting.getDefaultTag()); } @@ -48,7 +48,7 @@ void testConstructorValidation() { @Test @DisplayName("Test illegal values") void testIllegalValues() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "MATERIAL_SETTING_TEST", new CustomItemStack(Material.DIAMOND, "&cTest")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "MATERIAL_SETTING_TEST", CustomItemStack.create(Material.DIAMOND, "&cTest")); MaterialTagSetting setting = new MaterialTagSetting(item, "test", tag); item.addItemSetting(setting); @@ -62,7 +62,7 @@ void testIllegalValues() { @Test @DisplayName("Test allowed value") void testAllowedValue() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "MATERIAL_SETTING_TEST_2", new CustomItemStack(Material.DIAMOND, "&cTest")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "MATERIAL_SETTING_TEST_2", CustomItemStack.create(Material.DIAMOND, "&cTest")); MaterialTagSetting setting = new MaterialTagSetting(item, "test", tag); item.addItemSetting(setting); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/api/profiles/TestGuideHistory.java b/src/test/java/io/github/thebusybiscuit/slimefun4/api/profiles/TestGuideHistory.java index fc8441b463..214cca3c0c 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/api/profiles/TestGuideHistory.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/api/profiles/TestGuideHistory.java @@ -88,7 +88,7 @@ void testSlimefunItem() throws InterruptedException { Assertions.assertEquals(0, history.size()); - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "HISTORIC_ITEM", new CustomItemStack(Material.DIORITE, "&4I am really running out of ideas for item names")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "HISTORIC_ITEM", CustomItemStack.create(Material.DIORITE, "&4I am really running out of ideas for item names")); history.add(item); Assertions.assertEquals(1, history.size()); @@ -120,7 +120,7 @@ void testItemGroup() throws InterruptedException { PlayerProfile profile = TestUtilities.awaitProfile(player); GuideHistory history = profile.getGuideHistory(); - ItemGroup itemGroup = new ItemGroup(new NamespacedKey(plugin, "itemgroup_guide_history"), new CustomItemStack(Material.BEDROCK, "&4Can't touch this")); + ItemGroup itemGroup = new ItemGroup(new NamespacedKey(plugin, "itemgroup_guide_history"), CustomItemStack.create(Material.BEDROCK, "&4Can't touch this")); Assertions.assertThrows(IllegalArgumentException.class, () -> history.add((ItemGroup) null, 1)); Assertions.assertThrows(IllegalArgumentException.class, () -> history.add(itemGroup, -20)); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/core/commands/TestBackpackCommand.java b/src/test/java/io/github/thebusybiscuit/slimefun4/core/commands/TestBackpackCommand.java index 9b876fc822..8443fdd0f5 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/core/commands/TestBackpackCommand.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/core/commands/TestBackpackCommand.java @@ -41,7 +41,7 @@ public static void unload() { private boolean hasBackpack(Player player, int id) { for (ItemStack item : player.getInventory()) { - if (SlimefunUtils.isItemSimilar(item, SlimefunItems.RESTORED_BACKPACK, false)) { + if (SlimefunUtils.isItemSimilar(item, SlimefunItems.RESTORED_BACKPACK.item(), false)) { List lore = item.getItemMeta().getLore(); if (lore.get(2).equals(ChatColor.GRAY + "ID: " + player.getUniqueId() + "#" + id)) { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/core/commands/TestChargeCommand.java b/src/test/java/io/github/thebusybiscuit/slimefun4/core/commands/TestChargeCommand.java index 6ca4577a16..6a10937092 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/core/commands/TestChargeCommand.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/core/commands/TestChargeCommand.java @@ -46,7 +46,7 @@ void testCommand() { Player player = server.addPlayer(); player.setOp(true); - player.getInventory().setItemInMainHand(RECHARGEABLE_ITEM.clone()); + player.getInventory().setItemInMainHand(RECHARGEABLE_ITEM.item()); ItemStack chargedItemStack = player.getInventory().getItemInMainHand(); Rechargeable chargedItem = (Rechargeable) SlimefunItem.getByItem(chargedItemStack); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/core/commands/TestDebugFishCommand.java b/src/test/java/io/github/thebusybiscuit/slimefun4/core/commands/TestDebugFishCommand.java index 476f6aeaab..e91cd45e14 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/core/commands/TestDebugFishCommand.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/core/commands/TestDebugFishCommand.java @@ -38,6 +38,6 @@ void testCommand(boolean op) { player.setOp(op); server.execute("slimefun", player, "debug_fish").assertSucceeded(); - Assertions.assertEquals(op, SlimefunUtils.containsSimilarItem(player.getInventory(), SlimefunItems.DEBUG_FISH, true)); + Assertions.assertEquals(op, SlimefunUtils.containsSimilarItem(player.getInventory(), SlimefunItems.DEBUG_FISH.item(), true)); } } diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/core/guide/TestGuideOpening.java b/src/test/java/io/github/thebusybiscuit/slimefun4/core/guide/TestGuideOpening.java index a8685b9736..b7a9a20d1c 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/core/guide/TestGuideOpening.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/core/guide/TestGuideOpening.java @@ -65,7 +65,7 @@ void testOpenMainMenu() throws InterruptedException { @Test @DisplayName("Test if an ItemGroup can be opened from the History") void testOpenItemGroup() throws InterruptedException { - ItemGroup itemGroup = new ItemGroup(new NamespacedKey(plugin, "history_itemgroup"), new CustomItemStack(Material.BLUE_TERRACOTTA, "&9Testy test")); + ItemGroup itemGroup = new ItemGroup(new NamespacedKey(plugin, "history_itemgroup"), CustomItemStack.create(Material.BLUE_TERRACOTTA, "&9Testy test")); SlimefunGuideImplementation guide = Mockito.mock(SlimefunGuideImplementation.class); PlayerProfile profile = prepare(guide, history -> history.add(itemGroup, 1)); @@ -75,7 +75,7 @@ void testOpenItemGroup() throws InterruptedException { @Test @DisplayName("Test if a SlimefunItem can be viewed from the History") void testOpenSlimefunItem() throws InterruptedException { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "OPEN_SLIMEFUN_ITEM", new CustomItemStack(Material.PRISMARINE_SHARD, "&5Some Shard I guess")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "OPEN_SLIMEFUN_ITEM", CustomItemStack.create(Material.PRISMARINE_SHARD, "&5Some Shard I guess")); SlimefunGuideImplementation guide = Mockito.mock(SlimefunGuideImplementation.class); PlayerProfile profile = prepare(guide, history -> history.add(item)); @@ -98,7 +98,7 @@ void testOpenSearch_withColoredSearchTerm() throws InterruptedException { String normalTerm = "iron"; String coloredTerm = ChatColor.DARK_PURPLE + "iron"; - SlimefunItem testItem = TestUtilities.mockSlimefunItem(plugin, "IRON_ITEM", new CustomItemStack(Material.IRON_INGOT, "iron item")); + SlimefunItem testItem = TestUtilities.mockSlimefunItem(plugin, "IRON_ITEM", CustomItemStack.create(Material.IRON_INGOT, "iron item")); testItem.register(plugin); Player player = server.addPlayer(); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/core/multiblocks/TestMultiBlocks.java b/src/test/java/io/github/thebusybiscuit/slimefun4/core/multiblocks/TestMultiBlocks.java index e3d408e7e3..93fb5ef75f 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/core/multiblocks/TestMultiBlocks.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/core/multiblocks/TestMultiBlocks.java @@ -33,7 +33,7 @@ public static void unload() { @Test @DisplayName("Test Exceptions for invalid MultiBlock constructors") void testInvalidConstructors() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "MULTIBLOCK_TEST", new CustomItemStack(Material.BRICK, "&5Multiblock Test")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "MULTIBLOCK_TEST", CustomItemStack.create(Material.BRICK, "&5Multiblock Test")); Assertions.assertThrows(IllegalArgumentException.class, () -> new MultiBlock(null, null, null)); @@ -46,7 +46,7 @@ void testInvalidConstructors() { @Test @DisplayName("Test MultiBlock constructor") void testValidConstructor() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "MULTIBLOCK_TEST", new CustomItemStack(Material.BRICK, "&5Multiblock Test")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "MULTIBLOCK_TEST", CustomItemStack.create(Material.BRICK, "&5Multiblock Test")); MultiBlock multiblock = new MultiBlock(item, new Material[9], BlockFace.DOWN); Assertions.assertEquals(item, multiblock.getSlimefunItem()); @@ -57,7 +57,7 @@ void testValidConstructor() { @Test @DisplayName("Test symmetric MultiBlocks") void testSymmetry() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "MULTIBLOCK_TEST", new CustomItemStack(Material.BRICK, "&5Multiblock Test")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "MULTIBLOCK_TEST", CustomItemStack.create(Material.BRICK, "&5Multiblock Test")); MultiBlock multiblock = new MultiBlock(item, new Material[] { null, null, null, Material.DIAMOND_BLOCK, null, Material.DIAMOND_BLOCK, null, Material.DISPENSER, null }, BlockFace.DOWN); Assertions.assertTrue(multiblock.isSymmetric()); @@ -69,7 +69,7 @@ void testSymmetry() { @Test @DisplayName("Test equal MultiBlocks being equal") void testEqual() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "MULTIBLOCK_TEST", new CustomItemStack(Material.BRICK, "&5Multiblock Test")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "MULTIBLOCK_TEST", CustomItemStack.create(Material.BRICK, "&5Multiblock Test")); MultiBlock multiblock = new MultiBlock(item, new Material[] { Material.BIRCH_WOOD, Material.BIRCH_WOOD, Material.BIRCH_WOOD, null, Material.CRAFTING_TABLE, null, Material.BIRCH_WOOD, Material.DISPENSER, Material.BIRCH_WOOD }, BlockFace.DOWN); MultiBlock multiblock2 = new MultiBlock(item, new Material[] { Material.BIRCH_WOOD, Material.BIRCH_WOOD, Material.BIRCH_WOOD, null, Material.CRAFTING_TABLE, null, Material.BIRCH_WOOD, Material.DISPENSER, Material.BIRCH_WOOD }, BlockFace.DOWN); @@ -80,7 +80,7 @@ void testEqual() { @Test @DisplayName("Test equal MultiBlocks with Tags but different Materials being equal") void testEqualWithTags() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "MULTIBLOCK_TEST", new CustomItemStack(Material.BRICK, "&5Multiblock Test")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "MULTIBLOCK_TEST", CustomItemStack.create(Material.BRICK, "&5Multiblock Test")); // The wooden fences are different but the structure should still match. MultiBlock multiblock = new MultiBlock(item, new Material[] { Material.OAK_FENCE, Material.OAK_FENCE, Material.OAK_FENCE, null, Material.CRAFTING_TABLE, null, Material.BIRCH_WOOD, Material.DISPENSER, Material.BIRCH_WOOD }, BlockFace.DOWN); @@ -92,7 +92,7 @@ void testEqualWithTags() { @Test @DisplayName("Test MultiBlocks with moving pistons still being equal") void testEqualWithMovingPistons() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "PISTON_MULTIBLOCK_TEST", new CustomItemStack(Material.BRICK, "&5Multiblock Test")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "PISTON_MULTIBLOCK_TEST", CustomItemStack.create(Material.BRICK, "&5Multiblock Test")); // Some Pistons are moving but that should not interefere with the Multiblock MultiBlock multiblock = new MultiBlock(item, new Material[] { Material.PISTON, Material.MOVING_PISTON, Material.PISTON, null, Material.CRAFTING_TABLE, null, Material.PISTON, Material.STONE, Material.PISTON }, BlockFace.DOWN); @@ -106,7 +106,7 @@ void testEqualWithMovingPistons() { @Test @DisplayName("Test different MultiBlocks not being equal") void testNotEqual() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "MULTIBLOCK_TEST", new CustomItemStack(Material.BRICK, "&5Multiblock Test")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "MULTIBLOCK_TEST", CustomItemStack.create(Material.BRICK, "&5Multiblock Test")); MultiBlock multiblock = new MultiBlock(item, new Material[] { Material.BIRCH_WOOD, Material.BIRCH_WOOD, Material.BIRCH_WOOD, null, Material.CRAFTING_TABLE, null, Material.BIRCH_WOOD, Material.DISPENSER, Material.BIRCH_WOOD }, BlockFace.DOWN); MultiBlock multiblock2 = new MultiBlock(item, new Material[] { Material.BIRCH_WOOD, Material.BIRCH_WOOD, Material.BIRCH_WOOD, null, Material.EMERALD_BLOCK, null, Material.BIRCH_WOOD, Material.DISPENSER, Material.BIRCH_WOOD }, BlockFace.DOWN); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/core/researching/TestResearches.java b/src/test/java/io/github/thebusybiscuit/slimefun4/core/researching/TestResearches.java index fd8a5864e1..21bb2b2f3e 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/core/researching/TestResearches.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/core/researching/TestResearches.java @@ -78,7 +78,7 @@ void testResearchCost() { void testResearchRegistration() { NamespacedKey key = new NamespacedKey(plugin, "test_research"); Research research = new Research(key, 1, "Test", 100); - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "RESEARCH_TEST", new CustomItemStack(Material.TORCH, "&bResearch Test")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "RESEARCH_TEST", CustomItemStack.create(Material.TORCH, "&bResearch Test")); research.addItems(item, null); research.register(); @@ -98,7 +98,7 @@ void testResearchRegistration() { void testDisabledResearch() { NamespacedKey key = new NamespacedKey(plugin, "disabled_research"); Research research = new Research(key, 2, "Test", 100); - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "RESEARCH_TEST", new CustomItemStack(Material.TORCH, "&bResearch Test")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "RESEARCH_TEST", CustomItemStack.create(Material.TORCH, "&bResearch Test")); research.addItems(item); Slimefun.getRegistry().setResearchingEnabled(true); @@ -127,7 +127,7 @@ void testResearchGloballyDisabled() { void testAddItems() { NamespacedKey key = new NamespacedKey(plugin, "add_items_to_research"); Research research = new Research(key, 17, "Test", 100); - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "RESEARCH_ITEMS_TEST", new CustomItemStack(Material.LAPIS_LAZULI, "&9Adding items is fun")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "RESEARCH_ITEMS_TEST", CustomItemStack.create(Material.LAPIS_LAZULI, "&9Adding items is fun")); item.register(plugin); research.addItems(item.getItem(), null); @@ -199,7 +199,7 @@ void testPreCanUnlockResearchEvent() throws InterruptedException { SlimefunGuideImplementation guide = Mockito.mock(SlimefunGuideImplementation.class); Player player = server.addPlayer(); PlayerProfile profile = TestUtilities.awaitProfile(player); - SlimefunItem sfItem = TestUtilities.mockSlimefunItem(plugin, "RESEARCH_TEST", new CustomItemStack(Material.TORCH, "&bResearch Test")); + SlimefunItem sfItem = TestUtilities.mockSlimefunItem(plugin, "RESEARCH_TEST", CustomItemStack.create(Material.TORCH, "&bResearch Test")); research.unlockFromGuide(guide, player, profile, sfItem, sfItem.getItemGroup(), 0); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestPermissionsService.java b/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestPermissionsService.java index c5d692ebc4..0c0bf143e3 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestPermissionsService.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/TestPermissionsService.java @@ -44,7 +44,7 @@ public static void unload() { @ValueSource(booleans = { false, true }) void testDefaultPermission(boolean registered) { PermissionsService service = new PermissionsService(plugin); - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "PERMISSIONS_TEST", new CustomItemStack(Material.EMERALD, "&bBad omen")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "PERMISSIONS_TEST", CustomItemStack.create(Material.EMERALD, "&bBad omen")); if (registered) { service.register(Arrays.asList(item), false); @@ -58,7 +58,7 @@ void testDefaultPermission(boolean registered) { @DisplayName("Test if a permission node can be set") void testSetPermission() { PermissionsService service = new PermissionsService(plugin); - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "PERMISSIONS_TEST", new CustomItemStack(Material.EMERALD, "&bBad omen")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "PERMISSIONS_TEST", CustomItemStack.create(Material.EMERALD, "&bBad omen")); Assertions.assertThrows(IllegalArgumentException.class, () -> service.setPermission(null, null)); @@ -80,7 +80,7 @@ void testSetPermission() { void testHasPermissionTrue() { PermissionsService service = new PermissionsService(plugin); Player player = server.addPlayer(); - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "PERMISSIONS_TEST", new CustomItemStack(Material.EMERALD, "&bBad omen")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "PERMISSIONS_TEST", CustomItemStack.create(Material.EMERALD, "&bBad omen")); Assertions.assertTrue(service.hasPermission(player, null)); Assertions.assertTrue(service.hasPermission(player, item)); @@ -94,7 +94,7 @@ void testHasPermissionTrue() { void testHasPermissionFalse() { PermissionsService service = new PermissionsService(plugin); Player player = server.addPlayer(); - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "PERMISSIONS_TEST", new CustomItemStack(Material.EMERALD, "&bBad omen")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "PERMISSIONS_TEST", CustomItemStack.create(Material.EMERALD, "&bBad omen")); service.setPermission(item, "slimefun.tests"); Assertions.assertFalse(service.hasPermission(player, item)); @@ -106,7 +106,7 @@ void testHasPermissionOp() { PermissionsService service = new PermissionsService(plugin); Player player = server.addPlayer(); player.setOp(true); - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "PERMISSIONS_TEST", new CustomItemStack(Material.EMERALD, "&bBad omen")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "PERMISSIONS_TEST", CustomItemStack.create(Material.EMERALD, "&bBad omen")); Permission permission = new Permission("slimefun.unit.tests.op", PermissionDefault.OP); @@ -119,7 +119,7 @@ void testHasPermissionOp() { void testHasPermissionSet() { PermissionsService service = new PermissionsService(plugin); Player player = server.addPlayer(); - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "PERMISSIONS_TEST", new CustomItemStack(Material.EMERALD, "&bBad omen")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "PERMISSIONS_TEST", CustomItemStack.create(Material.EMERALD, "&bBad omen")); String permission = "slimefun.unit.tests.permission"; player.addAttachment(plugin, permission, true); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/TestSlimefunItem.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/TestSlimefunItem.java index 1bd21a0d3f..421a4248f3 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/TestSlimefunItem.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/TestSlimefunItem.java @@ -9,12 +9,9 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.ValueSource; import io.github.bakedlibs.dough.items.CustomItemStack; import io.github.thebusybiscuit.slimefun4.api.exceptions.UnregisteredItemException; -import io.github.thebusybiscuit.slimefun4.api.exceptions.WrongItemStackException; import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem; import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack; import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType; @@ -41,7 +38,7 @@ public static void unload() { @Test @DisplayName("Test wiki pages getting assigned correctly") void testWikiPages() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "WIKI_ITEM", new CustomItemStack(Material.BOOK, "&cTest")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "WIKI_ITEM", CustomItemStack.create(Material.BOOK, "&cTest")); item.register(plugin); Assertions.assertFalse(item.getWikipage().isPresent()); @@ -59,7 +56,7 @@ void testWikiPages() { @Test @DisplayName("Test SlimefunItem registering Recipes properly") void testRecipe() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "RECIPE_TEST", new CustomItemStack(Material.DIAMOND, "&dAnother one bites the test")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "RECIPE_TEST", CustomItemStack.create(Material.DIAMOND, "&dAnother one bites the test")); ItemStack[] recipe = { null, new ItemStack(Material.DIAMOND), null, null, new ItemStack(Material.DIAMOND), null, null, new ItemStack(Material.DIAMOND), null }; item.setRecipe(recipe); @@ -75,7 +72,7 @@ void testRecipe() { @Test @DisplayName("Test Recipe outputs being handled correctly") void testRecipeOutput() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "RECIPE_OUTPUT_TEST", new CustomItemStack(Material.DIAMOND, "&cTest")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "RECIPE_OUTPUT_TEST", CustomItemStack.create(Material.DIAMOND, "&cTest")); item.register(plugin); Assertions.assertEquals(item.getItem(), item.getRecipeOutput()); @@ -91,7 +88,7 @@ void testRecipeOutput() { @Test @DisplayName("Test Recipe Types being handled properly") void testRecipeType() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "RECIPE_TYPE_TEST", new CustomItemStack(Material.DIAMOND, "&cTest")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "RECIPE_TYPE_TEST", CustomItemStack.create(Material.DIAMOND, "&cTest")); item.register(plugin); Assertions.assertNotNull(item.getRecipeType()); @@ -108,46 +105,48 @@ void testRecipeType() { @Test @DisplayName("Test SlimefunItem#isItem(...)") void testIsItem() { - ItemStack item = new CustomItemStack(Material.BEACON, "&cItem Test"); + ItemStack item = CustomItemStack.create(Material.BEACON, "&cItem Test"); String id = "IS_ITEM_TEST"; - SlimefunItem sfItem = TestUtilities.mockSlimefunItem(plugin, id, item); + SlimefunItem sfItem = TestUtilities.mockSlimefunItem(plugin, id, CustomItemStack.create(Material.BEACON, "&cItem Test")); sfItem.register(plugin); Assertions.assertTrue(sfItem.isItem(sfItem.getItem())); Assertions.assertFalse(sfItem.isItem(null)); Assertions.assertFalse(sfItem.isItem(new ItemStack(Material.BEACON))); - Assertions.assertFalse(sfItem.isItem(new CustomItemStack(Material.REDSTONE, "&cTest"))); + Assertions.assertFalse(sfItem.isItem(CustomItemStack.create(Material.REDSTONE, "&cTest"))); Assertions.assertFalse(sfItem.isItem(item)); - Assertions.assertFalse(sfItem.isItem(new CustomItemStack(Material.BEACON, "&cItem Test"))); + Assertions.assertFalse(sfItem.isItem(CustomItemStack.create(Material.BEACON, "&cItem Test"))); Assertions.assertEquals(sfItem, SlimefunItem.getByItem(new SlimefunItemStack(sfItem.getId(), item))); } + @Test - @DisplayName("Test WrongItemStackException") - void testWrongItemStackException() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "WRONG_ITEMSTACK_EXCEPTION", new CustomItemStack(Material.NETHER_STAR, "&4Do not modify me")); + @DisplayName("Test Defensive Item copy") + void testDefensiveItemCopy() { + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "WRONG_ITEMSTACK_EXCEPTION", CustomItemStack.create(Material.NETHER_STAR, "&4Do not modify me")); item.register(plugin); item.load(); ItemStack itemStack = item.getItem(); - Assertions.assertThrows(WrongItemStackException.class, () -> itemStack.setAmount(40)); + itemStack.setAmount(40); + Assertions.assertNotEquals(itemStack, item.getItem()); } @Test @DisplayName("Test UnregisteredItemException") void testUnregisteredItemException() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "UNREGISTERED_ITEM_EXCEPTION", new CustomItemStack(Material.NETHER_STAR, "&4Do not modify me")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "UNREGISTERED_ITEM_EXCEPTION", CustomItemStack.create(Material.NETHER_STAR, "&4Do not modify me")); Assertions.assertThrows(UnregisteredItemException.class, () -> item.getAddon()); } @Test @DisplayName("Test SlimefunItem#equals(...)") void testEquals() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "EQUALS_TEST", new CustomItemStack(Material.LANTERN, "&6We are equal")); - SlimefunItem item2 = TestUtilities.mockSlimefunItem(plugin, "EQUALS_TEST", new CustomItemStack(Material.LANTERN, "&6We are equal")); - SlimefunItem differentItem = TestUtilities.mockSlimefunItem(plugin, "I_AM_DIFFERENT", new CustomItemStack(Material.LANTERN, "&6We are equal")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "EQUALS_TEST", CustomItemStack.create(Material.LANTERN, "&6We are equal")); + SlimefunItem item2 = TestUtilities.mockSlimefunItem(plugin, "EQUALS_TEST", CustomItemStack.create(Material.LANTERN, "&6We are equal")); + SlimefunItem differentItem = TestUtilities.mockSlimefunItem(plugin, "I_AM_DIFFERENT", CustomItemStack.create(Material.LANTERN, "&6We are equal")); Assertions.assertEquals(item, item2); Assertions.assertNotEquals(item, differentItem); @@ -157,9 +156,9 @@ void testEquals() { @Test @DisplayName("Test SlimefunItem#hashCode()") void testHashCode() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "EQUALS_TEST", new CustomItemStack(Material.LANTERN, "&6We are equal")); - SlimefunItem item2 = TestUtilities.mockSlimefunItem(plugin, "EQUALS_TEST", new CustomItemStack(Material.LANTERN, "&6We are equal")); - SlimefunItem differentItem = TestUtilities.mockSlimefunItem(plugin, "I_AM_DIFFERENT", new CustomItemStack(Material.LANTERN, "&6We are equal")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "EQUALS_TEST", CustomItemStack.create(Material.LANTERN, "&6We are equal")); + SlimefunItem item2 = TestUtilities.mockSlimefunItem(plugin, "EQUALS_TEST", CustomItemStack.create(Material.LANTERN, "&6We are equal")); + SlimefunItem differentItem = TestUtilities.mockSlimefunItem(plugin, "I_AM_DIFFERENT", CustomItemStack.create(Material.LANTERN, "&6We are equal")); Assertions.assertEquals(item.hashCode(), item2.hashCode()); Assertions.assertNotEquals(item.hashCode(), differentItem.hashCode()); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/TestAbstractRecipe.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/TestAbstractRecipe.java index 3ff2381f4b..2fa377c86e 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/TestAbstractRecipe.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/TestAbstractRecipe.java @@ -42,7 +42,7 @@ public static void unload() { @DisplayName("Test ShapelessRecipe as AbstractRecipe") void testShapelessRecipe() { NamespacedKey key = new NamespacedKey(plugin, "shapeless_recipe_test"); - ItemStack result = new CustomItemStack(Material.DIAMOND, "&6Special Diamond :o"); + ItemStack result = CustomItemStack.create(Material.DIAMOND, "&6Special Diamond :o"); ShapelessRecipe recipe = new ShapelessRecipe(key, result); recipe.addIngredient(new MaterialChoice(Material.IRON_NUGGET, Material.GOLD_NUGGET)); @@ -59,7 +59,7 @@ void testShapelessRecipe() { @DisplayName("Test ShapedRecipe as AbstractRecipe") void testShapedRecipe() { NamespacedKey key = new NamespacedKey(plugin, "shaped_recipe_test"); - ItemStack result = new CustomItemStack(Material.EMERALD, "&6Special Emerald :o"); + ItemStack result = CustomItemStack.create(Material.EMERALD, "&6Special Emerald :o"); ShapedRecipe recipe = new ShapedRecipe(key, result); recipe.shape("OXO", " X ", "OXO"); @@ -80,7 +80,7 @@ void testShapedRecipe() { @DisplayName("Test invalid recipes as AbstractRecipe") void testInvalidRecipes() { NamespacedKey key = new NamespacedKey(plugin, "furnace_recipe_test"); - ItemStack result = new CustomItemStack(Material.COAL, "&6Special Coal :o"); + ItemStack result = CustomItemStack.create(Material.COAL, "&6Special Coal :o"); FurnaceRecipe recipe = new FurnaceRecipe(key, result, Material.COAL, 1, 1); Assertions.assertNull(AbstractRecipe.of(recipe)); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/TestAutoCrafter.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/TestAutoCrafter.java index ac40d14416..0158b7cb86 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/TestAutoCrafter.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/autocrafters/TestAutoCrafter.java @@ -44,7 +44,7 @@ public static void unload() { @DisplayName("Test crafting a valid ShapelessRecipe") void testValidShapelessRecipe() { NamespacedKey key = new NamespacedKey(plugin, "shapeless_recipe_test"); - ItemStack result = new CustomItemStack(Material.DIAMOND, "&6Special Diamond :o"); + ItemStack result = CustomItemStack.create(Material.DIAMOND, "&6Special Diamond :o"); ShapelessRecipe recipe = new ShapelessRecipe(key, result); recipe.addIngredient(new MaterialChoice(Material.IRON_NUGGET, Material.GOLD_NUGGET)); @@ -71,7 +71,7 @@ void testValidShapelessRecipe() { @DisplayName("Test crafting a valid ShapelessRecipe") void testDisabledRecipe() { NamespacedKey key = new NamespacedKey(plugin, "disabled_recipe_test"); - ItemStack result = new CustomItemStack(Material.DIAMOND, "&bAmazing Diamond :o"); + ItemStack result = CustomItemStack.create(Material.DIAMOND, "&bAmazing Diamond :o"); ShapelessRecipe recipe = new ShapelessRecipe(key, result); recipe.addIngredient(new MaterialChoice(Material.GOLD_NUGGET)); @@ -100,7 +100,7 @@ void testDisabledRecipe() { @DisplayName("Test resource leftovers when crafting") void testResourceLeftovers() { NamespacedKey key = new NamespacedKey(plugin, "resource_leftovers_test"); - ItemStack result = new CustomItemStack(Material.DIAMOND, "&9Diamond. Nuff said."); + ItemStack result = CustomItemStack.create(Material.DIAMOND, "&9Diamond. Nuff said."); ShapelessRecipe recipe = new ShapelessRecipe(key, result); recipe.addIngredient(new MaterialChoice(Material.HONEY_BOTTLE)); recipe.addIngredient(new MaterialChoice(Material.HONEY_BOTTLE)); @@ -123,7 +123,7 @@ void testResourceLeftovers() { @DisplayName("Test crafting an invalid ShapelessRecipe") void testInvalidShapelessRecipe() { NamespacedKey key = new NamespacedKey(plugin, "shapeless_recipe_test"); - ItemStack result = new CustomItemStack(Material.DIAMOND, "&6Special Diamond :o"); + ItemStack result = CustomItemStack.create(Material.DIAMOND, "&6Special Diamond :o"); ShapelessRecipe recipe = new ShapelessRecipe(key, result); recipe.addIngredient(Material.IRON_NUGGET); @@ -142,7 +142,7 @@ void testInvalidShapelessRecipe() { @DisplayName("Test crafting a ShapelessRecipe with a SlimefunItem") void ShapelessRecipeWithSlimefunItem() { NamespacedKey key = new NamespacedKey(plugin, "shapeless_recipe_test"); - ItemStack result = new CustomItemStack(Material.DIAMOND, "&6Special Diamond :o"); + ItemStack result = CustomItemStack.create(Material.DIAMOND, "&6Special Diamond :o"); ShapelessRecipe recipe = new ShapelessRecipe(key, result); recipe.addIngredient(Material.BAMBOO); @@ -151,21 +151,21 @@ void ShapelessRecipeWithSlimefunItem() { InventoryMock inv = new ChestInventoryMock(null, 9); SlimefunItemStack itemStack = new SlimefunItemStack("AUTO_CRAFTER_TEST_ITEM", Material.BAMBOO, "Panda Candy"); - SlimefunItem slimefunItem = TestUtilities.mockSlimefunItem(plugin, itemStack.getItemId(), itemStack); + SlimefunItem slimefunItem = TestUtilities.mockSlimefunItem(plugin, itemStack.getItemId(), itemStack.item()); slimefunItem.register(plugin); - inv.addItem(itemStack.clone()); + inv.addItem(itemStack.item()); // Test unusable SlimefunItem slimefunItem.setUseableInWorkbench(false); Assertions.assertFalse(crafter.craft(inv, abstractRecipe)); - Assertions.assertTrue(inv.containsAtLeast(itemStack, 1)); + Assertions.assertTrue(inv.containsAtLeast(itemStack.item(), 1)); Assertions.assertFalse(inv.containsAtLeast(result, 1)); // Test allowed SlimefunItem slimefunItem.setUseableInWorkbench(true); Assertions.assertTrue(crafter.craft(inv, abstractRecipe)); - Assertions.assertFalse(inv.containsAtLeast(itemStack, 1)); + Assertions.assertFalse(inv.containsAtLeast(itemStack.item(), 1)); Assertions.assertTrue(inv.containsAtLeast(result, 1)); } @@ -173,7 +173,7 @@ void ShapelessRecipeWithSlimefunItem() { @DisplayName("Test crafting with a full Inventory") void testFullInventory() { NamespacedKey key = new NamespacedKey(plugin, "shapeless_recipe_test"); - ItemStack result = new CustomItemStack(Material.DIAMOND, "&6Special Diamond :o"); + ItemStack result = CustomItemStack.create(Material.DIAMOND, "&6Special Diamond :o"); ShapelessRecipe recipe = new ShapelessRecipe(key, result); recipe.addIngredient(Material.IRON_NUGGET); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestAnvilListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestAnvilListener.java index cf57add8ac..52fc8fad5e 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestAnvilListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestAnvilListener.java @@ -62,7 +62,7 @@ void testAnvilWithoutSlimefunItems() { @Test void testAnvilWithSlimefunItem() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "MOCKED_IRON_SWORD", new CustomItemStack(Material.IRON_SWORD, "&6Mock")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "MOCKED_IRON_SWORD", CustomItemStack.create(Material.IRON_SWORD, "&6Mock")); item.register(plugin); InventoryClickEvent event = mockAnvilEvent(item.getItem()); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestBackpackListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestBackpackListener.java index 443d47c3c7..f8e1b299a0 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestBackpackListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestBackpackListener.java @@ -1,10 +1,20 @@ package io.github.thebusybiscuit.slimefun4.implementation.listeners; -import java.util.UUID; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicReference; - +import be.seeseemelk.mockbukkit.MockBukkit; +import be.seeseemelk.mockbukkit.ServerMock; +import be.seeseemelk.mockbukkit.entity.ItemEntityMock; +import io.github.bakedlibs.dough.items.CustomItemStack; +import io.github.thebusybiscuit.slimefun4.api.exceptions.TagMisconfigurationException; +import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup; +import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack; +import io.github.thebusybiscuit.slimefun4.api.player.PlayerBackpack; +import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; +import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType; +import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; +import io.github.thebusybiscuit.slimefun4.implementation.items.backpacks.SlimefunBackpack; +import io.github.thebusybiscuit.slimefun4.test.TestUtilities; +import io.github.thebusybiscuit.slimefun4.test.mocks.InventoryViewWrapper; +import io.github.thebusybiscuit.slimefun4.utils.tags.SlimefunTag; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.NamespacedKey; @@ -26,21 +36,10 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; -import io.github.bakedlibs.dough.items.CustomItemStack; -import io.github.thebusybiscuit.slimefun4.api.exceptions.TagMisconfigurationException; -import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup; -import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack; -import io.github.thebusybiscuit.slimefun4.api.player.PlayerBackpack; -import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile; -import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType; -import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; -import io.github.thebusybiscuit.slimefun4.implementation.items.backpacks.SlimefunBackpack; -import io.github.thebusybiscuit.slimefun4.test.TestUtilities; -import io.github.thebusybiscuit.slimefun4.utils.tags.SlimefunTag; - -import be.seeseemelk.mockbukkit.MockBukkit; -import be.seeseemelk.mockbukkit.ServerMock; -import be.seeseemelk.mockbukkit.entity.ItemEntityMock; +import java.util.UUID; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicReference; class TestBackpackListener { @@ -83,13 +82,13 @@ private PlayerBackpack openMockBackpack(Player player, String id, int size) thro PlayerProfile profile = TestUtilities.awaitProfile(player); PlayerBackpack backpack = profile.createBackpack(size); - listener.setBackpackId(player, item, 2, backpack.getId()); + listener.setBackpackId(player, item.item(), 2, backpack.getId()); - ItemGroup itemGroup = new ItemGroup(new NamespacedKey(plugin, "test_backpacks"), new CustomItemStack(Material.CHEST, "&4Test Backpacks")); + ItemGroup itemGroup = new ItemGroup(new NamespacedKey(plugin, "test_backpacks"), CustomItemStack.create(Material.CHEST, "&4Test Backpacks")); SlimefunBackpack slimefunBackpack = new SlimefunBackpack(size, itemGroup, item, RecipeType.NULL, new ItemStack[9]); slimefunBackpack.register(plugin); - listener.openBackpack(player, item, slimefunBackpack); + listener.openBackpack(player, item.item(), slimefunBackpack); return backpack; } @@ -101,15 +100,15 @@ void testIllegalSetId() { Assertions.assertThrows(IllegalArgumentException.class, () -> listener.setBackpackId(null, null, 1, 1)); Assertions.assertThrows(IllegalArgumentException.class, () -> listener.setBackpackId(player, null, 1, 1)); Assertions.assertThrows(IllegalArgumentException.class, () -> listener.setBackpackId(player, new ItemStack(Material.REDSTONE), 1, 1)); - Assertions.assertThrows(IllegalArgumentException.class, () -> listener.setBackpackId(player, new CustomItemStack(Material.REDSTONE, "Hi", "lore"), 1, 1)); - Assertions.assertThrows(IllegalArgumentException.class, () -> listener.setBackpackId(player, new CustomItemStack(Material.REDSTONE, "Hi", "lore", "no id"), 1, 1)); + Assertions.assertThrows(IllegalArgumentException.class, () -> listener.setBackpackId(player, CustomItemStack.create(Material.REDSTONE, "Hi", "lore"), 1, 1)); + Assertions.assertThrows(IllegalArgumentException.class, () -> listener.setBackpackId(player, CustomItemStack.create(Material.REDSTONE, "Hi", "lore", "no id"), 1, 1)); } @Test @DisplayName("Test if backpack id is properly applied to the lore") void testSetId() throws InterruptedException { Player player = server.addPlayer(); - ItemStack item = new CustomItemStack(Material.CHEST, "&cA mocked Backpack", "", "&7Size: &e" + BACKPACK_SIZE, "&7ID: ", "", "&7&eRight Click&7 to open"); + ItemStack item = CustomItemStack.create(Material.CHEST, "&cA mocked Backpack", "", "&7Size: &e" + BACKPACK_SIZE, "&7ID: ", "", "&7&eRight Click&7 to open"); PlayerProfile profile = TestUtilities.awaitProfile(player); int id = profile.createBackpack(BACKPACK_SIZE).getId(); @@ -122,15 +121,6 @@ void testSetId() throws InterruptedException { Assertions.assertEquals(id, backpack.getId()); } - @Test - @DisplayName("Test backpacks opening to Players") - void testOpenBackpack() throws InterruptedException { - Player player = server.addPlayer(); - PlayerBackpack backpack = openMockBackpack(player, "TEST_OPEN_BACKPACK", 27); - InventoryView view = player.getOpenInventory(); - Assertions.assertEquals(backpack.getInventory(), view.getTopInventory()); - } - @Test @DisplayName("Test backpacks not disturbing normal item dropping") void testBackpackDropNormalItem() throws InterruptedException { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestBeeListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestBeeListener.java index f84dc953bd..fbc563ea6f 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestBeeListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestBeeListener.java @@ -54,9 +54,9 @@ void testBeeDamage(boolean hasArmor) throws InterruptedException { MockBeeProtectionSuit armor = new MockBeeProtectionSuit(itemGroup, chestplate); armor.register(plugin); - player.getInventory().setChestplate(chestplate.clone()); + player.getInventory().setChestplate(chestplate.item()); // Force update the cached armor - profile.getArmor()[1].update(chestplate, armor); + profile.getArmor()[1].update(chestplate.item(), armor); } double damage = 7.5; diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestBrewingStandListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestBrewingStandListener.java index 7a78612680..660656cd07 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestBrewingStandListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestBrewingStandListener.java @@ -67,7 +67,7 @@ void testBrewingWithoutSlimefunItems() { @Test void testBrewingWithSlimefunItem() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "MOCK_POWDER", new CustomItemStack(Material.BLAZE_POWDER, "&6Magic Mock Powder")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "MOCK_POWDER", CustomItemStack.create(Material.BLAZE_POWDER, "&6Magic Mock Powder")); item.register(plugin); InventoryClickEvent event = mockBrewingEvent(item.getItem()); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCargoNodeListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCargoNodeListener.java index 0951dce2ca..721ab21ea2 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCargoNodeListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCargoNodeListener.java @@ -68,11 +68,11 @@ void testInvalidSidePlacement() { Block against = b.getRelative(BlockFace.DOWN); ItemGroup itemGroup = TestUtilities.getItemGroup(plugin, "cargo_test"); - SlimefunItemStack item = new SlimefunItemStack("MOCK_CARGO_NODE", new CustomItemStack(Material.PLAYER_HEAD, "&4Cargo node!")); + SlimefunItemStack item = new SlimefunItemStack("MOCK_CARGO_NODE", CustomItemStack.create(Material.PLAYER_HEAD, "&4Cargo node!")); CargoInputNode node = new CargoInputNode(itemGroup, item, RecipeType.NULL, new ItemStack[9], null); node.register(plugin); - BlockPlaceEvent event = new BlockPlaceEvent(b, b.getState(), against, item, player, true, EquipmentSlot.HAND); + BlockPlaceEvent event = new BlockPlaceEvent(b, b.getState(), against, item.item(), player, true, EquipmentSlot.HAND); listener.onCargoNodePlace(event); Assertions.assertTrue(event.isCancelled()); } @@ -87,11 +87,11 @@ void testGrassPlacement() { b.setType(Material.GRASS_BLOCK); ItemGroup itemGroup = TestUtilities.getItemGroup(plugin, "cargo_test"); - SlimefunItemStack item = new SlimefunItemStack("MOCK_CARGO_NODE_2", new CustomItemStack(Material.PLAYER_HEAD, "&4Cargo node!")); + SlimefunItemStack item = new SlimefunItemStack("MOCK_CARGO_NODE_2", CustomItemStack.create(Material.PLAYER_HEAD, "&4Cargo node!")); CargoInputNode node = new CargoInputNode(itemGroup, item, RecipeType.NULL, new ItemStack[9], null); node.register(plugin); - BlockPlaceEvent event = new BlockPlaceEvent(b, b.getState(), b, item, player, true, EquipmentSlot.HAND); + BlockPlaceEvent event = new BlockPlaceEvent(b, b.getState(), b, item.item(), player, true, EquipmentSlot.HAND); listener.onCargoNodePlace(event); Assertions.assertTrue(event.isCancelled()); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCartographyTableListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCartographyTableListener.java index 892fd5b4ad..b872c45341 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCartographyTableListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCartographyTableListener.java @@ -56,7 +56,7 @@ private InventoryClickEvent mockCartographyTableEvent(ItemStack item) { @Test void testCartographyTableWithSlimefunItem() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "MOCKED_PAPER", new CustomItemStack(Material.PAPER, "&6Mock")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "MOCKED_PAPER", CustomItemStack.create(Material.PAPER, "&6Mock")); item.register(plugin); InventoryClickEvent event = mockCartographyTableEvent(item.getItem()); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCauldronListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCauldronListener.java index fd39063195..c3072d162e 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCauldronListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCauldronListener.java @@ -77,7 +77,7 @@ void testCauldronWithNormalLeatherArmor() { @Test @DisplayName("Test Cauldron working as normal with non-leather slimefun items") void testCauldronWithSlimefunItem() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "CAULDRON_TEST_MOCK", new CustomItemStack(Material.GOLDEN_APPLE, "&6Mock")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "CAULDRON_TEST_MOCK", CustomItemStack.create(Material.GOLDEN_APPLE, "&6Mock")); item.register(plugin); PlayerInteractEvent event = mockCauldronEvent(item.getItem()); @@ -87,7 +87,7 @@ void testCauldronWithSlimefunItem() { @Test @DisplayName("Test Cauldron being cancelled with slimefun leather armor") void testCauldronWithSlimefunLeatherArmor() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "CAULDRON_TEST_MOCK_LEATHER", new CustomItemStack(Material.LEATHER_BOOTS, "&6Mock Leather Armor")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "CAULDRON_TEST_MOCK_LEATHER", CustomItemStack.create(Material.LEATHER_BOOTS, "&6Mock Leather Armor")); item.register(plugin); PlayerInteractEvent event = mockCauldronEvent(item.getItem()); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCoolerListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCoolerListener.java index e606840cbc..2793b76e11 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCoolerListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCoolerListener.java @@ -41,7 +41,7 @@ public static void load() { server = MockBukkit.mock(); Slimefun plugin = MockBukkit.load(Slimefun.class); - ItemGroup itemGroup = new ItemGroup(new NamespacedKey(plugin, "cooler_test"), new CustomItemStack(Material.SNOWBALL, "Mr. Freeze")); + ItemGroup itemGroup = new ItemGroup(new NamespacedKey(plugin, "cooler_test"), CustomItemStack.create(Material.SNOWBALL, "Mr. Freeze")); SlimefunItemStack item = new SlimefunItemStack("TEST_COOLER", Material.SNOWBALL, "&6Test Cooler", "", "&7ID: "); cooler = new Cooler(18, itemGroup, item, RecipeType.NULL, new ItemStack[9]); cooler.register(plugin); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCraftingTableListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCraftingTableListener.java index 5819ad3a32..e78d3f00fd 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCraftingTableListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestCraftingTableListener.java @@ -93,7 +93,7 @@ void testCraftEventWithoutSlimefunItems() { @Test void testCraftEventWithSlimefunItem() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "MOCK_DIAMOND", new CustomItemStack(Material.DIAMOND, "&cMock Diamond")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "MOCK_DIAMOND", CustomItemStack.create(Material.DIAMOND, "&cMock Diamond")); item.register(plugin); CraftItemEvent event = mockCraftingEvent(item.getItem()); @@ -102,7 +102,7 @@ void testCraftEventWithSlimefunItem() { @Test void testCraftEventWithChangingSlimefunItem() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "CHANGING_ITEM", new CustomItemStack(Material.DIAMOND, "&dChanging Diamond")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "CHANGING_ITEM", CustomItemStack.create(Material.DIAMOND, "&dChanging Diamond")); item.register(plugin); item.setUseableInWorkbench(true); @@ -131,7 +131,7 @@ void testPreCraftEventWithoutSlimefunItems() { @Test void testPreCraftEventWithSlimefunItem() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "MOCK_DIAMOND2", new CustomItemStack(Material.DIAMOND, "&cMock Diamond")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "MOCK_DIAMOND2", CustomItemStack.create(Material.DIAMOND, "&cMock Diamond")); item.register(plugin); PrepareItemCraftEvent event = mockPreCraftingEvent(item.getItem()); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestDeathpointListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestDeathpointListener.java index f135535373..c47d93a9d7 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestDeathpointListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestDeathpointListener.java @@ -47,7 +47,7 @@ void testNoTransmitter() throws InterruptedException { void testTransmitter() throws InterruptedException { Player player = server.addPlayer(); TestUtilities.awaitProfile(player); - player.getInventory().setItem(8, SlimefunItems.GPS_EMERGENCY_TRANSMITTER.clone()); + player.getInventory().setItem(8, SlimefunItems.GPS_EMERGENCY_TRANSMITTER.item()); player.setHealth(0); server.getPluginManager().assertEventFired(WaypointCreateEvent.class, event -> event.getPlayer() == player && event.isDeathpoint()); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestGrindstoneListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestGrindstoneListener.java index ff604beb04..fa62fca496 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestGrindstoneListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestGrindstoneListener.java @@ -66,7 +66,7 @@ void testGrindStoneWithoutSlimefunItems() { @Test void testGrindStoneWithSlimefunItem() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "ENCHANTED_MOCK_BOOK", new CustomItemStack(Material.ENCHANTED_BOOK, "&6Mock")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "ENCHANTED_MOCK_BOOK", CustomItemStack.create(Material.ENCHANTED_BOOK, "&6Mock")); item.register(plugin); InventoryClickEvent event = mockGrindStoneEvent(item.getItem()); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestIronGolemListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestIronGolemListener.java index b536f6b00a..2877ee683b 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestIronGolemListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestIronGolemListener.java @@ -78,7 +78,7 @@ void testWithIron() { @Test @DisplayName("Test Iron Golem Healing with Slimefun Items being cancelled") void testWithSlimefunIron() { - SlimefunItem slimefunItem = TestUtilities.mockSlimefunItem(plugin, "SLIMEFUN_IRON", new CustomItemStack(Material.IRON_INGOT, "&cSlimefun Iron")); + SlimefunItem slimefunItem = TestUtilities.mockSlimefunItem(plugin, "SLIMEFUN_IRON", CustomItemStack.create(Material.IRON_INGOT, "&cSlimefun Iron")); slimefunItem.register(plugin); // The Event should be cancelled, we do not wanna use Slimefun Items for this diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestItemPickupListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestItemPickupListener.java index 8af24cd9b0..b5f35bccfa 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestItemPickupListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestItemPickupListener.java @@ -83,9 +83,9 @@ void testAltarProbeForEntities(boolean flag) { ItemStack stack; if (flag) { - stack = new CustomItemStack(Material.DIAMOND, AncientPedestal.ITEM_PREFIX + System.nanoTime()); + stack = CustomItemStack.create(Material.DIAMOND, AncientPedestal.ITEM_PREFIX + System.nanoTime()); } else { - stack = new CustomItemStack(Material.DIAMOND, "&5Just a normal named diamond"); + stack = CustomItemStack.create(Material.DIAMOND, "&5Just a normal named diamond"); } AtomicBoolean removed = new AtomicBoolean(false); @@ -111,9 +111,9 @@ void testAltarProbeForInventories(boolean flag) { ItemStack stack; if (flag) { - stack = new CustomItemStack(Material.DIAMOND, AncientPedestal.ITEM_PREFIX + System.nanoTime()); + stack = CustomItemStack.create(Material.DIAMOND, AncientPedestal.ITEM_PREFIX + System.nanoTime()); } else { - stack = new CustomItemStack(Material.DIAMOND, "&5Just a normal named diamond"); + stack = CustomItemStack.create(Material.DIAMOND, "&5Just a normal named diamond"); } AtomicBoolean removed = new AtomicBoolean(false); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestMultiblockListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestMultiblockListener.java index 55f9a5e5b6..e0420d1645 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestMultiblockListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestMultiblockListener.java @@ -37,7 +37,7 @@ public static void load() { server = MockBukkit.mock(); plugin = MockBukkit.load(Slimefun.class); listener = new MultiBlockListener(plugin); - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "MULTIBLOCK_LISTENER_TEST", new CustomItemStack(Material.DIAMOND, "&9Some multiblock item")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "MULTIBLOCK_LISTENER_TEST", CustomItemStack.create(Material.DIAMOND, "&9Some multiblock item")); multiblock = new MultiBlock(item, new Material[] { null, Material.EMERALD_BLOCK, null, null, Material.DIAMOND_BLOCK, null, null, Material.LAPIS_BLOCK, null }, BlockFace.SELF); Slimefun.getRegistry().getMultiBlocks().add(multiblock); } diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestPiglinListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestPiglinListener.java index d9e2b1fb87..2c912148cf 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestPiglinListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestPiglinListener.java @@ -81,7 +81,7 @@ void testPiglinPickup() { @Test void testPiglinPickupWithSlimefunItem() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "PIGLIN_PICKUP_MOCK", new CustomItemStack(Material.GOLD_INGOT, "&6Piglin Bait")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "PIGLIN_PICKUP_MOCK", CustomItemStack.create(Material.GOLD_INGOT, "&6Piglin Bait")); item.register(plugin); EntityPickupItemEvent event = createPickupEvent(item.getItem()); @@ -100,7 +100,7 @@ void testPiglinInteract(EquipmentSlot hand) { @ParameterizedTest @EnumSource(value = EquipmentSlot.class, names = { "HAND", "OFF_HAND" }) void testPiglinInteractWithSlimefunItem(EquipmentSlot hand) { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "PIGLIN_GIVE_" + hand.name(), new CustomItemStack(Material.GOLD_INGOT, "&6Piglin Bait")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "PIGLIN_GIVE_" + hand.name(), CustomItemStack.create(Material.GOLD_INGOT, "&6Piglin Bait")); item.register(plugin); PlayerInteractEntityEvent event = createInteractEvent(hand, item.getItem()); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestSmithingTableListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestSmithingTableListener.java index 3c57ed5060..4c02f5864b 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestSmithingTableListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestSmithingTableListener.java @@ -46,9 +46,9 @@ public static void load() { Slimefun plugin = MockBukkit.load(Slimefun.class); listener = new SmithingTableListener(plugin); - slimefunTool = TestUtilities.mockSlimefunItem(plugin, "MOCK_DIAMOND_SWORD", new CustomItemStack(Material.DIAMOND_SWORD, "&6Mock")); - slimefunIngot = TestUtilities.mockSlimefunItem(plugin, "MOCK_NETHERITE_INGOT", new CustomItemStack(Material.NETHERITE_INGOT, "&6Mock")); - usableSlimefunIngot = TestUtilities.mockSlimefunItem(plugin, "MOCK_NETHERITE_INGOT_USABLE", new CustomItemStack(Material.NETHERITE_INGOT, "&6Mock")); + slimefunTool = TestUtilities.mockSlimefunItem(plugin, "MOCK_DIAMOND_SWORD", CustomItemStack.create(Material.DIAMOND_SWORD, "&6Mock")); + slimefunIngot = TestUtilities.mockSlimefunItem(plugin, "MOCK_NETHERITE_INGOT", CustomItemStack.create(Material.NETHERITE_INGOT, "&6Mock")); + usableSlimefunIngot = TestUtilities.mockSlimefunItem(plugin, "MOCK_NETHERITE_INGOT_USABLE", CustomItemStack.create(Material.NETHERITE_INGOT, "&6Mock")); usableSlimefunIngot.setUseableInWorkbench(true); vanillaTool = TestUtilities.mockVanillaItem(plugin, Material.DIAMOND_SWORD, true); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestSoulboundListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestSoulboundListener.java index ad0e2fc916..cfe65281ed 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestSoulboundListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestSoulboundListener.java @@ -44,7 +44,7 @@ public static void unload() { @DisplayName("Test if the soulbound item is dropped or not") void testItemDrop(boolean soulbound) { PlayerMock player = server.addPlayer(); - ItemStack item = new CustomItemStack(Material.DIAMOND_SWORD, "&4Cool Sword"); + ItemStack item = CustomItemStack.create(Material.DIAMOND_SWORD, "&4Cool Sword"); SlimefunUtils.setSoulbound(item, soulbound); player.getInventory().setItem(6, item); player.setHealth(0); @@ -68,12 +68,12 @@ void testItemDropIfItemDisabled(boolean enabled) { Slimefun.getWorldSettingsService().setEnabled(player.getWorld(), soulboundItem, false); } - player.getInventory().setItem(0, item); + player.getInventory().setItem(0, item.item()); player.setHealth(0); server.getPluginManager().assertEventFired(EntityDeathEvent.class, event -> { // If the item is enabled, we don't want it to drop. - return enabled == !event.getDrops().contains(item); + return enabled == !event.getDrops().contains(item.item()); }); Slimefun.getRegistry().getEnabledSlimefunItems().remove(soulboundItem); } @@ -83,7 +83,7 @@ void testItemDropIfItemDisabled(boolean enabled) { @DisplayName("Test if soulbound item is returned to player") void testItemRecover(boolean soulbound) { PlayerMock player = server.addPlayer(); - ItemStack item = new CustomItemStack(Material.DIAMOND_SWORD, "&4Cool Sword"); + ItemStack item = CustomItemStack.create(Material.DIAMOND_SWORD, "&4Cool Sword"); SlimefunUtils.setSoulbound(item, soulbound); player.getInventory().setItem(6, item); player.setHealth(0); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestVillagerTradingListener.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestVillagerTradingListener.java index da15c02de0..4dc145ba9c 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestVillagerTradingListener.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/TestVillagerTradingListener.java @@ -68,7 +68,7 @@ void testTradingWithoutSlimefunItems() { @Test void testTradingWithSlimefunItem() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "MOCKED_FAKE_EMERALD", new CustomItemStack(Material.EMERALD, "&aFake Emerald")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "MOCKED_FAKE_EMERALD", CustomItemStack.create(Material.EMERALD, "&aFake Emerald")); item.register(plugin); InventoryClickEvent event = mockClickEvent(item.getItem()); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/registration/TestItemGroups.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/registration/TestItemGroups.java index d290992ff9..bdaa4a1d25 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/registration/TestItemGroups.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/registration/TestItemGroups.java @@ -49,7 +49,7 @@ public static void unload() { @Test @DisplayName("Test the Getters for ItemGroup") void testItemGroupGetters() { - ItemGroup itemGroup = new ItemGroup(new NamespacedKey(plugin, "getter_test"), new CustomItemStack(Material.DIAMOND_AXE, "&6Testing")); + ItemGroup itemGroup = new ItemGroup(new NamespacedKey(plugin, "getter_test"), CustomItemStack.create(Material.DIAMOND_AXE, "&6Testing")); Assertions.assertEquals(3, itemGroup.getTier()); Assertions.assertEquals(new NamespacedKey(Slimefun.instance(), "getter_test"), itemGroup.getKey()); @@ -64,8 +64,8 @@ void testItemGroupGetters() { @Test @DisplayName("Test adding an item to a ItemGroup") void testAddItem() { - ItemGroup itemGroup = new ItemGroup(new NamespacedKey(plugin, "items_test"), new CustomItemStack(Material.DIAMOND_AXE, "&6Testing")); - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "ITEM_GROUPS_TEST_ITEM", new CustomItemStack(Material.BAMBOO, "&6Test Bamboo")); + ItemGroup itemGroup = new ItemGroup(new NamespacedKey(plugin, "items_test"), CustomItemStack.create(Material.DIAMOND_AXE, "&6Testing")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "ITEM_GROUPS_TEST_ITEM", CustomItemStack.create(Material.BAMBOO, "&6Test Bamboo")); item.setItemGroup(itemGroup); item.register(plugin); item.load(); @@ -89,7 +89,7 @@ void testHidden() { // Empty Item Groups are also hidden Assertions.assertFalse(group.isVisible(player)); - SlimefunItem disabledItem = TestUtilities.mockSlimefunItem(plugin, "DISABLED_ITEM_GROUP_ITEM", new CustomItemStack(Material.BEETROOT, "&4Disabled")); + SlimefunItem disabledItem = TestUtilities.mockSlimefunItem(plugin, "DISABLED_ITEM_GROUP_ITEM", CustomItemStack.create(Material.BEETROOT, "&4Disabled")); Slimefun.getItemCfg().setValue("DISABLED_ITEM_GROUP_ITEM.enabled", false); disabledItem.setItemGroup(group); disabledItem.register(plugin); @@ -98,7 +98,7 @@ void testHidden() { // A disabled Item should also make the ItemGroup hide Assertions.assertFalse(group.isVisible(player)); - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "ITEM_GROUP_HIDDEN_TEST", new CustomItemStack(Material.BAMBOO, "&6Test Bamboo")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "ITEM_GROUP_HIDDEN_TEST", CustomItemStack.create(Material.BAMBOO, "&6Test Bamboo")); item.setItemGroup(group); item.setHidden(true); item.register(plugin); @@ -114,7 +114,7 @@ void testHidden() { @Test @DisplayName("Test ItemGroup#contains") void testContains() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "ITEM_GROUP_TEST_ITEM_2", new CustomItemStack(Material.BOW, "&6Test Bow")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "ITEM_GROUP_TEST_ITEM_2", CustomItemStack.create(Material.BOW, "&6Test Bow")); item.register(plugin); item.load(); @@ -130,14 +130,14 @@ void testContains() { @Test @DisplayName("Test LockedItemGroup parental locking") void testLockedItemGroupsParents() { - Assertions.assertThrows(IllegalArgumentException.class, () -> new LockedItemGroup(new NamespacedKey(plugin, "locked"), new CustomItemStack(Material.GOLD_NUGGET, "&6Locked Test"), (NamespacedKey) null)); + Assertions.assertThrows(IllegalArgumentException.class, () -> new LockedItemGroup(new NamespacedKey(plugin, "locked"), CustomItemStack.create(Material.GOLD_NUGGET, "&6Locked Test"), (NamespacedKey) null)); - ItemGroup group = new ItemGroup(new NamespacedKey(plugin, "unlocked"), new CustomItemStack(Material.EMERALD, "&5I am SHERlocked")); + ItemGroup group = new ItemGroup(new NamespacedKey(plugin, "unlocked"), CustomItemStack.create(Material.EMERALD, "&5I am SHERlocked")); group.register(plugin); - ItemGroup unregistered = new ItemGroup(new NamespacedKey(plugin, "unregistered"), new CustomItemStack(Material.EMERALD, "&5I am unregistered")); + ItemGroup unregistered = new ItemGroup(new NamespacedKey(plugin, "unregistered"), CustomItemStack.create(Material.EMERALD, "&5I am unregistered")); - LockedItemGroup locked = new LockedItemGroup(new NamespacedKey(plugin, "locked"), new CustomItemStack(Material.GOLD_NUGGET, "&6Locked Test"), group.getKey(), unregistered.getKey()); + LockedItemGroup locked = new LockedItemGroup(new NamespacedKey(plugin, "locked"), CustomItemStack.create(Material.GOLD_NUGGET, "&6Locked Test"), group.getKey(), unregistered.getKey()); locked.register(plugin); Assertions.assertTrue(locked.getParents().contains(group)); @@ -159,18 +159,18 @@ void testLockedItemGroupsUnlocking() throws InterruptedException { Player player = server.addPlayer(); PlayerProfile profile = TestUtilities.awaitProfile(player); - Assertions.assertThrows(IllegalArgumentException.class, () -> new LockedItemGroup(new NamespacedKey(plugin, "locked"), new CustomItemStack(Material.GOLD_NUGGET, "&6Locked Test"), (NamespacedKey) null)); + Assertions.assertThrows(IllegalArgumentException.class, () -> new LockedItemGroup(new NamespacedKey(plugin, "locked"), CustomItemStack.create(Material.GOLD_NUGGET, "&6Locked Test"), (NamespacedKey) null)); - ItemGroup group = new ItemGroup(new NamespacedKey(plugin, "parent"), new CustomItemStack(Material.EMERALD, "&5I am SHERlocked")); + ItemGroup group = new ItemGroup(new NamespacedKey(plugin, "parent"), CustomItemStack.create(Material.EMERALD, "&5I am SHERlocked")); group.register(plugin); - LockedItemGroup locked = new LockedItemGroup(new NamespacedKey(plugin, "locked2"), new CustomItemStack(Material.GOLD_NUGGET, "&6Locked Test"), group.getKey()); + LockedItemGroup locked = new LockedItemGroup(new NamespacedKey(plugin, "locked2"), CustomItemStack.create(Material.GOLD_NUGGET, "&6Locked Test"), group.getKey()); locked.register(plugin); // No Items, so it should be unlocked Assertions.assertTrue(locked.hasUnlocked(player, profile)); - SlimefunItem item = new SlimefunItem(group, new SlimefunItemStack("LOCKED_ITEMGROUP_TEST", new CustomItemStack(Material.LANTERN, "&6Test Item for locked categories")), RecipeType.NULL, new ItemStack[9]); + SlimefunItem item = new SlimefunItem(group, new SlimefunItemStack("LOCKED_ITEMGROUP_TEST", CustomItemStack.create(Material.LANTERN, "&6Test Item for locked categories")), RecipeType.NULL, new ItemStack[9]); item.register(plugin); item.load(); @@ -192,8 +192,8 @@ void testLockedItemGroupsUnlocking() throws InterruptedException { void ItemGroups() { // ItemGroup with current Month Month month = LocalDate.now().getMonth(); - SeasonalItemGroup group = new SeasonalItemGroup(new NamespacedKey(plugin, "seasonal"), month, 1, new CustomItemStack(Material.NETHER_STAR, "&cSeasonal Test")); - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "SEASONAL_ITEM", new CustomItemStack(Material.NETHER_STAR, "&dSeasonal Test Star")); + SeasonalItemGroup group = new SeasonalItemGroup(new NamespacedKey(plugin, "seasonal"), month, 1, CustomItemStack.create(Material.NETHER_STAR, "&cSeasonal Test")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "SEASONAL_ITEM", CustomItemStack.create(Material.NETHER_STAR, "&dSeasonal Test Star")); item.setItemGroup(group); item.register(plugin); item.load(); @@ -204,14 +204,14 @@ void ItemGroups() { Assertions.assertTrue(group.isVisible(player)); // ItemGroup with future Month - SeasonalItemGroup itemGroup2 = new SeasonalItemGroup(group.getKey(), month.plus(6), 1, new CustomItemStack(Material.MILK_BUCKET, "&dSeasonal Test")); + SeasonalItemGroup itemGroup2 = new SeasonalItemGroup(group.getKey(), month.plus(6), 1, CustomItemStack.create(Material.MILK_BUCKET, "&dSeasonal Test")); Assertions.assertFalse(itemGroup2.isVisible(player)); } @Test @DisplayName("Test the FlexItemGroup") void testFlexItemGroup() { - FlexItemGroup group = new FlexItemGroup(new NamespacedKey(plugin, "flex"), new CustomItemStack(Material.REDSTONE, "&4Weird flex but ok")) { + FlexItemGroup group = new FlexItemGroup(new NamespacedKey(plugin, "flex"), CustomItemStack.create(Material.REDSTONE, "&4Weird flex but ok")) { @Override public void open(Player p, PlayerProfile profile, SlimefunGuideMode layout) { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/registration/TestItemHandlers.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/registration/TestItemHandlers.java index 4df0b505b9..945c1082aa 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/registration/TestItemHandlers.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/registration/TestItemHandlers.java @@ -39,7 +39,7 @@ public static void unload() { @Test @DisplayName("Test validation for Item Handlers") void testIllegalItemHandlers() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "ITEM_HANDLER_TEST", new CustomItemStack(Material.DIAMOND, "&cTest")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "ITEM_HANDLER_TEST", CustomItemStack.create(Material.DIAMOND, "&cTest")); item.register(plugin); Assertions.assertThrows(IllegalArgumentException.class, () -> item.addItemHandler()); @@ -50,7 +50,7 @@ void testIllegalItemHandlers() { @Test @DisplayName("Test calling an ItemHandler") void testItemHandler() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "ITEM_HANDLER_TEST_2", new CustomItemStack(Material.DIAMOND, "&cTest")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "ITEM_HANDLER_TEST_2", CustomItemStack.create(Material.DIAMOND, "&cTest")); MockItemHandler handler = new MockItemHandler(); item.addItemHandler(handler); @@ -72,12 +72,12 @@ void testItemHandler() { @DisplayName("Test validation for BowShootHandler") void testBowShootHandler() { BowShootHandler handler = (e, n) -> {}; - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "NOT_A_BOW", new CustomItemStack(Material.KELP, "&bNot a bow!")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "NOT_A_BOW", CustomItemStack.create(Material.KELP, "&bNot a bow!")); Optional exception = handler.validate(item); Assertions.assertTrue(exception.isPresent()); - SlimefunItem bow = TestUtilities.mockSlimefunItem(plugin, "A_BOW", new CustomItemStack(Material.BOW, "&bA bow!")); + SlimefunItem bow = TestUtilities.mockSlimefunItem(plugin, "A_BOW", CustomItemStack.create(Material.BOW, "&bA bow!")); Optional exception2 = handler.validate(bow); Assertions.assertFalse(exception2.isPresent()); } diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/registration/TestRechargeableItems.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/registration/TestRechargeableItems.java index 59938126f5..9dbde56faf 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/registration/TestRechargeableItems.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/registration/TestRechargeableItems.java @@ -55,7 +55,7 @@ void testInvalidItems() { @Test void testSetItemCharge() { Rechargeable rechargeable = mock("CHARGING_TEST", 10); - ItemStack item = new CustomItemStack(Material.REDSTONE_ORE, "&4Chargeable Item", "", LoreBuilder.powerCharged(0, 10)); + ItemStack item = CustomItemStack.create(Material.REDSTONE_ORE, "&4Chargeable Item", "", LoreBuilder.powerCharged(0, 10)); Assertions.assertEquals(0, rechargeable.getItemCharge(item)); @@ -69,7 +69,7 @@ void testSetItemCharge() { @Test void testItemChargeBounds() { Rechargeable rechargeable = mock("CHARGING_BOUNDS_TEST", 10); - ItemStack item = new CustomItemStack(Material.REDSTONE_BLOCK, "&4Chargeable Item with bounds", "", LoreBuilder.powerCharged(0, 10)); + ItemStack item = CustomItemStack.create(Material.REDSTONE_BLOCK, "&4Chargeable Item with bounds", "", LoreBuilder.powerCharged(0, 10)); Assertions.assertThrows(IllegalArgumentException.class, () -> rechargeable.setItemCharge(item, -1)); Assertions.assertThrows(IllegalArgumentException.class, () -> rechargeable.setItemCharge(item, -0.01F)); @@ -83,7 +83,7 @@ void testItemChargeBounds() { @Test void testAddItemCharge() { Rechargeable rechargeable = mock("CHARGING_BOUNDS_TEST", 10); - ItemStack item = new CustomItemStack(Material.REDSTONE_BLOCK, "&4Chargeable Item with additions", "", LoreBuilder.powerCharged(0, 10)); + ItemStack item = CustomItemStack.create(Material.REDSTONE_BLOCK, "&4Chargeable Item with additions", "", LoreBuilder.powerCharged(0, 10)); Assertions.assertTrue(rechargeable.addItemCharge(item, 10)); Assertions.assertEquals(10, rechargeable.getItemCharge(item)); @@ -94,7 +94,7 @@ void testAddItemCharge() { @Test void testAddItemChargeWithoutLore() { Rechargeable rechargeable = mock("CHARGING_NO_LORE_TEST", 10); - ItemStack item = new CustomItemStack(Material.REDSTONE_BLOCK, "&4Chargeable Item with no lore"); + ItemStack item = CustomItemStack.create(Material.REDSTONE_BLOCK, "&4Chargeable Item with no lore"); Assertions.assertEquals(0, rechargeable.getItemCharge(item)); @@ -108,7 +108,7 @@ void testAddItemChargeWithoutLore() { @Test void testRemoveItemCharge() { Rechargeable rechargeable = mock("CHARGING_BOUNDS_TEST", 10); - ItemStack item = new CustomItemStack(Material.REDSTONE_BLOCK, "&4Chargeable Item with removal", "", LoreBuilder.powerCharged(0, 10)); + ItemStack item = CustomItemStack.create(Material.REDSTONE_BLOCK, "&4Chargeable Item with removal", "", LoreBuilder.powerCharged(0, 10)); Assertions.assertFalse(rechargeable.removeItemCharge(item, 1)); @@ -122,7 +122,7 @@ void testRemoveItemCharge() { private RechargeableMock mock(String id, float capacity) { ItemGroup itemGroup = TestUtilities.getItemGroup(plugin, "rechargeable"); - return new RechargeableMock(itemGroup, new SlimefunItemStack(id, new CustomItemStack(Material.REDSTONE_LAMP, "&3" + id)), capacity); + return new RechargeableMock(itemGroup, new SlimefunItemStack(id, CustomItemStack.create(Material.REDSTONE_LAMP, "&3" + id)), capacity); } private class RechargeableMock extends SlimefunItem implements Rechargeable { diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/registration/TestSlimefunItemRegistration.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/registration/TestSlimefunItemRegistration.java index 1c0d4c24d9..577bbd0318 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/registration/TestSlimefunItemRegistration.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/registration/TestSlimefunItemRegistration.java @@ -38,7 +38,7 @@ public static void unload() { @DisplayName("Test SlimefunItem registering properly") void testSuccessfulRegistration() { String id = "TEST_ITEM"; - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, id, new CustomItemStack(Material.DIAMOND, "&cTest")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, id, CustomItemStack.create(Material.DIAMOND, "&cTest")); Assertions.assertEquals(ItemState.UNREGISTERED, item.getState()); @@ -53,7 +53,7 @@ void testSuccessfulRegistration() { @Test @DisplayName("Test disabled SlimefunItem being disabled") void testDisabledItem() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "DISABLED_ITEM", new CustomItemStack(Material.DIAMOND, "&cTest")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "DISABLED_ITEM", CustomItemStack.create(Material.DIAMOND, "&cTest")); Slimefun.getItemCfg().setValue("DISABLED_ITEM.enabled", false); item.register(plugin); @@ -75,10 +75,10 @@ void testVanillaItemFallback() { @Test @DisplayName("Test id conflicts being handled with an exception") void testIdConflict() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "DUPLICATE_ID", new CustomItemStack(Material.DIAMOND, "&cTest")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "DUPLICATE_ID", CustomItemStack.create(Material.DIAMOND, "&cTest")); item.register(plugin); - SlimefunItem item2 = TestUtilities.mockSlimefunItem(plugin, "DUPLICATE_ID", new CustomItemStack(Material.DIAMOND, "&cTest")); + SlimefunItem item2 = TestUtilities.mockSlimefunItem(plugin, "DUPLICATE_ID", CustomItemStack.create(Material.DIAMOND, "&cTest")); Assertions.assertThrows(IdConflictException.class, () -> item2.register(plugin)); Assertions.assertEquals(ItemState.ENABLED, item.getState()); @@ -88,7 +88,7 @@ void testIdConflict() { @Test @DisplayName("Test ItemGroup registration when registering an item") void testItemGroupRegistration() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "ITEMGROUP_TEST", new CustomItemStack(Material.DIAMOND, "&cTest")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "ITEMGROUP_TEST", CustomItemStack.create(Material.DIAMOND, "&cTest")); item.register(plugin); item.load(); @@ -96,7 +96,7 @@ void testItemGroupRegistration() { Assertions.assertThrows(IllegalArgumentException.class, () -> item.setItemGroup(null)); ItemGroup itemGroup = item.getItemGroup(); - ItemGroup itemGroup2 = new ItemGroup(new NamespacedKey(plugin, "test2"), new CustomItemStack(Material.OBSIDIAN, "&6Test 2")); + ItemGroup itemGroup2 = new ItemGroup(new NamespacedKey(plugin, "test2"), CustomItemStack.create(Material.OBSIDIAN, "&6Test 2")); Assertions.assertTrue(itemGroup.contains(item)); Assertions.assertFalse(itemGroup2.contains(item)); @@ -111,7 +111,7 @@ void testItemGroupRegistration() { @Test @DisplayName("Test hidden items being hidden") void testHiddenItem() { - SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "HIDDEN_TEST", new CustomItemStack(Material.DIAMOND, "&cTest")); + SlimefunItem item = TestUtilities.mockSlimefunItem(plugin, "HIDDEN_TEST", CustomItemStack.create(Material.DIAMOND, "&cTest")); item.setHidden(true); item.register(plugin); item.load(); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/TestArmorTask.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/TestArmorTask.java index 87995a039d..2d53c865fa 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/TestArmorTask.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/TestArmorTask.java @@ -62,7 +62,7 @@ void testSlimefunArmor() throws InterruptedException { SlimefunArmorPiece armor = new SlimefunArmorPiece(TestUtilities.getItemGroup(plugin, "armor_test"), helmet, RecipeType.NULL, new ItemStack[9], effects); armor.register(plugin); - player.getInventory().setHelmet(helmet.clone()); + player.getInventory().setHelmet(helmet.item()); player.getInventory().setChestplate(new ItemStack(Material.DIAMOND_CHESTPLATE)); new ArmorTask(false).run(); @@ -84,7 +84,7 @@ void testRadiactivity(boolean hazmat, boolean radioactiveFire) throws Interrupte SlimefunItemStack item = new SlimefunItemStack("MOCK_URANIUM_" + String.valueOf(hazmat).toUpperCase(Locale.ROOT) + "_" + String.valueOf(radioactiveFire).toUpperCase(Locale.ROOT), Material.EMERALD, "&aHi, I am deadly"); new RadioactiveItem(itemGroup, Radioactivity.VERY_DEADLY, item, RecipeType.NULL, new ItemStack[9]).register(plugin); - player.getInventory().setItemInMainHand(item.clone()); + player.getInventory().setItemInMainHand(item.item()); player.getInventory().setItemInOffHand(new ItemStack(Material.EMERALD_ORE)); if (hazmat) { @@ -92,7 +92,7 @@ void testRadiactivity(boolean hazmat, boolean radioactiveFire) throws Interrupte MockHazmatSuit armor = new MockHazmatSuit(itemGroup, chestplate); armor.register(plugin); - player.getInventory().setChestplate(chestplate.clone()); + player.getInventory().setChestplate(chestplate.item()); } ArmorTask task = new ArmorTask(radioactiveFire); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/storage/backend/TestLegacyBackend.java b/src/test/java/io/github/thebusybiscuit/slimefun4/storage/backend/TestLegacyBackend.java index 98653ee5b7..6fa492b7a0 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/storage/backend/TestLegacyBackend.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/storage/backend/TestLegacyBackend.java @@ -231,7 +231,7 @@ void testSavingBackpacks() throws InterruptedException { PlayerProfile profile = TestUtilities.awaitProfile(player); PlayerBackpack backpack = profile.createBackpack(9); - backpack.getInventory().addItem(SlimefunItems.AIR_RUNE); + backpack.getInventory().addItem(SlimefunItems.AIR_RUNE.item()); // Save the player data LegacyStorage storage = new LegacyStorage(); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/test/TestUtilities.java b/src/test/java/io/github/thebusybiscuit/slimefun4/test/TestUtilities.java index edd6a458af..a46d933d54 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/test/TestUtilities.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/test/TestUtilities.java @@ -57,19 +57,19 @@ private TestUtilities() {} @ParametersAreNonnullByDefault public static @Nonnull ItemGroup getItemGroup(Plugin plugin, String name) { - return new ItemGroup(new NamespacedKey(plugin, name), new CustomItemStack(Material.NETHER_STAR, "&4Test ItemGroup")); + return new ItemGroup(new NamespacedKey(plugin, name), CustomItemStack.create(Material.NETHER_STAR, "&4Test ItemGroup")); } @ParametersAreNonnullByDefault public static @Nonnull SlimefunItem mockSlimefunItem(Plugin plugin, String id, ItemStack item) { - ItemGroup itemGroup = new ItemGroup(new NamespacedKey(plugin, "test"), new CustomItemStack(Material.EMERALD, "&4Test ItemGroup")); + ItemGroup itemGroup = new ItemGroup(new NamespacedKey(plugin, "test"), CustomItemStack.create(Material.EMERALD, "&4Test ItemGroup")); return new MockSlimefunItem(itemGroup, item, id); } @ParametersAreNonnullByDefault public static @Nonnull VanillaItem mockVanillaItem(Plugin plugin, Material type, boolean enabled) { - ItemGroup itemGroup = new ItemGroup(new NamespacedKey(plugin, "test"), new CustomItemStack(Material.EMERALD, "&4Test ItemGroup")); + ItemGroup itemGroup = new ItemGroup(new NamespacedKey(plugin, "test"), CustomItemStack.create(Material.EMERALD, "&4Test ItemGroup")); VanillaItem item = new VanillaItem(itemGroup, new ItemStack(type), type.name(), RecipeType.NULL, new ItemStack[9]); Slimefun.getItemCfg().setValue(type.name() + ".enabled", enabled); return item; @@ -105,7 +105,7 @@ public static World createWorld(ServerMock server) { Slimefun.getRegistry().getWorlds().put(world.getName(), new BlockStorage(world)); return world; } - + public static Block placeSlimefunBlock(ServerMock server, ItemStack item, World world, Player player) { int x = TestUtilities.randomInt(); int z = TestUtilities.randomInt(); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/test/mocks/InventoryViewWrapper.java b/src/test/java/io/github/thebusybiscuit/slimefun4/test/mocks/InventoryViewWrapper.java new file mode 100644 index 0000000000..0b49c5ed0b --- /dev/null +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/test/mocks/InventoryViewWrapper.java @@ -0,0 +1,59 @@ +package io.github.thebusybiscuit.slimefun4.test.mocks; + +import be.seeseemelk.mockbukkit.inventory.InventoryViewMock; +import org.bukkit.entity.HumanEntity; +import org.bukkit.event.inventory.InventoryType; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.InventoryView; +import org.bukkit.inventory.ItemStack; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** + * Temporary class which implements {@link #getItem(int)} and {@link #setItem(int, ItemStack)} + * provided {@link #getInventory(int)} and {@link #convertSlot(int)} are implemented by the backing + * {@link InventoryView} + *

+ * This class should be replaced by MockBukkit when this pr + * is merged. + *
+ * Code is taken directly from CraftBukkit here. + * + * @author md5sha256 + */ +public class InventoryViewWrapper extends InventoryViewMock { + + private InventoryViewWrapper(HumanEntity player, + String name, + Inventory top, + Inventory bottom, + InventoryType type) { + super(player, name, top, bottom, type); + } + + @Nonnull + public static InventoryViewWrapper wrap(@Nonnull InventoryView inventoryView) { + HumanEntity player = inventoryView.getPlayer(); + String name = inventoryView.getTitle(); + Inventory top = inventoryView.getTopInventory(); + Inventory bottom = inventoryView.getBottomInventory(); + InventoryType inventoryType = inventoryView.getType(); + return new InventoryViewWrapper(player, name, top, bottom, inventoryType); + } + + @Override + @Nullable + public ItemStack getItem(int slot) { + Inventory inventory = getInventory(slot); + return (inventory == null) ? null : inventory.getItem(convertSlot(slot)); + } + + @Override + public void setItem(int slot, @Nullable ItemStack item) { + Inventory inventory = getInventory(slot); + if (inventory != null) { + inventory.setItem(convertSlot(slot), item); + } + } +} diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/test/providers/SlimefunItemsProvider.java b/src/test/java/io/github/thebusybiscuit/slimefun4/test/providers/SlimefunItemsProvider.java index eabc146395..3b084dcf3a 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/test/providers/SlimefunItemsProvider.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/test/providers/SlimefunItemsProvider.java @@ -4,6 +4,8 @@ import java.util.Arrays; import java.util.stream.Stream; +import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem; +import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack; import org.bukkit.inventory.ItemStack; import org.junit.jupiter.api.extension.ExtensionContext; import org.junit.jupiter.params.provider.Arguments; @@ -31,7 +33,8 @@ private ItemStack getAsItemStack(String fieldName) { Field field; try { field = clazz.getField(fieldName); - return (ItemStack) field.get(null); + SlimefunItemStack slimefunItem = (SlimefunItemStack) field.get(null); + return slimefunItem.item(); } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) { throw new IllegalArgumentException("Could not find field SlimefunItems." + fieldName); } diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestItemStackWrapper.java b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestItemStackWrapper.java index 510584bbfc..76aaa5b944 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestItemStackWrapper.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestItemStackWrapper.java @@ -35,7 +35,7 @@ public static void unload() { @Test @DisplayName("Test if an ItemStackWrappers can be compared properly (With ItemMeta)") void testEqualityWithItemMeta() { - ItemStack item = new CustomItemStack(Material.LAVA_BUCKET, "&4SuperHot.exe", "", "&6Hello"); + ItemStack item = CustomItemStack.create(Material.LAVA_BUCKET, "&4SuperHot.exe", "", "&6Hello"); ItemStackWrapper wrapper = ItemStackWrapper.wrap(item); Assertions.assertEquals(item.getType(), wrapper.getType()); @@ -59,7 +59,7 @@ void testEqualityWithoutItemMeta() { @Test @DisplayName("Test if an ItemStackWrapper is immutable") void testImmutability() { - ItemStack item = new CustomItemStack(Material.LAVA_BUCKET, "&4SuperHot.exe", "", "&6Hello"); + ItemStack item = CustomItemStack.create(Material.LAVA_BUCKET, "&4SuperHot.exe", "", "&6Hello"); ItemStackWrapper wrapper = ItemStackWrapper.wrap(item); Assertions.assertThrows(UnsupportedOperationException.class, () -> wrapper.setType(Material.BEDROCK)); @@ -76,7 +76,7 @@ void testImmutability() { void testWrapperChecking() { Assertions.assertThrows(IllegalArgumentException.class, () -> ItemStackWrapper.wrap(null)); Assertions.assertThrows(IllegalArgumentException.class, () -> ItemStackWrapper.forceWrap(null)); - ItemStack item = new CustomItemStack(Material.IRON_INGOT, "A Name", "line 1", "line2"); + ItemStack item = CustomItemStack.create(Material.IRON_INGOT, "A Name", "line 1", "line2"); ItemStackWrapper wrapper = ItemStackWrapper.wrap(item); ItemStackWrapper secondWrap = ItemStackWrapper.wrap(wrapper); // We want to check that the wrapper returned is of reference equality @@ -90,7 +90,7 @@ void testWrapperChecking() { @Test @DisplayName("Test wrapping an ItemStack Array") void testWrapArray() { - ItemStack[] items = { new ItemStack(Material.DIAMOND), null, new ItemStack(Material.EMERALD), new CustomItemStack(Material.REDSTONE, "&4Firey thing", "with lore :o") }; + ItemStack[] items = { new ItemStack(Material.DIAMOND), null, new ItemStack(Material.EMERALD), CustomItemStack.create(Material.REDSTONE, "&4Firey thing", "with lore :o") }; ItemStackWrapper[] wrappers = ItemStackWrapper.wrapArray(items); Assertions.assertEquals(items.length, wrappers.length); @@ -111,7 +111,7 @@ void testWrapArray() { @Test @DisplayName("Test wrapping an ItemStack List") void testWrapList() { - List items = Arrays.asList(new ItemStack(Material.DIAMOND), null, new ItemStack(Material.EMERALD), new CustomItemStack(Material.REDSTONE, "&4Firey thing", "with lore :o")); + List items = Arrays.asList(new ItemStack(Material.DIAMOND), null, new ItemStack(Material.EMERALD), CustomItemStack.create(Material.REDSTONE, "&4Firey thing", "with lore :o")); List wrappers = ItemStackWrapper.wrapList(items); Assertions.assertEquals(items.size(), wrappers.size()); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestSoulboundItem.java b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestSoulboundItem.java index 9720494842..391fd6c2e0 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestSoulboundItem.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestSoulboundItem.java @@ -49,7 +49,7 @@ void testNullAndAir() { @Test @DisplayName("Test whether an Item can be marked as soulbound") void testSetSoulbound() { - ItemStack item = new CustomItemStack(Material.DIAMOND, "&cI wanna be soulbound!"); + ItemStack item = CustomItemStack.create(Material.DIAMOND, "&cI wanna be soulbound!"); Assertions.assertFalse(SlimefunUtils.isSoulbound(item)); @@ -65,7 +65,7 @@ void testSetSoulbound() { @Test @DisplayName("Make sure that marking an item as soulbound twice has no effect") void testDoubleCalls() { - ItemStack item = new CustomItemStack(Material.DIAMOND, "&cI wanna be soulbound!"); + ItemStack item = CustomItemStack.create(Material.DIAMOND, "&cI wanna be soulbound!"); SlimefunUtils.setSoulbound(item, true); SlimefunUtils.setSoulbound(item, true); @@ -83,7 +83,7 @@ void testDoubleCalls() { @Test @DisplayName("Test that soulbound Slimefun Items are soulbound") void testSoulboundSlimefunItem() { - SlimefunItem item = new SoulboundMock(new ItemGroup(new NamespacedKey(plugin, "soulbound_itemgroup"), new CustomItemStack(Material.REDSTONE, "&4Walshrus forever"))); + SlimefunItem item = new SoulboundMock(new ItemGroup(new NamespacedKey(plugin, "soulbound_itemgroup"), CustomItemStack.create(Material.REDSTONE, "&4Walshrus forever"))); item.register(plugin); Assertions.assertTrue(SlimefunUtils.isSoulbound(item.getItem())); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/biomes/TestBiomeMapCompatibility.java b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/biomes/TestBiomeMapCompatibility.java index 99f7c6100f..d7ffca7d79 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/biomes/TestBiomeMapCompatibility.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/biomes/TestBiomeMapCompatibility.java @@ -106,7 +106,8 @@ void testCompatibilities(String name, MinecraftVersion version) { MinecraftVersion.MINECRAFT_1_17, MinecraftVersion.MINECRAFT_1_18, MinecraftVersion.MINECRAFT_1_19, - MinecraftVersion.MINECRAFT_1_20 + MinecraftVersion.MINECRAFT_1_20, + MinecraftVersion.MINECRAFT_1_21 }); testCases.put("oil_v1.16", new MinecraftVersion[] { @@ -117,7 +118,8 @@ void testCompatibilities(String name, MinecraftVersion version) { testCases.put("oil_v1.18", new MinecraftVersion[] { MinecraftVersion.MINECRAFT_1_18, MinecraftVersion.MINECRAFT_1_19, - MinecraftVersion.MINECRAFT_1_20 + MinecraftVersion.MINECRAFT_1_20, + MinecraftVersion.MINECRAFT_1_21 }); testCases.put("salt_v1.16", new MinecraftVersion[] { @@ -128,7 +130,8 @@ void testCompatibilities(String name, MinecraftVersion version) { testCases.put("salt_v1.18", new MinecraftVersion[] { MinecraftVersion.MINECRAFT_1_18, MinecraftVersion.MINECRAFT_1_19, - MinecraftVersion.MINECRAFT_1_20 + MinecraftVersion.MINECRAFT_1_20, + MinecraftVersion.MINECRAFT_1_21 }); testCases.put("uranium_v1.16", new MinecraftVersion[] { @@ -142,7 +145,8 @@ void testCompatibilities(String name, MinecraftVersion version) { testCases.put("uranium_v1.18", new MinecraftVersion[] { MinecraftVersion.MINECRAFT_1_18, MinecraftVersion.MINECRAFT_1_19, - MinecraftVersion.MINECRAFT_1_20 + MinecraftVersion.MINECRAFT_1_20, + MinecraftVersion.MINECRAFT_1_21 }); // @formatter:on diff --git a/src/test/resources/biomes/1.20.5+.json b/src/test/resources/biomes/1.20.5+.json index dfe92f1834..d6b3e4ece5 100644 --- a/src/test/resources/biomes/1.20.5+.json +++ b/src/test/resources/biomes/1.20.5+.json @@ -63,5 +63,5 @@ "minecraft:jagged_peaks", "minecraft:stony_peaks", "minecraft:cherry_grove", - "minecraft:custom", + "minecraft:custom" ] \ No newline at end of file diff --git a/src/test/resources/biomes/1.20.x.json b/src/test/resources/biomes/1.20.x.json index dfe92f1834..d6b3e4ece5 100644 --- a/src/test/resources/biomes/1.20.x.json +++ b/src/test/resources/biomes/1.20.x.json @@ -63,5 +63,5 @@ "minecraft:jagged_peaks", "minecraft:stony_peaks", "minecraft:cherry_grove", - "minecraft:custom", + "minecraft:custom" ] \ No newline at end of file diff --git a/src/test/resources/biomes/1.21.x.json b/src/test/resources/biomes/1.21.x.json new file mode 100644 index 0000000000..4a954bbbba --- /dev/null +++ b/src/test/resources/biomes/1.21.x.json @@ -0,0 +1,67 @@ +[ + "minecraft:badlands", + "minecraft:bamboo_jungle", + "minecraft:basalt_deltas", + "minecraft:beach", + "minecraft:birch_forest", + "minecraft:cherry_grove", + "minecraft:cold_ocean", + "minecraft:crimson_forest", + "minecraft:custom", + "minecraft:dark_forest", + "minecraft:deep_cold_ocean", + "minecraft:deep_dark", + "minecraft:deep_frozen_ocean", + "minecraft:deep_lukewarm_ocean", + "minecraft:deep_ocean", + "minecraft:desert", + "minecraft:dripstone_caves", + "minecraft:end_barrens", + "minecraft:end_highlands", + "minecraft:end_midlands", + "minecraft:eroded_badlands", + "minecraft:flower_forest", + "minecraft:forest", + "minecraft:frozen_ocean", + "minecraft:frozen_peaks", + "minecraft:frozen_river", + "minecraft:grove", + "minecraft:ice_spikes", + "minecraft:jagged_peaks", + "minecraft:jungle", + "minecraft:lukewarm_ocean", + "minecraft:lush_caves", + "minecraft:mangrove_swamp", + "minecraft:meadow", + "minecraft:mushroom_fields", + "minecraft:nether_wastes", + "minecraft:ocean", + "minecraft:old_growth_birch_forest", + "minecraft:old_growth_pine_taiga", + "minecraft:old_growth_spruce_taiga", + "minecraft:plains", + "minecraft:river", + "minecraft:savanna", + "minecraft:savanna_plateau", + "minecraft:small_end_islands", + "minecraft:snowy_beach", + "minecraft:snowy_plains", + "minecraft:snowy_slopes", + "minecraft:snowy_taiga", + "minecraft:soul_sand_valley", + "minecraft:sparse_jungle", + "minecraft:stony_peaks", + "minecraft:stony_shore", + "minecraft:sunflower_plains", + "minecraft:swamp", + "minecraft:taiga", + "minecraft:the_end", + "minecraft:the_void", + "minecraft:warm_ocean", + "minecraft:warped_forest", + "minecraft:windswept_forest", + "minecraft:windswept_gravelly_hills", + "minecraft:windswept_hills", + "minecraft:windswept_savanna", + "minecraft:wooded_badlands" +]