diff --git a/.github/workflows/discord-webhook.yml b/.github/workflows/discord-webhook.yml index b424d1c383..18059867f0 100644 --- a/.github/workflows/discord-webhook.yml +++ b/.github/workflows/discord-webhook.yml @@ -23,11 +23,11 @@ jobs: - name: Checkout repository uses: actions/checkout@v4.1.1 - - name: Set up Java JDK 17 + - name: Set up Java JDK 21 uses: actions/setup-java@v4.0.0 with: distribution: 'adopt' - java-version: '17' + java-version: '21' java-package: jdk architecture: x64 diff --git a/.github/workflows/e2e-testing.yml b/.github/workflows/e2e-testing.yml index 351249cbcb..1c77c2c25d 100644 --- a/.github/workflows/e2e-testing.yml +++ b/.github/workflows/e2e-testing.yml @@ -25,8 +25,12 @@ jobs: javaVersion: '18' - mcVersion: '1.19.4' javaVersion: '19' - - mcVersion: 'latest' + - mcVersion: '1.20.4' javaVersion: '20' + - mcVersion: '1.20.6' + javaVersion: '21' + #- mcVersion: 'latest' + # javaVersion: '21' steps: - name: Checkout repository diff --git a/.github/workflows/javadocs.yml b/.github/workflows/javadocs.yml index 6e3d668f6e..7755d9668c 100644 --- a/.github/workflows/javadocs.yml +++ b/.github/workflows/javadocs.yml @@ -18,11 +18,11 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v4.0.0 with: distribution: 'adopt' - java-version: '17' + java-version: '21' java-package: jdk architecture: x64 diff --git a/.github/workflows/maven-compiler.yml b/.github/workflows/maven-compiler.yml index 41f5aff546..e61904358f 100644 --- a/.github/workflows/maven-compiler.yml +++ b/.github/workflows/maven-compiler.yml @@ -27,11 +27,11 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v4.0.0 with: distribution: 'adopt' - java-version: '17' + java-version: '21' java-package: jdk architecture: x64 diff --git a/.github/workflows/publish-build.yml b/.github/workflows/publish-build.yml index 78665c901e..bec223fc56 100644 --- a/.github/workflows/publish-build.yml +++ b/.github/workflows/publish-build.yml @@ -15,11 +15,11 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v3.13.0 with: distribution: 'adopt' - java-version: '17' + java-version: '21' java-package: jdk architecture: x64 diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 904ebb8121..a02a240233 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -21,11 +21,11 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v4.0.0 with: distribution: 'adopt' - java-version: '17' + java-version: '21' java-package: jdk architecture: x64 diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 4d395db640..923db63442 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -23,11 +23,11 @@ jobs: with: fetch-depth: 0 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v4.0.0 with: distribution: 'adopt' - java-version: '17' + java-version: '21' java-package: jdk architecture: x64 diff --git a/pom.xml b/pom.xml index 1cc216d1f4..5bc0d0d651 100644 --- a/pom.xml +++ b/pom.xml @@ -24,9 +24,12 @@ 16 16 + + 21 + 21 - 1.20.4 + 1.20.6 https://hub.spigotmc.org/javadocs/spigot/ @@ -115,7 +118,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.12.1 + 3.13.0 @@ -130,7 +133,7 @@ org.apache.maven.plugins maven-source-plugin - 3.3.0 + 3.3.1 @@ -146,7 +149,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.2.5 + 3.3.1 org.junit.jupiter:junit-jupiter @@ -235,7 +238,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.6.3 + 3.7.0 ${project.basedir} @@ -329,9 +332,19 @@ - - + + + + org.junit + junit-bom + 5.10.3 + pom + import + + + + com.google.code.findbugs @@ -344,7 +357,7 @@ com.github.baked-libs.dough dough-api - baf2d79f62 + f8ff25187d compile @@ -358,7 +371,6 @@ org.junit.jupiter junit-jupiter - 5.10.2 test @@ -375,9 +387,9 @@ - com.github.seeseemelk - MockBukkit-v1.20 - 3.65.0 + com.github.MockBukkit + MockBukkit + c7cc678834 test @@ -387,19 +399,13 @@ org.jetbrains annotations - - io.papermc.paper - paper-api - - - - + io.papermc.paper paper-api - 1.20.4-R0.1-20240205.114523-90 + 1.20.6-R0.1-SNAPSHOT test 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 511df32ec3..4fc0160ac6 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java @@ -10,10 +10,10 @@ /** * This enum holds all versions of Minecraft that we currently support. - * + * * @author TheBusyBiscuit * @author Walshy - * + * * @see Slimefun * */ @@ -47,7 +47,13 @@ public enum MinecraftVersion { * This constant represents Minecraft (Java Edition) Version 1.20 * ("The Trails & Tales Update") */ - MINECRAFT_1_20(20, "1.20.x"), + MINECRAFT_1_20(20, 0, 4, "1.20.x"), + + /** + * This constant represents Minecraft (Java Edition) Version 1.20.5 + * ("The Armored Paws Update") + */ + MINECRAFT_1_20_5(20, 5, "1.20.5+"), /** * This constant represents an exceptional state in which we were unable @@ -64,12 +70,14 @@ public enum MinecraftVersion { private final String name; private final boolean virtual; private final int majorVersion; + private final int minorVersion; + private final int maxMinorVersion; /** * This constructs a new {@link MinecraftVersion} with the given name. * This constructor forces the {@link MinecraftVersion} to be real. * It must be a real version of Minecraft. - * + * * @param majorVersion * The major version of minecraft as an {@link Integer} * @param name @@ -78,6 +86,50 @@ public enum MinecraftVersion { MinecraftVersion(int majorVersion, @Nonnull String name) { this.name = name; this.majorVersion = majorVersion; + this.minorVersion = -1; + this.maxMinorVersion = -1; + this.virtual = false; + } + + /** + * This constructs a new {@link MinecraftVersion} with the given name. + * This constructor forces the {@link MinecraftVersion} to be real. + * It must be a real version of Minecraft. + * + * @param majorVersion + * The major (minor in semver, major in MC land) version of minecraft as an {@link Integer} + * @param minor + * The minor (patch in semver, minor in MC land) version of minecraft as an {@link Integer} + * @param name + * The display name of this {@link MinecraftVersion} + */ + MinecraftVersion(int majorVersion, int minor, @Nonnull String name) { + this.name = name; + this.majorVersion = majorVersion; + this.minorVersion = minor; + this.maxMinorVersion = -1; + this.virtual = false; + } + + /** + * This constructs a new {@link MinecraftVersion} with the given name. + * This constructor forces the {@link MinecraftVersion} to be real. + * It must be a real version of Minecraft. + * + * @param majorVersion + * The major (minor in semver, major in MC land) version of minecraft as an {@link Integer} + * @param minor + * The minor (patch in semver, minor in MC land) version of minecraft as an {@link Integer} + * @param maxMinorVersion + * The maximum minor (patch) version of minecraft this version represents + * @param name + * The display name of this {@link MinecraftVersion} + */ + MinecraftVersion(int majorVersion, int minor, int maxMinorVersion, @Nonnull String name) { + this.name = name; + this.majorVersion = majorVersion; + this.minorVersion = minor; + this.maxMinorVersion = maxMinorVersion; this.virtual = false; } @@ -85,7 +137,7 @@ public enum MinecraftVersion { * This constructs a new {@link MinecraftVersion} with the given name. * A virtual {@link MinecraftVersion} (unknown or unit test) is not an actual * version of Minecraft but rather a state of the {@link Server} software. - * + * * @param name * The display name of this {@link MinecraftVersion} * @param virtual @@ -94,12 +146,14 @@ public enum MinecraftVersion { MinecraftVersion(@Nonnull String name, boolean virtual) { this.name = name; this.majorVersion = 0; + this.minorVersion = -1; + this.maxMinorVersion = -1; this.virtual = virtual; } /** * This returns the name of this {@link MinecraftVersion} in a readable format. - * + * * @return The name of this {@link MinecraftVersion} */ public @Nonnull String getName() { @@ -112,7 +166,7 @@ public enum MinecraftVersion { * a state of the {@link Server} software used. * Virtual {@link MinecraftVersion MinecraftVersions} include "UNKNOWN" and * "UNIT TEST". - * + * * @return Whether this {@link MinecraftVersion} is virtual or not */ public boolean isVirtual() { @@ -127,25 +181,49 @@ public boolean isVirtual() { * It is equivalent to the "major" version *

* Example: {@literal "1.13"} returns {@literal 13} - * + * * @param minecraftVersion * The {@link Integer} version to match - * + * * @return Whether this {@link MinecraftVersion} matches the specified version id */ public boolean isMinecraftVersion(int minecraftVersion) { - return !isVirtual() && this.majorVersion == minecraftVersion; + return this.isMinecraftVersion(minecraftVersion, -1); + } + + /** + * This tests if the given minecraft version matches with this + * {@link MinecraftVersion}. + *

+ * You can obtain the version number by doing {@link PaperLib#getMinecraftVersion()}. + * It is equivalent to the "major" version
+ * You can obtain the patch version by doing {@link PaperLib#getMinecraftPatchVersion()}. + * It is equivalent to the "minor" version + *

+ * Example: {@literal "1.13"} returns {@literal 13}
+ * Example: {@literal "1.13.2"} returns {@literal 13_2} + * + * @param minecraftVersion + * The {@link Integer} version to match + * + * @return Whether this {@link MinecraftVersion} matches the specified version id + */ + public boolean isMinecraftVersion(int minecraftVersion, int patchVersion) { + return !isVirtual() + && this.majorVersion == minecraftVersion + && (this.minorVersion == -1 || this.minorVersion <= patchVersion) + && (this.maxMinorVersion == -1 || patchVersion <= this.maxMinorVersion); } /** * This method checks whether this {@link MinecraftVersion} is newer or equal to * the given {@link MinecraftVersion}, - * + * * An unknown version will default to {@literal false}. - * + * * @param version * The {@link MinecraftVersion} to compare - * + * * @return Whether this {@link MinecraftVersion} is newer or equal to the given {@link MinecraftVersion} */ public boolean isAtLeast(@Nonnull MinecraftVersion version) { @@ -162,7 +240,7 @@ public boolean isAtLeast(@Nonnull MinecraftVersion version) { * this will essentially always return true and result in a tautology. * This is most definitely an oversight from us and should be fixed, therefore * we will trigger an exception. - * + * * In order to not disrupt server operations, this exception is only thrown during * unit tests since the oversight itself will be harmless. */ @@ -175,12 +253,12 @@ public boolean isAtLeast(@Nonnull MinecraftVersion version) { /** * This checks whether this {@link MinecraftVersion} is older than the specified {@link MinecraftVersion}. - * + * * An unknown version will default to {@literal true}. - * + * * @param version * The {@link MinecraftVersion} to compare - * + * * @return Whether this {@link MinecraftVersion} is older than the given one */ public boolean isBefore(@Nonnull MinecraftVersion version) { @@ -193,4 +271,24 @@ public boolean isBefore(@Nonnull MinecraftVersion version) { return version.ordinal() > this.ordinal(); } + /** + * Checks whether this {@link MinecraftVersion} is older than the specified minecraft and patch versions + * @param minecraftVersion The minecraft version + * @param patchVersion The patch version + * @return True if this version is before, False if this version is virtual or otherwise. + */ + public boolean isBefore(int minecraftVersion, int patchVersion) { + // unit tests or whatever + if (isVirtual()) { + return false; + } + + // major version mismatch + if (this.majorVersion != minecraftVersion) { + return this.majorVersion < minecraftVersion; + } + + return this.minorVersion == -1 ? patchVersion > 0 : this.minorVersion < patchVersion; + } + } 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 19646ed4c0..6f65962024 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 @@ -16,7 +16,6 @@ import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; import io.github.bakedlibs.dough.common.ChatColors; import io.github.bakedlibs.dough.items.CustomItemStack; @@ -27,6 +26,7 @@ import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; import io.github.thebusybiscuit.slimefun4.utils.HeadTexture; import io.github.thebusybiscuit.slimefun4.utils.NumberUtils; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedPotionEffectType; import io.papermc.lib.PaperLib; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu; @@ -220,7 +220,7 @@ private void onTeleport(Player p, Location destination, boolean success, boolean if (success) { // Apply Resistance Effect, if enabled if (resistance) { - p.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 600, 20)); + p.addPotionEffect(new PotionEffect(VersionedPotionEffectType.RESISTANCE, 600, 20)); Slimefun.getLocalization().sendMessage(p, "machines.TELEPORTER.invulnerability"); } 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 0f70a46e6e..81b8f331f6 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 @@ -25,6 +25,7 @@ import io.github.thebusybiscuit.slimefun4.api.items.groups.SeasonalItemGroup; import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuide; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedItemFlag; /** * Represents an item group, which structure @@ -85,7 +86,7 @@ public ItemGroup(NamespacedKey key, ItemStack item, int tier) { ItemMeta meta = item.getItemMeta(); meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); meta.addItemFlags(ItemFlag.HIDE_ENCHANTS); - meta.addItemFlags(ItemFlag.HIDE_POTION_EFFECTS); + meta.addItemFlags(VersionedItemFlag.HIDE_ADDITIONAL_TOOLTIP); this.item.setItemMeta(meta); this.tier = tier; } 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 5604cdcfa8..611e85df6d 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 @@ -15,7 +15,6 @@ import org.bukkit.ChatColor; import org.bukkit.Color; import org.bukkit.Material; -import org.bukkit.inventory.ItemFlag; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.inventory.meta.LeatherArmorMeta; @@ -32,6 +31,7 @@ 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; /** * The {@link SlimefunItemStack} functions as the base for any @@ -159,7 +159,7 @@ public SlimefunItemStack(@Nonnull String id, @Nonnull Color color, @Nonnull Poti potionMeta.addCustomEffect(effect, true); if (effect.getType().equals(PotionEffectType.SATURATION)) { - im.addItemFlags(ItemFlag.HIDE_POTION_EFFECTS); + im.addItemFlags(VersionedItemFlag.HIDE_ADDITIONAL_TOOLTIP); } } }); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/network/NetworkVisualizer.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/network/NetworkVisualizer.java index 14ab69c85f..256442972a 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/network/NetworkVisualizer.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/network/NetworkVisualizer.java @@ -5,9 +5,10 @@ import org.apache.commons.lang.Validate; import org.bukkit.Color; import org.bukkit.Location; -import org.bukkit.Particle; import org.bukkit.Particle.DustOptions; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedParticle; + /** * This class represents the visualizer task of a given {@link Network}. * @@ -58,7 +59,7 @@ public void run() { * The {@link Location} of our node */ private void spawnParticles(@Nonnull Location l) { - l.getWorld().spawnParticle(Particle.REDSTONE, l.getX() + 0.5, l.getY() + 0.5, l.getZ() + 0.5, 1, 0, 0, 0, 1, particleOptions); + l.getWorld().spawnParticle(VersionedParticle.DUST, l.getX() + 0.5, l.getY() + 0.5, l.getZ() + 0.5, 1, 0, 0, 0, 1, particleOptions); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/DamageableItem.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/DamageableItem.java index 05694f3e64..74f4a5ef88 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/DamageableItem.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/DamageableItem.java @@ -13,6 +13,7 @@ import io.github.bakedlibs.dough.config.Config; import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem; import io.github.thebusybiscuit.slimefun4.utils.UnbreakingAlgorithm; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedEnchantment; /** * This interface, when attached to a {@link SlimefunItem}, provides an easy method for damaging @@ -51,7 +52,7 @@ public interface DamageableItem extends ItemAttribute { */ default void damageItem(@Nonnull Player p, @Nullable ItemStack item) { if (isDamageable() && item != null && !item.getType().isAir() && item.getAmount() > 0) { - int unbreakingLevel = item.getEnchantmentLevel(Enchantment.DURABILITY); + int unbreakingLevel = item.getEnchantmentLevel(VersionedEnchantment.UNBREAKING); if (evaluateUnbreakingEnchantment(unbreakingLevel)) { return; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/RadiationSymptom.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/RadiationSymptom.java index 2c703de40b..154b48efc4 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/RadiationSymptom.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/attributes/RadiationSymptom.java @@ -10,6 +10,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.utils.RadiationUtils; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedPotionEffectType; /** * An enum of potential radiation symptoms. @@ -25,11 +26,11 @@ */ public enum RadiationSymptom { - SLOW(10, PotionEffectType.SLOW, 3), + SLOW(10, VersionedPotionEffectType.SLOWNESS, 3), WITHER_LOW(25, PotionEffectType.WITHER, 0), BLINDNESS(50, PotionEffectType.BLINDNESS, 4), WITHER_HIGH(75, PotionEffectType.WITHER, 3), - IMMINENT_DEATH(100, PotionEffectType.HARM, 49); + IMMINENT_DEATH(100, VersionedPotionEffectType.INSTANT_DAMAGE, 49); private final int minExposure; private final PotionEffect potionEffect; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/Slimefun.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/Slimefun.java index ae065bc062..1be851ba17 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/Slimefun.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/Slimefun.java @@ -525,11 +525,12 @@ private boolean isVersionUnsupported() { // Now check the actual Version of Minecraft int version = PaperLib.getMinecraftVersion(); + int patchVersion = PaperLib.getMinecraftPatchVersion(); if (version > 0) { // Check all supported versions of Minecraft for (MinecraftVersion supportedVersion : MinecraftVersion.values()) { - if (supportedVersion.isMinecraftVersion(version)) { + if (supportedVersion.isMinecraftVersion(version, patchVersion)) { minecraftVersion = supportedVersion; return false; } 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 8695759316..d3adb16e0b 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java @@ -22,6 +22,7 @@ import io.github.thebusybiscuit.slimefun4.utils.ChatUtils; import io.github.thebusybiscuit.slimefun4.utils.HeadTexture; import io.github.thebusybiscuit.slimefun4.utils.LoreBuilder; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedEnchantment; import io.github.thebusybiscuit.slimefun4.utils.itemstack.ColoredFireworkStar; /** @@ -192,8 +193,8 @@ private SlimefunItems() {} GRANDPAS_WALKING_STICK.addUnsafeEnchantment(Enchantment.KNOCKBACK, 5); BLADE_OF_VAMPIRES.addUnsafeEnchantment(Enchantment.FIRE_ASPECT, 2); - BLADE_OF_VAMPIRES.addUnsafeEnchantment(Enchantment.DURABILITY, 4); - BLADE_OF_VAMPIRES.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, 2); + BLADE_OF_VAMPIRES.addUnsafeEnchantment(VersionedEnchantment.UNBREAKING, 4); + BLADE_OF_VAMPIRES.addUnsafeEnchantment(VersionedEnchantment.SHARPNESS, 2); } /* Bows */ @@ -212,8 +213,8 @@ private SlimefunItems() {} public static final SlimefunItemStack CLIMBING_PICK = new SlimefunItemStack("CLIMBING_PICK", Material.IRON_PICKAXE, "&bClimbing Pick", "", "&fAllows you to climb certain surfaces", "&fby right-clicking.", "&fEnchant this pick with Efficiency to", "&fclimb even faster!"); static { - COBALT_PICKAXE.addUnsafeEnchantment(Enchantment.DURABILITY, 10); - COBALT_PICKAXE.addUnsafeEnchantment(Enchantment.DIG_SPEED, 6); + COBALT_PICKAXE.addUnsafeEnchantment(VersionedEnchantment.UNBREAKING, 10); + COBALT_PICKAXE.addUnsafeEnchantment(VersionedEnchantment.EFFICIENCY, 6); } /* Armor */ @@ -304,7 +305,7 @@ private SlimefunItems() {} static { Map cactusEnchs = new HashMap<>(); cactusEnchs.put(Enchantment.THORNS, 3); - cactusEnchs.put(Enchantment.DURABILITY, 6); + cactusEnchs.put(VersionedEnchantment.UNBREAKING, 6); CACTUS_HELMET.addUnsafeEnchantments(cactusEnchs); CACTUS_CHESTPLATE.addUnsafeEnchantments(cactusEnchs); @@ -312,8 +313,8 @@ private SlimefunItems() {} CACTUS_BOOTS.addUnsafeEnchantments(cactusEnchs); Map damascusEnchs = new HashMap<>(); - damascusEnchs.put(Enchantment.DURABILITY, 5); - damascusEnchs.put(Enchantment.PROTECTION_ENVIRONMENTAL, 5); + damascusEnchs.put(VersionedEnchantment.UNBREAKING, 5); + damascusEnchs.put(VersionedEnchantment.PROTECTION, 5); DAMASCUS_STEEL_HELMET.addUnsafeEnchantments(damascusEnchs); DAMASCUS_STEEL_CHESTPLATE.addUnsafeEnchantments(damascusEnchs); @@ -321,8 +322,8 @@ private SlimefunItems() {} DAMASCUS_STEEL_BOOTS.addUnsafeEnchantments(damascusEnchs); Map reinforcedEnchs = new HashMap<>(); - reinforcedEnchs.put(Enchantment.DURABILITY, 9); - reinforcedEnchs.put(Enchantment.PROTECTION_ENVIRONMENTAL, 9); + reinforcedEnchs.put(VersionedEnchantment.UNBREAKING, 9); + reinforcedEnchs.put(VersionedEnchantment.PROTECTION, 9); REINFORCED_ALLOY_HELMET.addUnsafeEnchantments(reinforcedEnchs); REINFORCED_ALLOY_CHESTPLATE.addUnsafeEnchantments(reinforcedEnchs); @@ -330,22 +331,22 @@ private SlimefunItems() {} REINFORCED_ALLOY_BOOTS.addUnsafeEnchantments(reinforcedEnchs); Map gildedEnchs = new HashMap<>(); - gildedEnchs.put(Enchantment.DURABILITY, 6); - gildedEnchs.put(Enchantment.PROTECTION_ENVIRONMENTAL, 8); + gildedEnchs.put(VersionedEnchantment.UNBREAKING, 6); + gildedEnchs.put(VersionedEnchantment.PROTECTION, 8); GILDED_IRON_HELMET.addUnsafeEnchantments(gildedEnchs); GILDED_IRON_CHESTPLATE.addUnsafeEnchantments(gildedEnchs); GILDED_IRON_LEGGINGS.addUnsafeEnchantments(gildedEnchs); GILDED_IRON_BOOTS.addUnsafeEnchantments(gildedEnchs); - GOLDEN_HELMET_12K.addUnsafeEnchantment(Enchantment.DURABILITY, 10); - GOLDEN_CHESTPLATE_12K.addUnsafeEnchantment(Enchantment.DURABILITY, 10); - GOLDEN_LEGGINGS_12K.addUnsafeEnchantment(Enchantment.DURABILITY, 10); - GOLDEN_BOOTS_12K.addUnsafeEnchantment(Enchantment.DURABILITY, 10); + GOLDEN_HELMET_12K.addUnsafeEnchantment(VersionedEnchantment.UNBREAKING, 10); + GOLDEN_CHESTPLATE_12K.addUnsafeEnchantment(VersionedEnchantment.UNBREAKING, 10); + GOLDEN_LEGGINGS_12K.addUnsafeEnchantment(VersionedEnchantment.UNBREAKING, 10); + GOLDEN_BOOTS_12K.addUnsafeEnchantment(VersionedEnchantment.UNBREAKING, 10); Map slimeEnchs = new HashMap<>(); - slimeEnchs.put(Enchantment.DURABILITY, 4); - slimeEnchs.put(Enchantment.PROTECTION_ENVIRONMENTAL, 2); + slimeEnchs.put(VersionedEnchantment.UNBREAKING, 4); + slimeEnchs.put(VersionedEnchantment.PROTECTION, 2); SLIME_HELMET_STEEL.addUnsafeEnchantments(slimeEnchs); SLIME_CHESTPLATE_STEEL.addUnsafeEnchantments(slimeEnchs); @@ -353,8 +354,8 @@ private SlimefunItems() {} SLIME_BOOTS_STEEL.addUnsafeEnchantments(slimeEnchs); Map beeEnchs = new HashMap<>(); - beeEnchs.put(Enchantment.DURABILITY, 4); - beeEnchs.put(Enchantment.PROTECTION_ENVIRONMENTAL, 2); + beeEnchs.put(VersionedEnchantment.UNBREAKING, 4); + beeEnchs.put(VersionedEnchantment.PROTECTION, 2); BEE_HELMET.addUnsafeEnchantments(beeEnchs); BEE_WINGS.addUnsafeEnchantments(beeEnchs); @@ -567,10 +568,10 @@ private SlimefunItems() {} public static final SlimefunItemStack STAFF_STORM = new SlimefunItemStack("STAFF_ELEMENTAL_STORM", Material.STICK, "&6Elemental Staff &7- &8&oStorm", "", "&7Element: &8&oStorm", "", "&eRight Click&7 to summon a lightning", LoreBuilder.usesLeft(StormStaff.MAX_USES)); static { - STAFF_WIND.addUnsafeEnchantment(Enchantment.LUCK, 1); + STAFF_WIND.addUnsafeEnchantment(VersionedEnchantment.LUCK_OF_THE_SEA, 1); STAFF_FIRE.addUnsafeEnchantment(Enchantment.FIRE_ASPECT, 5); - STAFF_WATER.addUnsafeEnchantment(Enchantment.WATER_WORKER, 1); - STAFF_STORM.addUnsafeEnchantment(Enchantment.DURABILITY, 1); + STAFF_WATER.addUnsafeEnchantment(VersionedEnchantment.AQUA_AFFINITY, 1); + STAFF_STORM.addUnsafeEnchantment(VersionedEnchantment.UNBREAKING, 1); } /* Multiblocks */ 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 154150d979..83e43be65f 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 @@ -48,6 +48,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.tasks.AsyncRecipeChoiceTask; import io.github.thebusybiscuit.slimefun4.utils.ChatUtils; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedItemFlag; import io.github.thebusybiscuit.slimefun4.utils.itemstack.SlimefunGuideItem; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu; @@ -360,7 +361,7 @@ public void openSearch(PlayerProfile profile, String input, boolean addToHistory ItemStack itemstack = new CustomItemStack(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, ItemFlag.HIDE_POTION_EFFECTS); + meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES, ItemFlag.HIDE_ENCHANTS, VersionedItemFlag.HIDE_ADDITIONAL_TOOLTIP); }); menu.addItem(index, itemstack); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/MinerAndroid.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/MinerAndroid.java index be397c5055..8d041bafb5 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/MinerAndroid.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/androids/MinerAndroid.java @@ -10,7 +10,6 @@ import org.bukkit.Effect; import org.bukkit.Material; import org.bukkit.OfflinePlayer; -import org.bukkit.Particle; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; import org.bukkit.inventory.ItemStack; @@ -24,6 +23,7 @@ import io.github.thebusybiscuit.slimefun4.core.services.sounds.SoundEffect; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.utils.InfiniteBlockGenerator; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedParticle; import io.github.thebusybiscuit.slimefun4.utils.tags.SlimefunTag; import me.mrCookieSlime.Slimefun.api.BlockStorage; @@ -149,7 +149,7 @@ private void breakBlock(BlockMenu menu, Collection drops, Block block // "poof" a "new" block was generated SoundEffect.MINER_ANDROID_BLOCK_GENERATION_SOUND.playAt(block); - block.getWorld().spawnParticle(Particle.SMOKE_NORMAL, block.getX() + 0.5, block.getY() + 1.25, block.getZ() + 0.5, 8, 0.5, 0.5, 0.5, 0.015); + block.getWorld().spawnParticle(VersionedParticle.SMOKE, block.getX() + 0.5, block.getY() + 1.25, block.getZ() + 0.5, 8, 0.5, 0.5, 0.5, 0.015); } else { block.setType(Material.AIR); } 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 380c7a1273..b75d3c6643 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 @@ -14,7 +14,6 @@ import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.NamespacedKey; -import org.bukkit.Particle; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; import org.bukkit.block.BlockState; @@ -41,6 +40,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.tasks.AsyncRecipeChoiceTask; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; import io.github.thebusybiscuit.slimefun4.utils.HeadTexture; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedParticle; import io.github.thebusybiscuit.slimefun4.utils.tags.SlimefunTag; import io.papermc.lib.PaperLib; import io.papermc.lib.features.blockstatesnapshot.BlockStateSnapshotResult; @@ -180,7 +180,7 @@ protected void tick(@Nonnull Block b, @Nonnull Config data) { if (craft(inv, recipe)) { // We are done crafting! Location loc = b.getLocation().add(0.5, 0.8, 0.5); - b.getWorld().spawnParticle(Particle.VILLAGER_HAPPY, loc, 6); + b.getWorld().spawnParticle(VersionedParticle.HAPPY_VILLAGER, loc, 6); removeCharge(b.getLocation(), getEnergyConsumption()); } } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/Crucible.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/Crucible.java index 2e0d31b489..f11e7a35ad 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/Crucible.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/blocks/Crucible.java @@ -8,7 +8,6 @@ import javax.annotation.ParametersAreNonnullByDefault; import org.bukkit.Material; -import org.bukkit.Particle; import org.bukkit.Tag; import org.bukkit.World.Environment; import org.bukkit.block.Block; @@ -30,6 +29,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedParticle; import io.github.thebusybiscuit.slimefun4.utils.tags.SlimefunTag; import me.mrCookieSlime.Slimefun.api.BlockStorage; @@ -165,7 +165,7 @@ private void generateLiquid(@Nonnull Block block, boolean isWater) { // Fixes #2877 - If water in the nether is disabled, abort and play an effect. if (isWater && block.getWorld().getEnvironment() == Environment.NETHER && !allowWaterInNether.getValue()) { // We will still consume the items but won't generate water in the Nether. - block.getWorld().spawnParticle(Particle.SMOKE_NORMAL, block.getLocation().add(0.5, 0.5, 0.5), 4); + block.getWorld().spawnParticle(VersionedParticle.SMOKE, block.getLocation().add(0.5, 0.5, 0.5), 4); SoundEffect.CRUCIBLE_GENERATE_LIQUID_SOUND.playAt(block); return; } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/MultiTool.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/MultiTool.java index 8f943f5866..d608742da4 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/MultiTool.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/gadgets/MultiTool.java @@ -11,6 +11,7 @@ import io.github.bakedlibs.dough.data.persistent.PersistentDataAPI; import org.bukkit.ChatColor; import org.bukkit.NamespacedKey; +import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; @@ -24,6 +25,7 @@ import io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler; import io.github.thebusybiscuit.slimefun4.core.handlers.ToolUseHandler; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedEntityType; /** * The {@link MultiTool} is an electric device which can mimic @@ -132,15 +134,13 @@ private ToolUseHandler getToolUseHandler() { private EntityInteractHandler getEntityInteractionHandler() { return (e, item, offhand) -> { // Fixes #2217 - Prevent them from being used to shear entities - switch (e.getRightClicked().getType()) { - case MUSHROOM_COW: - case SHEEP: - case SNOWMAN: - Slimefun.getLocalization().sendMessage(e.getPlayer(), "messages.multi-tool.not-shears"); - e.setCancelled(true); - break; - default: - break; + EntityType type = e.getRightClicked().getType(); + if (type == VersionedEntityType.MOOSHROOM + || type == VersionedEntityType.SNOW_GOLEM + || type == EntityType.SHEEP + ) { + Slimefun.getLocalization().sendMessage(e.getPlayer(), "messages.multi-tool.not-shears"); + e.setCancelled(true); } }; } 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 f00676edd6..962bc2d32f 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 @@ -7,6 +7,7 @@ import javax.annotation.Nullable; import javax.annotation.ParametersAreNonnullByDefault; +import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.PotionMeta; @@ -18,7 +19,7 @@ import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack; import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType; import io.github.thebusybiscuit.slimefun4.core.attributes.NotHopperable; - +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedPotionType; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.AContainer; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.MachineRecipe; import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu; @@ -36,22 +37,22 @@ public class AutoBrewer extends AContainer implements NotHopperable { private static final Map fermentations = new EnumMap<>(PotionType.class); static { - potionRecipes.put(Material.SUGAR, PotionType.SPEED); - potionRecipes.put(Material.RABBIT_FOOT, PotionType.JUMP); + potionRecipes.put(Material.SUGAR, VersionedPotionType.SWIFTNESS); + potionRecipes.put(Material.RABBIT_FOOT, VersionedPotionType.LEAPING); potionRecipes.put(Material.BLAZE_POWDER, PotionType.STRENGTH); - potionRecipes.put(Material.GLISTERING_MELON_SLICE, PotionType.INSTANT_HEAL); + potionRecipes.put(Material.GLISTERING_MELON_SLICE, VersionedPotionType.HEALING); potionRecipes.put(Material.SPIDER_EYE, PotionType.POISON); - potionRecipes.put(Material.GHAST_TEAR, PotionType.REGEN); + potionRecipes.put(Material.GHAST_TEAR, VersionedPotionType.REGENERATION); potionRecipes.put(Material.MAGMA_CREAM, PotionType.FIRE_RESISTANCE); potionRecipes.put(Material.PUFFERFISH, PotionType.WATER_BREATHING); potionRecipes.put(Material.GOLDEN_CARROT, PotionType.NIGHT_VISION); potionRecipes.put(Material.TURTLE_HELMET, PotionType.TURTLE_MASTER); potionRecipes.put(Material.PHANTOM_MEMBRANE, PotionType.SLOW_FALLING); - fermentations.put(PotionType.SPEED, PotionType.SLOWNESS); - fermentations.put(PotionType.JUMP, PotionType.SLOWNESS); - fermentations.put(PotionType.INSTANT_HEAL, PotionType.INSTANT_DAMAGE); - fermentations.put(PotionType.POISON, PotionType.INSTANT_DAMAGE); + fermentations.put(VersionedPotionType.SWIFTNESS, PotionType.SLOWNESS); + fermentations.put(VersionedPotionType.LEAPING, PotionType.SLOWNESS); + fermentations.put(VersionedPotionType.HEALING, VersionedPotionType.HARMING); + fermentations.put(PotionType.POISON, VersionedPotionType.HARMING); fermentations.put(PotionType.NIGHT_VISION, PotionType.INVISIBILITY); } @@ -104,8 +105,53 @@ public AutoBrewer(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipe @ParametersAreNonnullByDefault private @Nullable ItemStack brew(Material input, Material potionType, PotionMeta potion) { - PotionData data = potion.getBasePotionData(); + if (Slimefun.getMinecraftVersion().isBefore(20,2)) { + return brewPreBasePotionType(input, potionType, potion); + } + PotionType type = potion.getBasePotionType(); + if (type == PotionType.WATER) { + if (input == Material.FERMENTED_SPIDER_EYE) { + potion.setBasePotionType(PotionType.WEAKNESS); + return new ItemStack(potionType); + } else if (input == Material.NETHER_WART) { + potion.setBasePotionType(PotionType.AWKWARD); + return new ItemStack(potionType); + } else if (potionType == Material.POTION && input == Material.GUNPOWDER) { + return new ItemStack(Material.SPLASH_POTION); + } else if (potionType == Material.SPLASH_POTION && input == Material.DRAGON_BREATH) { + return new ItemStack(Material.LINGERING_POTION); + } + } else if (input == Material.FERMENTED_SPIDER_EYE) { + PotionType fermented = fermentations.get(type); + + if (fermented != null) { + potion.setBasePotionType(fermented); + return new ItemStack(potionType); + } + } else if (input == Material.REDSTONE && type.isExtendable() && !type.isUpgradeable()) { + // Fixes #3390 - Potions can only be either extended or upgraded. Not both. + potion.setBasePotionType(type); + return new ItemStack(potionType); + } else if (input == Material.GLOWSTONE_DUST && type.isUpgradeable() && !type.isExtendable()) { + // Fixes #3390 - Potions can only be either extended or upgraded. Not both. + potion.setBasePotionType(type); + return new ItemStack(potionType); + } else if (type == PotionType.AWKWARD) { + PotionType potionRecipe = potionRecipes.get(input); + + if (potionRecipe != null) { + potion.setBasePotionType(potionRecipe); + return new ItemStack(potionType); + } + } + return null; + } + + @ParametersAreNonnullByDefault + @SuppressWarnings("deprecration") + private ItemStack brewPreBasePotionType(Material input, Material potionType, PotionMeta potion) { + PotionData data = potion.getBasePotionData(); PotionType type = data.getType(); if (type == PotionType.WATER) { if (input == Material.FERMENTED_SPIDER_EYE) { @@ -142,16 +188,15 @@ public AutoBrewer(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipe return new ItemStack(potionType); } } - return null; } /** * Checks whether a given {@link Material} is a valid Potion material. - * + * * @param mat * The {@link Material} to check - * + * * @return Whether this {@link Material} is a valid potion */ private boolean isPotion(@Nonnull Material mat) { diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/FluidPump.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/FluidPump.java index 4aef413ea9..729fd2ff51 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/FluidPump.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/FluidPump.java @@ -7,6 +7,7 @@ import javax.annotation.Nullable; import javax.annotation.ParametersAreNonnullByDefault; +import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import org.bukkit.Material; import org.bukkit.World; import org.bukkit.block.Block; @@ -203,7 +204,11 @@ private Block findNextFluid(@Nonnull Block fluid) { case BUBBLE_COLUMN: ItemStack waterBottle = new ItemStack(Material.POTION); PotionMeta meta = (PotionMeta) waterBottle.getItemMeta(); - meta.setBasePotionData(new PotionData(PotionType.WATER)); + if (Slimefun.getMinecraftVersion().isBefore(20, 2)) { + meta.setBasePotionData(new PotionData(PotionType.WATER)); + } else { + meta.setBasePotionType(PotionType.WATER); + } waterBottle.setItemMeta(meta); return waterBottle; default: @@ -224,10 +229,10 @@ private Block findNextFluid(@Nonnull Block fluid) { /** * This method checks if the given {@link Block} is a liquid source {@link Block}. - * + * * @param block * The {@link Block} in question - * + * * @return Whether that {@link Block} is a liquid and a source {@link Block}. */ private boolean isSource(@Nonnull Block block) { 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 68a570f8a5..1da903c425 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 @@ -1,6 +1,5 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.electric.machines.accelerators; -import org.bukkit.Particle; import org.bukkit.block.Block; import org.bukkit.entity.Ageable; import org.bukkit.entity.Entity; @@ -12,6 +11,7 @@ import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedParticle; import io.github.thebusybiscuit.slimefun4.utils.itemstack.ItemStackWrapper; import me.mrCookieSlime.Slimefun.api.BlockStorage; @@ -54,7 +54,7 @@ protected void tick(Block b) { ageable.setAge(0); } - n.getWorld().spawnParticle(Particle.VILLAGER_HAPPY, ((LivingEntity) n).getEyeLocation(), 8, 0.2F, 0.2F, 0.2F); + n.getWorld().spawnParticle(VersionedParticle.HAPPY_VILLAGER, ((LivingEntity) n).getEyeLocation(), 8, 0.2F, 0.2F, 0.2F); return; } } 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 5649c70c73..5cf09b31f9 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 @@ -1,6 +1,5 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.electric.machines.accelerators; -import org.bukkit.Particle; import org.bukkit.block.Block; import org.bukkit.block.data.Ageable; import org.bukkit.inventory.ItemStack; @@ -10,6 +9,7 @@ import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedParticle; import io.github.thebusybiscuit.slimefun4.utils.itemstack.ItemStackWrapper; import io.github.thebusybiscuit.slimefun4.utils.tags.SlimefunTag; @@ -65,7 +65,7 @@ private boolean grow(Block machine, BlockMenu inv, Block crop) { ageable.setAge(ageable.getAge() + 1); crop.setBlockData(ageable); - crop.getWorld().spawnParticle(Particle.VILLAGER_HAPPY, crop.getLocation().add(0.5D, 0.5D, 0.5D), 4, 0.1F, 0.1F, 0.1F); + crop.getWorld().spawnParticle(VersionedParticle.HAPPY_VILLAGER, crop.getLocation().add(0.5D, 0.5D, 0.5D), 4, 0.1F, 0.1F, 0.1F); return true; } } 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 e6e79311db..a9332d777e 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 @@ -4,7 +4,6 @@ import javax.annotation.Nullable; import javax.annotation.ParametersAreNonnullByDefault; -import org.bukkit.Particle; import org.bukkit.Tag; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; @@ -18,6 +17,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedParticle; import io.github.thebusybiscuit.slimefun4.utils.itemstack.ItemStackWrapper; import me.mrCookieSlime.Slimefun.api.BlockStorage; @@ -93,7 +93,7 @@ private boolean applyBoneMeal(Block machine, Block sapling, BlockMenu inv) { sapling.applyBoneMeal(BlockFace.UP); inv.consumeItem(slot); - sapling.getWorld().spawnParticle(Particle.VILLAGER_HAPPY, sapling.getLocation().add(0.5D, 0.5D, 0.5D), 4, 0.1F, 0.1F, 0.1F); + sapling.getWorld().spawnParticle(VersionedParticle.HAPPY_VILLAGER, sapling.getLocation().add(0.5D, 0.5D, 0.5D), 4, 0.1F, 0.1F, 0.1F); return true; } } @@ -111,7 +111,7 @@ private boolean updateSaplingData(Block machine, Block block, BlockMenu inv, Sap block.setBlockData(sapling, false); inv.consumeItem(slot); - block.getWorld().spawnParticle(Particle.VILLAGER_HAPPY, block.getLocation().add(0.5D, 0.5D, 0.5D), 4, 0.1F, 0.1F, 0.1F); + block.getWorld().spawnParticle(VersionedParticle.HAPPY_VILLAGER, block.getLocation().add(0.5D, 0.5D, 0.5D), 4, 0.1F, 0.1F, 0.1F); return true; } } 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 ce8e53f8d9..33e54e7544 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 @@ -14,7 +14,6 @@ import org.bukkit.Location; import org.bukkit.Material; -import org.bukkit.Particle; import org.bukkit.SoundCategory; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Entity; @@ -30,6 +29,7 @@ import io.github.thebusybiscuit.slimefun4.core.services.sounds.SoundEffect; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedParticle; /** * This {@link SlimefunItem} allows you to enchant any enchantable {@link ItemStack} with a random @@ -50,6 +50,8 @@ public EnchantmentRune(ItemGroup itemGroup, SlimefunItemStack item, RecipeType r super(itemGroup, item, recipeType, recipe); for (Material mat : Material.values()) { + if (Slimefun.instance().isUnitTest() && mat.isLegacy()) continue; + List enchantments = new ArrayList<>(); for (Enchantment enchantment : Enchantment.values()) { @@ -140,7 +142,7 @@ private void addRandomEnchantment(@Nonnull Player p, @Nonnull Item rune) { // Being sure entities are still valid and not picked up or whatsoever. if (rune.isValid() && item.isValid() && itemStack.getAmount() == 1) { - l.getWorld().spawnParticle(Particle.CRIT_MAGIC, l, 1); + l.getWorld().spawnParticle(VersionedParticle.ENCHANTED_HIT, l, 1); SoundEffect.ENCHANTMENT_RUNE_ADD_ENCHANT_SOUND.playAt(l, SoundCategory.PLAYERS); item.remove(); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/runes/VillagerRune.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/runes/VillagerRune.java index d5a3b325aa..fe5195e22c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/runes/VillagerRune.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/runes/VillagerRune.java @@ -22,6 +22,7 @@ import io.github.thebusybiscuit.slimefun4.core.services.sounds.SoundEffect; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedParticle; /** * This {@link SlimefunItem} allows you to reset a {@link Villager} profession. @@ -64,7 +65,7 @@ public VillagerRune(ItemGroup itemGroup, SlimefunItemStack item, RecipeType reci SoundEffect.VILLAGER_RUNE_TRANSFORM_SOUND.playAt(villager.getLocation(), SoundCategory.NEUTRAL); villager.getWorld().spawnParticle(Particle.CRIMSON_SPORE, villager.getLocation(), 10, 0, offset / 2, 0, 0); - villager.getWorld().spawnParticle(Particle.ENCHANTMENT_TABLE, villager.getLocation(), 5, 0.04, 1, 0.04); + villager.getWorld().spawnParticle(VersionedParticle.ENCHANT, villager.getLocation(), 5, 0.04, 1, 0.04); } }; } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/Bandage.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/Bandage.java index d69ceeaa91..b87882cf6d 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/Bandage.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/Bandage.java @@ -9,7 +9,6 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; import io.github.bakedlibs.dough.items.ItemUtils; import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup; @@ -17,6 +16,7 @@ import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType; import io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler; import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedPotionEffectType; /** * A {@link Bandage} or Rag is a medical supply which heals the {@link Player} and extinguishes @@ -51,7 +51,7 @@ public ItemUseHandler getItemHandler() { } p.getWorld().playEffect(p.getLocation(), Effect.STEP_SOUND, Material.WHITE_WOOL); - p.addPotionEffect(new PotionEffect(PotionEffectType.HEAL, 1, healingLevel)); + p.addPotionEffect(new PotionEffect(VersionedPotionEffectType.INSTANT_HEALTH, 1, healingLevel)); p.setFireTicks(0); e.cancel(); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/MedicalSupply.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/MedicalSupply.java index 2a0383001b..350376eab8 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/MedicalSupply.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/MedicalSupply.java @@ -18,6 +18,7 @@ import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack; import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType; import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedPotionEffectType; public abstract class MedicalSupply extends SimpleSlimefunItem { @@ -32,10 +33,10 @@ protected MedicalSupply(ItemGroup itemGroup, int healAmount, SlimefunItemStack i curedEffects.add(PotionEffectType.POISON); curedEffects.add(PotionEffectType.WITHER); - curedEffects.add(PotionEffectType.SLOW); - curedEffects.add(PotionEffectType.SLOW_DIGGING); + curedEffects.add(VersionedPotionEffectType.SLOWNESS); + curedEffects.add(VersionedPotionEffectType.MINING_FATIGUE); curedEffects.add(PotionEffectType.WEAKNESS); - curedEffects.add(PotionEffectType.CONFUSION); + curedEffects.add(VersionedPotionEffectType.NAUSEA); curedEffects.add(PotionEffectType.BLINDNESS); curedEffects.add(PotionEffectType.BAD_OMEN); } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/Splint.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/Splint.java index a6495d061a..0a510ff28a 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/Splint.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/medical/Splint.java @@ -8,7 +8,6 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; import io.github.bakedlibs.dough.items.ItemUtils; import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup; @@ -17,6 +16,7 @@ import io.github.thebusybiscuit.slimefun4.core.handlers.ItemUseHandler; import io.github.thebusybiscuit.slimefun4.core.services.sounds.SoundEffect; import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedPotionEffectType; public class Splint extends SimpleSlimefunItem { @@ -40,7 +40,7 @@ public Splint(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType } SoundEffect.SPLINT_CONSUME_SOUND.playFor(p); - p.addPotionEffect(new PotionEffect(PotionEffectType.HEAL, 1, 0)); + p.addPotionEffect(new PotionEffect(VersionedPotionEffectType.INSTANT_HEALTH, 1, 0)); e.cancel(); }; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/MiningTask.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/MiningTask.java index 5da4697970..0169f0f846 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/MiningTask.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/multiblocks/miner/MiningTask.java @@ -10,7 +10,6 @@ import org.bukkit.Effect; import org.bukkit.Location; import org.bukkit.Material; -import org.bukkit.Particle; import org.bukkit.Sound; import org.bukkit.World; import org.bukkit.block.Block; @@ -30,6 +29,7 @@ import io.github.bakedlibs.dough.scheduling.TaskQueue; import io.github.thebusybiscuit.slimefun4.core.services.sounds.SoundEffect; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedParticle; import io.papermc.lib.PaperLib; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.MachineFuel; @@ -341,7 +341,7 @@ private void setPistonState(@Nonnull Block block, boolean extended) { try { // Smoke Particles around the Chest for dramatic effect Location particleLoc = chest.getLocation().clone().add(0, -1, 0); - block.getWorld().spawnParticle(Particle.SMOKE_NORMAL, particleLoc, 20, 0.7, 0.7, 0.7, 0); + block.getWorld().spawnParticle(VersionedParticle.SMOKE, particleLoc, 20, 0.7, 0.7, 0.7, 0); if (block.getType() == Material.MOVING_PISTON) { // Yeah it isn't really cool when this happens 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 43f0225237..265db240ed 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 @@ -39,6 +39,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem; import io.github.thebusybiscuit.slimefun4.implementation.settings.ClimbableSurface; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedEnchantment; import io.github.thebusybiscuit.slimefun4.utils.tags.SlimefunTag; /** @@ -147,7 +148,7 @@ public double getClimbingSpeed(@Nonnull ItemStack item, @Nonnull Material type) double speed = getClimbingSpeed(type); if (speed > 0) { - int efficiencyLevel = item.getEnchantmentLevel(Enchantment.DIG_SPEED); + int efficiencyLevel = item.getEnchantmentLevel(VersionedEnchantment.EFFICIENCY); if (efficiencyLevel > 0) { speed += efficiencyLevel * EFFICIENCY_MODIFIER; diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/weapons/ExplosiveBow.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/weapons/ExplosiveBow.java index d4cea025f5..1477549c9f 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/weapons/ExplosiveBow.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/weapons/ExplosiveBow.java @@ -6,7 +6,6 @@ import javax.annotation.ParametersAreNonnullByDefault; import org.bukkit.Bukkit; -import org.bukkit.Particle; import org.bukkit.SoundCategory; import org.bukkit.entity.ArmorStand; import org.bukkit.entity.Entity; @@ -22,6 +21,7 @@ import io.github.thebusybiscuit.slimefun4.api.items.settings.IntRangeSetting; import io.github.thebusybiscuit.slimefun4.core.handlers.BowShootHandler; import io.github.thebusybiscuit.slimefun4.core.services.sounds.SoundEffect; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedParticle; /** * The {@link ExplosiveBow} is a {@link SlimefunBow} which creates a fake explosion when it hits @@ -49,7 +49,7 @@ public ExplosiveBow(ItemGroup itemGroup, SlimefunItemStack item, ItemStack[] rec @Override public BowShootHandler onShoot() { return (e, target) -> { - target.getWorld().spawnParticle(Particle.EXPLOSION_LARGE, target.getLocation(), 1); + target.getWorld().spawnParticle(VersionedParticle.EXPLOSION, target.getLocation(), 1); SoundEffect.EXPLOSIVE_BOW_HIT_SOUND.playAt(target.getLocation(), SoundCategory.PLAYERS); int radius = range.getValue(); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/weapons/IcyBow.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/weapons/IcyBow.java index 474a7277d6..b3e54f15ed 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/weapons/IcyBow.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/weapons/IcyBow.java @@ -9,13 +9,13 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup; import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack; import io.github.thebusybiscuit.slimefun4.core.handlers.BowShootHandler; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedPotionEffectType; /** * The {@link IcyBow} is a special kind of bow which slows down any @@ -48,8 +48,8 @@ public BowShootHandler onShoot() { } n.getWorld().playEffect(n.getLocation(), Effect.STEP_SOUND, Material.ICE); n.getWorld().playEffect(n.getEyeLocation(), Effect.STEP_SOUND, Material.ICE); - n.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 20 * 2, 10)); - n.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 20 * 2, -10)); + n.addPotionEffect(new PotionEffect(VersionedPotionEffectType.SLOWNESS, 20 * 2, 10)); + n.addPotionEffect(new PotionEffect(VersionedPotionEffectType.JUMP_BOOST, 20 * 2, -10)); }; } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BlockListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BlockListener.java index 41d09759a0..40b976e345 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BlockListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BlockListener.java @@ -39,6 +39,7 @@ import io.github.thebusybiscuit.slimefun4.core.handlers.BlockPlaceHandler; import io.github.thebusybiscuit.slimefun4.core.handlers.ToolUseHandler; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedEnchantment; import io.github.thebusybiscuit.slimefun4.utils.tags.SlimefunTag; import me.mrCookieSlime.Slimefun.api.BlockStorage; @@ -374,7 +375,7 @@ private int getBonusDropsWithFortune(@Nullable ItemStack item, @Nonnull Block b) * directly and re use it. */ ItemMeta meta = item.getItemMeta(); - int fortuneLevel = meta.getEnchantLevel(Enchantment.LOOT_BONUS_BLOCKS); + int fortuneLevel = meta.getEnchantLevel(VersionedEnchantment.FORTUNE); if (fortuneLevel > 0 && !meta.hasEnchant(Enchantment.SILK_TOUCH)) { Random random = ThreadLocalRandom.current(); 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 a01625c836..7a8b29c0df 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 @@ -49,6 +49,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.items.magical.talismans.MagicianTalisman; import io.github.thebusybiscuit.slimefun4.implementation.items.magical.talismans.Talisman; import io.github.thebusybiscuit.slimefun4.implementation.settings.TalismanEnchantment; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedEnchantment; import io.github.thebusybiscuit.slimefun4.utils.tags.SlimefunTag; /** @@ -301,7 +302,7 @@ public void onEnchant(EnchantItemEvent e) { } // Wizard Talisman - if (!enchantments.containsKey(Enchantment.SILK_TOUCH) && Enchantment.LOOT_BONUS_BLOCKS.canEnchantItem(e.getItem()) && Talisman.trigger(e, SlimefunItems.TALISMAN_WIZARD)) { + if (!enchantments.containsKey(Enchantment.SILK_TOUCH) && VersionedEnchantment.FORTUNE.canEnchantItem(e.getItem()) && Talisman.trigger(e, SlimefunItems.TALISMAN_WIZARD)) { // Randomly lower some enchantments for (Map.Entry entry : enchantments.entrySet()) { if (entry.getValue() > 1 && random.nextInt(100) < 40) { @@ -310,7 +311,7 @@ public void onEnchant(EnchantItemEvent e) { } // Give an extra Fortune boost (Lvl 3 - 5) - enchantments.put(Enchantment.LOOT_BONUS_BLOCKS, random.nextInt(3) + 3); + enchantments.put(VersionedEnchantment.FORTUNE, random.nextInt(3) + 3); } } @@ -351,7 +352,7 @@ private void doubleTalismanDrops(BlockDropItemEvent e, SlimefunItemStack talisma Collection drops = e.getItems(); if (Talisman.trigger(e, talismanItemStack, false)) { - int dropAmount = getAmountWithFortune(type, meta.getEnchantLevel(Enchantment.LOOT_BONUS_BLOCKS)); + int dropAmount = getAmountWithFortune(type, meta.getEnchantLevel(VersionedEnchantment.FORTUNE)); // Keep track of whether we actually doubled the drops or not boolean doubledDrops = false; 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 9ade30e843..16bfdc85a0 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 @@ -217,6 +217,7 @@ import io.github.thebusybiscuit.slimefun4.utils.ColoredMaterial; import io.github.thebusybiscuit.slimefun4.utils.HeadTexture; import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedPotionEffectType; /** * This class holds the recipes of all items. @@ -241,7 +242,7 @@ public static void setup(@Nonnull Slimefun plugin) { 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 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); @@ -261,7 +262,7 @@ public static void setup(@Nonnull Slimefun 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 EnhancedCraftingTable(itemGroups.basicMachines, SlimefunItems.ENHANCED_CRAFTING_TABLE).register(plugin); new PortableDustbin(itemGroups.usefulItems, SlimefunItems.PORTABLE_DUSTBIN, RecipeType.ENHANCED_CRAFTING_TABLE, @@ -299,14 +300,14 @@ public static void setup(@Nonnull Slimefun plugin) { new GrindStone(itemGroups.basicMachines, SlimefunItems.GRIND_STONE).register(plugin); new ArmorForge(itemGroups.basicMachines, SlimefunItems.ARMOR_FORGE).register(plugin); - + OreCrusher oreCrusher = new OreCrusher(itemGroups.basicMachines, SlimefunItems.ORE_CRUSHER); oreCrusher.register(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 ItemStack[] {new ItemStack(Material.NETHER_WART), null, null, null, null, null, null, null, null}, new SlimefunItemStack(SlimefunItems.MAGIC_LUMP_1, 2)) .register(plugin); @@ -378,7 +379,7 @@ public static void setup(@Nonnull Slimefun 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(PotionEffectType.JUMP, 300, 5)}, + new PotionEffect[] {new PotionEffect(VersionedPotionEffectType.JUMP_BOOST, 300, 5)}, SoundEffect.SLIME_BOOTS_FALL_SOUND) .register(plugin); @@ -416,11 +417,11 @@ public static void setup(@Nonnull Slimefun 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 PressureChamber(itemGroups.basicMachines, SlimefunItems.PRESSURE_CHAMBER).register(plugin); new UnplaceableBlock(itemGroups.technicalComponents, SlimefunItems.BATTERY, RecipeType.ENHANCED_CRAFTING_TABLE, @@ -429,9 +430,9 @@ public static void setup(@Nonnull Slimefun 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)}, + 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); @@ -551,12 +552,12 @@ public static void setup(@Nonnull Slimefun plugin) { .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 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 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 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); @@ -571,7 +572,7 @@ public static void setup(@Nonnull Slimefun 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 SlimefunItem(itemGroups.resources, SlimefunItems.LEAD_DUST, RecipeType.ORE_WASHER, new ItemStack[] {SlimefunItems.SIFTED_ORE, null, null, null, null, null, null, null, null}) .register(plugin); @@ -693,12 +694,12 @@ public static void setup(@Nonnull Slimefun plugin) { .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 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 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 ItemStack[] {null, null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.STEEL_INGOT, null, SlimefunItems.STEEL_INGOT, null, null}, new SlimefunItemStack(SlimefunItems.CHAIN, 8)) .register(plugin); @@ -723,11 +724,11 @@ public static void setup(@Nonnull Slimefun 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 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); - + .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, @@ -832,14 +833,18 @@ public static void setup(@Nonnull Slimefun 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 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); ItemStack weaknessPotion = new ItemStack(Material.POTION); PotionMeta meta = (PotionMeta) weaknessPotion.getItemMeta(); - meta.setBasePotionData(new PotionData(PotionType.WEAKNESS, false, false)); + if (Slimefun.getMinecraftVersion().isBefore(20, 2)) { + meta.setBasePotionData(new PotionData(PotionType.WEAKNESS, false, false)); + } else { + meta.setBasePotionType(PotionType.WEAKNESS); + } weaknessPotion.setItemMeta(meta); new MagicalZombiePills(itemGroups.magicalGadgets, SlimefunItems.MAGICAL_ZOMBIE_PILLS, RecipeType.MAGIC_WORKBENCH, @@ -907,7 +912,7 @@ public static void setup(@Nonnull Slimefun 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(PotionEffectType.INCREASE_DAMAGE, 3600, 2)) + true, true, "warrior", new PotionEffect(VersionedPotionEffectType.STRENGTH, 3600, 2)) .register(plugin); new Talisman(SlimefunItems.TALISMAN_KNIGHT, @@ -917,7 +922,7 @@ public static void setup(@Nonnull Slimefun 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(PotionEffectType.FAST_DIGGING, 800, 2)) + false, false, "caveman", 50, new PotionEffect(VersionedPotionEffectType.HASTE, 800, 2)) .register(plugin); new Talisman(SlimefunItems.TALISMAN_WISE, @@ -946,7 +951,7 @@ public static void setup(@Nonnull Slimefun plugin) { 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 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); @@ -956,7 +961,7 @@ public static void setup(@Nonnull Slimefun plugin) { .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 ItemStack[] {new ItemStack(Material.MILK_BUCKET), null, null, null, null, null, null, null, null}, new SlimefunItemStack(SlimefunItems.HEAVY_CREAM, 2)) .register(plugin); @@ -971,7 +976,7 @@ public static void setup(@Nonnull Slimefun 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 }, "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); @@ -1027,7 +1032,7 @@ public static void setup(@Nonnull Slimefun plugin) { }, "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 ItemStack[] {new ItemStack(Material.WHITE_WOOL), null, null, null, null, null, null, null, null}, new SlimefunItemStack(SlimefunItems.CLOTH, 8)) .register(plugin); @@ -1037,17 +1042,17 @@ public static void setup(@Nonnull Slimefun plugin) { .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 ItemStack[] {SlimefunItems.RAG, new ItemStack(Material.STRING), SlimefunItems.RAG, null, null, null, null, null, null}, new SlimefunItemStack(SlimefunItems.BANDAGE, 4), 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 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 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 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); @@ -1067,7 +1072,7 @@ public static void setup(@Nonnull Slimefun 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 TableSaw(itemGroups.basicMachines, SlimefunItems.TABLE_SAW).register(plugin); new SlimefunArmorPiece(itemGroups.magicalArmor, SlimefunItems.SLIME_HELMET_STEEL, RecipeType.ARMOR_FORGE, @@ -1085,7 +1090,7 @@ public static void setup(@Nonnull Slimefun 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(PotionEffectType.JUMP, 300, 5)}, + new PotionEffect[] {new PotionEffect(VersionedPotionEffectType.JUMP_BOOST, 300, 5)}, SoundEffect.SLIME_BOOTS_FALL_SOUND) .register(plugin); @@ -1104,7 +1109,7 @@ public static void setup(@Nonnull Slimefun 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 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); @@ -1114,7 +1119,7 @@ public static void setup(@Nonnull Slimefun plugin) { .register(plugin); new AutomatedPanningMachine(itemGroups.basicMachines, SlimefunItems.AUTOMATED_PANNING_MACHINE).register(plugin); - + new IndustrialMiner(itemGroups.basicMachines, SlimefunItems.INDUSTRIAL_MINER, Material.IRON_BLOCK, false, 3).register(plugin); new AdvancedIndustrialMiner(itemGroups.basicMachines, SlimefunItems.ADVANCED_INDUSTRIAL_MINER).register(plugin); @@ -1232,7 +1237,7 @@ public static void setup(@Nonnull Slimefun 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 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); @@ -1240,7 +1245,7 @@ public static void setup(@Nonnull Slimefun 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 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); @@ -1384,10 +1389,10 @@ public static void setup(@Nonnull Slimefun plugin) { .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 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 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); @@ -1409,7 +1414,7 @@ public static void setup(@Nonnull Slimefun plugin) { .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 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); @@ -1422,37 +1427,37 @@ public static void setup(@Nonnull Slimefun plugin) { .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 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 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 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 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 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 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 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 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 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 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 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 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 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); @@ -1461,22 +1466,22 @@ public static void setup(@Nonnull Slimefun plugin) { .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 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 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 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 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 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 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 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); @@ -1497,17 +1502,17 @@ public static void setup(@Nonnull Slimefun plugin) { ).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 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 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 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 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 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), @@ -1543,7 +1548,7 @@ public static void setup(@Nonnull Slimefun plugin) { .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 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); @@ -1561,7 +1566,7 @@ public static void setup(@Nonnull Slimefun plugin) { .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 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); @@ -1604,7 +1609,7 @@ public static void setup(@Nonnull Slimefun 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 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) @@ -1804,11 +1809,11 @@ public static void setup(@Nonnull Slimefun plugin) { .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 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) @@ -1879,7 +1884,7 @@ public static void setup(@Nonnull Slimefun 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}) { - + @Override public int getMultiplier(int y) { return y; @@ -1894,7 +1899,7 @@ public int getEnergyConsumption() { 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}) { - + @Override public int getMultiplier(int y) { return y * 4 + 100; @@ -1909,7 +1914,7 @@ public int getEnergyConsumption() { 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}) { - + @Override public int getMultiplier(int y) { return y * 16 + 500; @@ -1924,7 +1929,7 @@ public int getEnergyConsumption() { 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}) { - + @Override public int getMultiplier(int y) { return y * 64 + 2100; @@ -1934,7 +1939,7 @@ public int getMultiplier(int y) { public int getEnergyConsumption() { return 43; } - + }.register(plugin); new GPSControlPanel(itemGroups.gps, SlimefunItems.GPS_CONTROL_PANEL, RecipeType.ENHANCED_CRAFTING_TABLE, @@ -2014,32 +2019,32 @@ public int getEnergyConsumption() { .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 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 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 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 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 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 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 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 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 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 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 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); @@ -2056,7 +2061,7 @@ public int getEnergyConsumption() { .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 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); @@ -2085,133 +2090,133 @@ public int getEnergyConsumption() { .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 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 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 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 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 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 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 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 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 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 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 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); // 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 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 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 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 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 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 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 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 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 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 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 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); - + // 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 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 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 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 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 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 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 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 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 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 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 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); // 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 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 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 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 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 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 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 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 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 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 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 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 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 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); @@ -2275,7 +2280,7 @@ public int getEnergyConsumption() { .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 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); @@ -2379,7 +2384,7 @@ public int getEnergyConsumption() { 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 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}) .register(plugin); @@ -2515,7 +2520,7 @@ public int getSpeed() { 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}){ - + @Override public int getEnergyProduction() { return 250; @@ -2525,7 +2530,7 @@ public int getEnergyProduction() { public int getCapacity() { return 16384; } - + }.register(plugin); new NetherStarReactor(itemGroups.electricity, SlimefunItems.NETHER_STAR_REACTOR, RecipeType.ENHANCED_CRAFTING_TABLE, @@ -2544,7 +2549,7 @@ 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 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); @@ -2553,17 +2558,17 @@ public int getCapacity() { .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 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 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 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 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 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); @@ -2625,11 +2630,11 @@ public int getCapacity() { 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 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); - + MinecraftVersion minecraftVersion = Slimefun.getMinecraftVersion(); new SlimefunItem(itemGroups.magicalArmor, SlimefunItems.BEE_HELMET, RecipeType.ARMOR_FORGE, @@ -2646,7 +2651,7 @@ public int getCapacity() { 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(PotionEffectType.JUMP, 300, 2)}, + new PotionEffect[] {new PotionEffect(VersionedPotionEffectType.JUMP_BOOST, 300, 2)}, SoundEffect.BEE_BOOTS_FALL_SOUND) .register(plugin); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/AncientAltarTask.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/AncientAltarTask.java index b32e719efc..be256b0031 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/AncientAltarTask.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/AncientAltarTask.java @@ -14,7 +14,6 @@ import org.bukkit.Effect; import org.bukkit.Location; import org.bukkit.Material; -import org.bukkit.Particle; import org.bukkit.SoundCategory; import org.bukkit.block.Block; import org.bukkit.entity.Item; @@ -28,6 +27,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.items.altar.AncientAltar; import io.github.thebusybiscuit.slimefun4.implementation.items.altar.AncientPedestal; import io.github.thebusybiscuit.slimefun4.implementation.listeners.AncientAltarListener; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedParticle; /** * The {@link AncientAltarTask} is responsible for the animation that happens when a ritual @@ -117,12 +117,12 @@ private boolean checkLockedItems() { } private void idle() { - dropLocation.getWorld().spawnParticle(Particle.SPELL_WITCH, dropLocation, 16, 1.2F, 0F, 1.2F); - dropLocation.getWorld().spawnParticle(Particle.FIREWORKS_SPARK, dropLocation, 8, 0.2F, 0F, 0.2F); + dropLocation.getWorld().spawnParticle(VersionedParticle.WITCH, dropLocation, 16, 1.2F, 0F, 1.2F); + dropLocation.getWorld().spawnParticle(VersionedParticle.FIREWORK, dropLocation, 8, 0.2F, 0F, 0.2F); for (Location loc : particleLocations) { - dropLocation.getWorld().spawnParticle(Particle.ENCHANTMENT_TABLE, loc, 16, 0.3F, 0.2F, 0.3F); - dropLocation.getWorld().spawnParticle(Particle.CRIT_MAGIC, loc, 8, 0.3F, 0.2F, 0.3F); + dropLocation.getWorld().spawnParticle(VersionedParticle.ENCHANT, loc, 16, 0.3F, 0.2F, 0.3F); + dropLocation.getWorld().spawnParticle(VersionedParticle.ENCHANTED_HIT, loc, 8, 0.3F, 0.2F, 0.3F); } } @@ -137,8 +137,8 @@ private void checkPedestal(@Nonnull Block pedestal) { items.add(pedestalItem.getOriginalItemStack(entity)); SoundEffect.ANCIENT_ALTAR_ITEM_CHECK_SOUND.playAt(pedestal); - dropLocation.getWorld().spawnParticle(Particle.ENCHANTMENT_TABLE, pedestal.getLocation().add(0.5, 1.5, 0.5), 16, 0.3F, 0.2F, 0.3F); - dropLocation.getWorld().spawnParticle(Particle.CRIT_MAGIC, pedestal.getLocation().add(0.5, 1.5, 0.5), 8, 0.3F, 0.2F, 0.3F); + dropLocation.getWorld().spawnParticle(VersionedParticle.ENCHANT, pedestal.getLocation().add(0.5, 1.5, 0.5), 16, 0.3F, 0.2F, 0.3F); + dropLocation.getWorld().spawnParticle(VersionedParticle.ENCHANTED_HIT, pedestal.getLocation().add(0.5, 1.5, 0.5), 8, 0.3F, 0.2F, 0.3F); positionLock.remove(entity); entity.remove(); 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 32141cb010..051f931460 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 @@ -24,10 +24,9 @@ import io.github.thebusybiscuit.slimefun4.core.attributes.ProtectionType; import io.github.thebusybiscuit.slimefun4.core.attributes.Radioactive; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; -import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; import io.github.thebusybiscuit.slimefun4.implementation.items.armor.SlimefunArmorPiece; import io.github.thebusybiscuit.slimefun4.implementation.items.electric.gadgets.SolarHelmet; -import io.github.thebusybiscuit.slimefun4.utils.SlimefunUtils; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedPotionEffectType; import io.github.thebusybiscuit.slimefun4.utils.itemstack.ItemStackWrapper; /** @@ -55,10 +54,10 @@ public ArmorTask(boolean radioactiveFire) { Set effects = new HashSet<>(); effects.add(new PotionEffect(PotionEffectType.WITHER, 400, 2)); effects.add(new PotionEffect(PotionEffectType.BLINDNESS, 400, 3)); - effects.add(new PotionEffect(PotionEffectType.CONFUSION, 400, 3)); + effects.add(new PotionEffect(VersionedPotionEffectType.NAUSEA, 400, 3)); effects.add(new PotionEffect(PotionEffectType.WEAKNESS, 400, 2)); - effects.add(new PotionEffect(PotionEffectType.SLOW, 400, 1)); - effects.add(new PotionEffect(PotionEffectType.SLOW_DIGGING, 400, 1)); + effects.add(new PotionEffect(VersionedPotionEffectType.SLOWNESS, 400, 1)); + effects.add(new PotionEffect(VersionedPotionEffectType.MINING_FATIGUE, 400, 1)); radiationEffects = Collections.unmodifiableSet(effects); } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/FireworkUtils.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/FireworkUtils.java index 808c5364ce..e09851349d 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/FireworkUtils.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/FireworkUtils.java @@ -15,6 +15,8 @@ import org.bukkit.entity.Firework; import org.bukkit.inventory.meta.FireworkMeta; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedEntityType; + /** * This is a simple utility class for spawning random and colorful {@link Firework} rockets. * @@ -31,6 +33,8 @@ public final class FireworkUtils { Color.RED, Color.SILVER, Color.TEAL, Color.WHITE, Color.YELLOW }; // @formatter:on + + private static final EntityType firework = VersionedEntityType.FIREWORK; private FireworkUtils() {} @@ -39,7 +43,7 @@ public static void launchFirework(@Nonnull Location l, @Nonnull Color color) { } public static @Nonnull Firework createFirework(@Nonnull Location l, @Nonnull Color color) { - Firework fw = (Firework) l.getWorld().spawnEntity(l, EntityType.FIREWORK); + Firework fw = (Firework) l.getWorld().spawnEntity(l, firework); FireworkMeta meta = fw.getFireworkMeta(); meta.setDisplayName(ChatColor.GREEN + "Slimefun Research"); 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 5fc3bda47f..a509b207f3 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/SlimefunUtils.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/SlimefunUtils.java @@ -485,11 +485,24 @@ private static boolean equalsItemMeta(@Nonnull ItemMeta itemMeta, @Nonnull ItemM return false; } - if (itemMeta instanceof PotionMeta && sfitemMeta instanceof PotionMeta) { - return ((PotionMeta) itemMeta).getBasePotionData().equals(((PotionMeta) sfitemMeta).getBasePotionData()); + if (!(itemMeta instanceof PotionMeta potionMeta) || !(sfitemMeta instanceof PotionMeta sfPotionMeta)) { + return true; } - - return true; + MinecraftVersion current = Slimefun.getMinecraftVersion(); + + if (current.isBefore(20, 2)) { + // getBasePotionData pre 1.20.2 + return potionMeta.getBasePotionData().equals(sfPotionMeta.getBasePotionData()); + } else if (current.isBefore(20, 5)) { + // getBasePotionType without null check for 1.20.3 and 1.20.4 + return potionMeta.getBasePotionType() == sfPotionMeta.getBasePotionType(); + } + // check if potionMetha has a basePotionType (acting a null check for getBasePotionType + // on 1.20.5+ + if (potionMeta.hasBasePotionType() != sfPotionMeta.hasBasePotionType()) { + return false; + } + return potionMeta.getBasePotionType() == sfPotionMeta.getBasePotionType(); } /** diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEnchantment.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEnchantment.java new file mode 100644 index 0000000000..d5063ce413 --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEnchantment.java @@ -0,0 +1,48 @@ +package io.github.thebusybiscuit.slimefun4.utils.compatibility; + +import org.bukkit.NamespacedKey; +import org.bukkit.Registry; +import org.bukkit.enchantments.Enchantment; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +// https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/legacy/FieldRename.java?until=2a6207fe150b6165722fce94c83cc1f206620ab5&untilPath=src%2Fmain%2Fjava%2Forg%2Fbukkit%2Fcraftbukkit%2Flegacy%2FFieldRename.java#86-110 +public class VersionedEnchantment { + + public static final Enchantment EFFICIENCY; + public static final Enchantment UNBREAKING; + public static final Enchantment PROTECTION; + public static final Enchantment SHARPNESS; + public static final Enchantment LUCK_OF_THE_SEA; + public static final Enchantment AQUA_AFFINITY; + public static final Enchantment FORTUNE; + + static { + // DIG_SPEED is renamed to EFFICIENCY in 1.20.5 + EFFICIENCY = getKey("efficiency"); + + // DURABILITY is renamed to UNBREAKING in 1.20.5 + UNBREAKING = getKey("unbreaking"); + + // PROTECTION_ENVIRONMENTAL is renamed to PROTECTION in 1.20.5 + PROTECTION = getKey("protection"); + + // DAMAGE_ALL is renamed to SHARPNESS in 1.20.5 + SHARPNESS = getKey("sharpness"); + + // LUCK is renamed to LUCK_OF_THE_SEA in 1.20.5 + LUCK_OF_THE_SEA = getKey("luck_of_the_sea"); + + // WATER_WORKER is renamed to AQUA_AFFINITY in 1.20.5 + AQUA_AFFINITY = getKey("aqua_affinity"); + + // LOOT_BONUS_BLOCKS is renamed to FORTUNE in 1.20.5 + FORTUNE = getKey("fortune"); + } + + @Nullable + private static Enchantment getKey(@Nonnull String key) { + return Registry.ENCHANTMENT.get(NamespacedKey.minecraft(key)); + } +} diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEntityType.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEntityType.java new file mode 100644 index 0000000000..10ae11e803 --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedEntityType.java @@ -0,0 +1,31 @@ +package io.github.thebusybiscuit.slimefun4.utils.compatibility; + +import org.bukkit.NamespacedKey; +import org.bukkit.Registry; +import org.bukkit.entity.EntityType; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +// https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/legacy/FieldRename.java?until=2a6207fe150b6165722fce94c83cc1f206620ab5&untilPath=src%2Fmain%2Fjava%2Forg%2Fbukkit%2Fcraftbukkit%2Flegacy%2FFieldRename.java#158-193 +public class VersionedEntityType { + + public static final EntityType MOOSHROOM; + public static final EntityType SNOW_GOLEM; + public static final EntityType FIREWORK; + + static { + // MUSHROOM_COW is renamed to MOOSHROOM in 1.20.5 + MOOSHROOM = getKey("mooshroom"); + + // SNOWMAN is renamed to SNOW_GOLEM in 1.20.5 + SNOW_GOLEM = getKey("snow_golem"); + + FIREWORK = getKey("firework_rocket"); + } + + @Nullable + private static EntityType getKey(@Nonnull String key) { + return Registry.ENTITY_TYPE.get(NamespacedKey.minecraft(key)); + } +} diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedItemFlag.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedItemFlag.java new file mode 100644 index 0000000000..507a903a23 --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedItemFlag.java @@ -0,0 +1,34 @@ +package io.github.thebusybiscuit.slimefun4.utils.compatibility; + +import java.lang.reflect.Field; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +import org.bukkit.inventory.ItemFlag; + +import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; +import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; + +public class VersionedItemFlag { + + public static final ItemFlag HIDE_ADDITIONAL_TOOLTIP; + + static { + MinecraftVersion version = Slimefun.getMinecraftVersion(); + + HIDE_ADDITIONAL_TOOLTIP = version.isAtLeast(MinecraftVersion.MINECRAFT_1_20_5) + ? ItemFlag.HIDE_ADDITIONAL_TOOLTIP + : getKey("HIDE_POTION_EFFECTS"); + } + + @Nullable + private static ItemFlag getKey(@Nonnull String key) { + try { + Field field = ItemFlag.class.getDeclaredField(key); + return (ItemFlag) field.get(null); + } catch(Exception e) { + return null; + } + } +} diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java new file mode 100644 index 0000000000..fafd340cc0 --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedParticle.java @@ -0,0 +1,78 @@ +package io.github.thebusybiscuit.slimefun4.utils.compatibility; + +import java.lang.reflect.Field; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +import org.bukkit.Particle; + +import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; +import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; + +// https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/legacy/FieldRename.java?until=2a6207fe150b6165722fce94c83cc1f206620ab5&untilPath=src%2Fmain%2Fjava%2Forg%2Fbukkit%2Fcraftbukkit%2Flegacy%2FFieldRename.java#281-318 +public class VersionedParticle { + + public static final Particle DUST; + public static final Particle SMOKE; + public static final Particle HAPPY_VILLAGER; + public static final Particle ENCHANTED_HIT; + public static final Particle EXPLOSION; + public static final Particle WITCH; + public static final Particle FIREWORK; + public static final Particle ENCHANT; + + static { + MinecraftVersion version = Slimefun.getMinecraftVersion(); + + // REDSTONE is renamed to DUST in 1.20.5 + DUST = version.isAtLeast(MinecraftVersion.MINECRAFT_1_20_5) + ? Particle.DUST + : getKey("REDSTONE"); + + // SMOKE_NORMAL is renamed to SMOKE in 1.20.5 + SMOKE = version.isAtLeast(MinecraftVersion.MINECRAFT_1_20_5) + ? Particle.SMOKE + : getKey("SMOKE_NORMAL"); + + // VILLAGER_HAPPY is renamed to HAPPY_VILLAGER in 1.20.5 + HAPPY_VILLAGER = version.isAtLeast(MinecraftVersion.MINECRAFT_1_20_5) + ? Particle.HAPPY_VILLAGER + : getKey("VILLAGER_HAPPY"); + + // CRIT_MAGIC is renamed to ENCHANTED_HIT in 1.20.5 + ENCHANTED_HIT = version.isAtLeast(MinecraftVersion.MINECRAFT_1_20_5) + ? Particle.ENCHANTED_HIT + : getKey("CRIT_MAGIC"); + + // EXPLOSION_LARGE is renamed to EXPLOSION in 1.20.5 + EXPLOSION = version.isAtLeast(MinecraftVersion.MINECRAFT_1_20_5) + ? Particle.EXPLOSION + : getKey("EXPLOSION_LARGE"); + + // SPELL_WITCH is renamed to WITCH in 1.20.5 + WITCH = version.isAtLeast(MinecraftVersion.MINECRAFT_1_20_5) + ? Particle.WITCH + : getKey("SPELL_WITCH"); + + // FIREWORKS_SPARK is renamed to FIREWORK in 1.20.5 + FIREWORK = version.isAtLeast(MinecraftVersion.MINECRAFT_1_20_5) + ? Particle.FIREWORK + : getKey("FIREWORKS_SPARK"); + + // ENCHANTMENT_TABLE is renamed to ENCHANT in 1.20.5 + ENCHANT = version.isAtLeast(MinecraftVersion.MINECRAFT_1_20_5) + ? Particle.ENCHANT + : getKey("ENCHANTMENT_TABLE"); + } + + @Nullable + private static Particle getKey(@Nonnull String key) { + try { + Field field = Particle.class.getDeclaredField(key); + return (Particle) field.get(null); + } catch(Exception e) { + return null; + } + } +} diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedPotionEffectType.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedPotionEffectType.java new file mode 100644 index 0000000000..f3dbe6b6d1 --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedPotionEffectType.java @@ -0,0 +1,75 @@ +package io.github.thebusybiscuit.slimefun4.utils.compatibility; + +import java.lang.reflect.Field; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +import org.bukkit.potion.PotionEffectType; + +import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; +import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; + +// https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/legacy/FieldRename.java?until=2a6207fe150b6165722fce94c83cc1f206620ab5&untilPath=src%2Fmain%2Fjava%2Forg%2Fbukkit%2Fcraftbukkit%2Flegacy%2FFieldRename.java#216-228 +public class VersionedPotionEffectType { + + public static final PotionEffectType SLOWNESS; + public static final PotionEffectType HASTE; + public static final PotionEffectType MINING_FATIGUE; + public static final PotionEffectType STRENGTH; + public static final PotionEffectType INSTANT_HEALTH; + public static final PotionEffectType INSTANT_DAMAGE; + public static final PotionEffectType JUMP_BOOST; + public static final PotionEffectType NAUSEA; + public static final PotionEffectType RESISTANCE; + + static { + MinecraftVersion version = Slimefun.getMinecraftVersion(); + + SLOWNESS = version.isAtLeast(MinecraftVersion.MINECRAFT_1_20_5) + ? PotionEffectType.SLOWNESS + : getKey("SLOW"); + + HASTE = version.isAtLeast(MinecraftVersion.MINECRAFT_1_20_5) + ? PotionEffectType.HASTE + : getKey("FAST_DIGGING"); + + MINING_FATIGUE = version.isAtLeast(MinecraftVersion.MINECRAFT_1_20_5) + ? PotionEffectType.MINING_FATIGUE + : getKey("SLOW_DIGGING"); + + STRENGTH = version.isAtLeast(MinecraftVersion.MINECRAFT_1_20_5) + ? PotionEffectType.STRENGTH + : getKey("INCREASE_DAMAGE"); + + INSTANT_HEALTH = version.isAtLeast(MinecraftVersion.MINECRAFT_1_20_5) + ? PotionEffectType.INSTANT_HEALTH + : getKey("HEAL"); + + INSTANT_DAMAGE = version.isAtLeast(MinecraftVersion.MINECRAFT_1_20_5) + ? PotionEffectType.INSTANT_DAMAGE + : getKey("HARM"); + + JUMP_BOOST = version.isAtLeast(MinecraftVersion.MINECRAFT_1_20_5) + ? PotionEffectType.JUMP_BOOST + : getKey("JUMP"); + + NAUSEA = version.isAtLeast(MinecraftVersion.MINECRAFT_1_20_5) + ? PotionEffectType.NAUSEA + : getKey("CONFUSION"); + + RESISTANCE = version.isAtLeast(MinecraftVersion.MINECRAFT_1_20_5) + ? PotionEffectType.RESISTANCE + : getKey("DAMAGE_RESISTANCE"); + } + + @Nullable + private static PotionEffectType getKey(@Nonnull String key) { + try { + Field field = PotionEffectType.class.getDeclaredField(key); + return (PotionEffectType) field.get(null); + } catch(Exception e) { + return null; + } + } +} diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedPotionType.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedPotionType.java new file mode 100644 index 0000000000..1713d77baf --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/compatibility/VersionedPotionType.java @@ -0,0 +1,55 @@ +package io.github.thebusybiscuit.slimefun4.utils.compatibility; + +import java.lang.reflect.Field; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +import org.bukkit.potion.PotionType; + +import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; +import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; + +// https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/legacy/FieldRename.java?until=2a6207fe150b6165722fce94c83cc1f206620ab5&untilPath=src%2Fmain%2Fjava%2Forg%2Fbukkit%2Fcraftbukkit%2Flegacy%2FFieldRename.java#242-250 +public class VersionedPotionType { + + public static final PotionType LEAPING; + public static final PotionType SWIFTNESS; + public static final PotionType HEALING; + public static final PotionType HARMING; + public static final PotionType REGENERATION; + + static { + MinecraftVersion version = Slimefun.getMinecraftVersion(); + + LEAPING = version.isAtLeast(MinecraftVersion.MINECRAFT_1_20_5) + ? PotionType.LEAPING + : getKey("JUMP"); + + SWIFTNESS = version.isAtLeast(MinecraftVersion.MINECRAFT_1_20_5) + ? PotionType.SWIFTNESS + : getKey("SPEED"); + + HEALING = version.isAtLeast(MinecraftVersion.MINECRAFT_1_20_5) + ? PotionType.HEALING + : getKey("INSTANT_HEAL"); + + HARMING = version.isAtLeast(MinecraftVersion.MINECRAFT_1_20_5) + ? PotionType.HARMING + : getKey("INSTANT_DAMAGE"); + + REGENERATION = version.isAtLeast(MinecraftVersion.MINECRAFT_1_20_5) + ? PotionType.REGENERATION + : getKey("REGEN"); + } + + @Nullable + private static PotionType getKey(@Nonnull String key) { + try { + Field field = PotionType.class.getDeclaredField(key); + return (PotionType) field.get(null); + } catch(Exception e) { + return null; + } + } +} 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 17a62c352f..063d91f8d1 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 @@ -9,12 +9,12 @@ import org.bukkit.FireworkEffect; import org.bukkit.FireworkEffect.Type; import org.bukkit.Material; -import org.bukkit.inventory.ItemFlag; 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; /** * This simple {@link ItemStack} implementation allows us to obtain @@ -44,7 +44,7 @@ public ColoredFireworkStar(Color color, String name, String... lore) { im.setLore(lines); } - im.addItemFlags(ItemFlag.HIDE_POTION_EFFECTS); + im.addItemFlags(VersionedItemFlag.HIDE_ADDITIONAL_TOOLTIP); }); } diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/core/commands/TestGuideCommand.java b/src/test/java/io/github/thebusybiscuit/slimefun4/core/commands/TestGuideCommand.java index 0612ade074..57560503a7 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/core/commands/TestGuideCommand.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/core/commands/TestGuideCommand.java @@ -38,9 +38,9 @@ public static void unload() { void testCommand(boolean op) { Player player = server.addPlayer(); player.setOp(op); + boolean hasPermission = player.hasPermission("slimefun.command.guide"); server.execute("slimefun", player, "guide").assertSucceeded(); - ItemStack guide = SlimefunGuide.getItem(SlimefunGuideMode.SURVIVAL_MODE); - Assertions.assertEquals(op, SlimefunUtils.containsSimilarItem(player.getInventory(), guide, true)); + Assertions.assertEquals(hasPermission, SlimefunUtils.containsSimilarItem(player.getInventory(), guide, true)); } } diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/localization/AbstractLocaleRegexChecker.java b/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/localization/AbstractLocaleRegexChecker.java index 63eef282b4..df8668f285 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/localization/AbstractLocaleRegexChecker.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/localization/AbstractLocaleRegexChecker.java @@ -1,8 +1,8 @@ package io.github.thebusybiscuit.slimefun4.core.services.localization; import java.io.BufferedReader; +import java.io.IOException; import java.io.InputStream; -import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.List; @@ -16,7 +16,9 @@ import javax.annotation.ParametersAreNonnullByDefault; import org.apache.commons.lang.Validate; +import org.bukkit.configuration.InvalidConfigurationException; import org.bukkit.configuration.file.FileConfiguration; +import org.bukkit.configuration.file.YamlConfiguration; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; @@ -50,16 +52,23 @@ public static void unload() { @ParametersAreNonnullByDefault @Nullable - BufferedReader readLanguageFile(LanguagePreset lang, LanguageFile file) { + FileConfiguration readLanguageFile(LanguagePreset lang, LanguageFile file) throws IOException, InvalidConfigurationException { String path = file.getFilePath(lang.getLanguageCode()); - InputStream inputStream = getClass().getResourceAsStream(path); - - if (inputStream == null) { - // This file does not exist, we consider it "passed". + byte[] bytes; + try (InputStream inputStream = getClass().getResourceAsStream(path)) { + if (inputStream == null) { + // This file does not exist, we consider it "passed". + return null; + } + bytes = inputStream.readAllBytes(); + } + String contents = new String(bytes, StandardCharsets.UTF_8); + if (contents.trim().equals("---")) { return null; } - - return new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8)); + YamlConfiguration configuration = new YamlConfiguration(); + configuration.loadFromString(contents); + return configuration; } @ParametersAreNonnullByDefault diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/localization/TestColorCodes.java b/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/localization/TestColorCodes.java index 9be3d2710b..88371ac0ee 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/localization/TestColorCodes.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/localization/TestColorCodes.java @@ -1,17 +1,15 @@ package io.github.thebusybiscuit.slimefun4.core.services.localization; -import java.io.BufferedReader; -import java.io.IOException; -import java.util.regex.Pattern; - -import javax.annotation.ParametersAreNonnullByDefault; - +import org.bukkit.configuration.InvalidConfigurationException; import org.bukkit.configuration.file.FileConfiguration; -import org.bukkit.configuration.file.YamlConfiguration; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; +import javax.annotation.ParametersAreNonnullByDefault; +import java.io.IOException; +import java.util.regex.Pattern; + /** * We need to make sure that color codes are still working properly. *

@@ -24,7 +22,7 @@ *

* The test will catch occurences like "a& ", "b&Hello" or "7&", "5& a". * The test will however ignore valid color codes such as "a&a". - * + * * @author TheBusyBiscuit * */ @@ -38,15 +36,12 @@ class TestColorCodes extends AbstractLocaleRegexChecker { @ParametersAreNonnullByDefault @MethodSource("getAllLanguageFiles") @DisplayName("Test for mistakes in color codes for Slimefun locale files") - void testSpelling(LanguagePreset lang, LanguageFile file) throws IOException { - try (BufferedReader reader = readLanguageFile(lang, file)) { - if (reader == null) { - return; - } - - FileConfiguration config = YamlConfiguration.loadConfiguration(reader); - assertNoRegexMatchesForAllEntries(lang, file, config); + void testSpelling(LanguagePreset lang, LanguageFile file) throws IOException, InvalidConfigurationException { + FileConfiguration config = readLanguageFile(lang, file); + if (config == null) { + return; } + assertNoRegexMatchesForAllEntries(lang, file, config); } } diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/localization/TestSlimefunSpelling.java b/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/localization/TestSlimefunSpelling.java index c33bb4c11d..dd8b62be3a 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/localization/TestSlimefunSpelling.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/core/services/localization/TestSlimefunSpelling.java @@ -1,13 +1,12 @@ package io.github.thebusybiscuit.slimefun4.core.services.localization; -import java.io.BufferedReader; import java.io.IOException; import java.util.regex.Pattern; import javax.annotation.ParametersAreNonnullByDefault; +import org.bukkit.configuration.InvalidConfigurationException; import org.bukkit.configuration.file.FileConfiguration; -import org.bukkit.configuration.file.YamlConfiguration; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -16,7 +15,7 @@ * Your friendly neighbourhood spellcheck. * Brought to you by our Discord bot "@WalshBot". * No more incorrect spelling of "Slimefun". - * + * * @author TheBusyBiscuit * */ @@ -30,15 +29,12 @@ class TestSlimefunSpelling extends AbstractLocaleRegexChecker { @ParametersAreNonnullByDefault @MethodSource("getAllLanguageFiles") @DisplayName("Test correct spelling of Slimefun in language files") - void testSpelling(LanguagePreset lang, LanguageFile file) throws IOException { - try (BufferedReader reader = readLanguageFile(lang, file)) { - if (reader == null) { - return; - } - - FileConfiguration config = YamlConfiguration.loadConfiguration(reader); - assertNoRegexMatchesForAllEntries(lang, file, config); + void testSpelling(LanguagePreset lang, LanguageFile file) throws IOException, InvalidConfigurationException { + FileConfiguration config = readLanguageFile(lang, file); + if (config == null) { + return; } + assertNoRegexMatchesForAllEntries(lang, file, config); } } diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/TestDamageableItem.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/TestDamageableItem.java index d7aec62eec..7a97e33cf3 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/TestDamageableItem.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/TestDamageableItem.java @@ -20,7 +20,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.test.TestUtilities; import io.github.thebusybiscuit.slimefun4.test.mocks.MockDamageable; - +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedEnchantment; import be.seeseemelk.mockbukkit.MockBukkit; import be.seeseemelk.mockbukkit.ServerMock; @@ -82,8 +82,8 @@ void testDamageableItemDamagesItem() { @DisplayName("Test if DamageableItem cares about unbreaking levels") void testDamageableItemCaresUnbreaking() { MockDamageable noUnbreakingItem = getDummyItem("NU", true, null, null); - MockDamageable iiiUnbreakingItem = getDummyItem("IIIU", true, Enchantment.DURABILITY, 3); - MockDamageable xUnbreakingItem = getDummyItem("XU", true, Enchantment.DURABILITY, 10); + MockDamageable iiiUnbreakingItem = getDummyItem("IIIU", true, VersionedEnchantment.UNBREAKING, 3); + MockDamageable xUnbreakingItem = getDummyItem("XU", true, VersionedEnchantment.UNBREAKING, 10); ItemStack noUnbreakingItemIS = noUnbreakingItem.getItem().clone(); ItemStack iiiUnbreakingItemIS = iiiUnbreakingItem.getItem().clone(); ItemStack xUnbreakingItemIS = xUnbreakingItem.getItem().clone(); diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/TestClimbingPick.java b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/TestClimbingPick.java index 53181b2c1b..9a43bc12f5 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/TestClimbingPick.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/TestClimbingPick.java @@ -7,7 +7,6 @@ import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.BlockFace; -import org.bukkit.enchantments.Enchantment; import org.bukkit.inventory.ItemStack; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.Assertions; @@ -26,6 +25,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.test.TestUtilities; import io.github.thebusybiscuit.slimefun4.test.presets.SlimefunItemTest; +import io.github.thebusybiscuit.slimefun4.utils.compatibility.VersionedEnchantment; import io.github.thebusybiscuit.slimefun4.utils.tags.SlimefunTag; import be.seeseemelk.mockbukkit.MockBukkit; @@ -164,7 +164,7 @@ void testEfficiency() { private ItemStack getPickWithEfficiency(@Nonnull ClimbingPick pick, int level) { ItemStack item = pick.getItem().clone(); - item.addUnsafeEnchantment(Enchantment.DIG_SPEED, level); + item.addUnsafeEnchantment(VersionedEnchantment.EFFICIENCY, level); return item; } } 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 5bd37ce19d..e606840cbc 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 @@ -25,7 +25,6 @@ import io.github.thebusybiscuit.slimefun4.implementation.items.backpacks.Cooler; import io.github.thebusybiscuit.slimefun4.implementation.items.food.Juice; import io.github.thebusybiscuit.slimefun4.test.TestUtilities; - import be.seeseemelk.mockbukkit.MockBukkit; import be.seeseemelk.mockbukkit.ServerMock; diff --git a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestMinecraftVersion.java b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestMinecraftVersion.java index 72beee0091..74a2622cce 100644 --- a/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestMinecraftVersion.java +++ b/src/test/java/io/github/thebusybiscuit/slimefun4/utils/TestMinecraftVersion.java @@ -11,11 +11,27 @@ class TestMinecraftVersion { @Test @DisplayName("Test if Minecraft versions match themselves") void testMatches() { - Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_16.isMinecraftVersion(16)); - Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_17.isMinecraftVersion(17)); + Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_16.isMinecraftVersion(16, -1)); + Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_17.isMinecraftVersion(17, -1)); + Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_20_5.isMinecraftVersion(20, 5)); - Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_17.isMinecraftVersion(16)); - Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_16.isMinecraftVersion(0)); + Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_17.isMinecraftVersion(16, -1)); + Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_16.isMinecraftVersion(0, -1)); + Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_20_5.isMinecraftVersion(20, 4)); + } + + @Test + @DisplayName("Test if Minecraft versions match minor versions") + void testMatchesMinor() { + Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_16.isMinecraftVersion(16, 1)); + Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_16.isMinecraftVersion(16, 2)); + + Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_20.isMinecraftVersion(20, 4)); + Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_20_5.isMinecraftVersion(20, 6)); + + Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_20.isMinecraftVersion(20, 5)); + Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_16.isMinecraftVersion(17, 1)); + Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_20_5.isMinecraftVersion(20, 4)); } @Test @@ -24,6 +40,8 @@ void testAtLeast() { Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_18.isAtLeast(MinecraftVersion.MINECRAFT_1_16)); Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_17.isAtLeast(MinecraftVersion.MINECRAFT_1_16)); Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_17.isAtLeast(MinecraftVersion.MINECRAFT_1_17)); + Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_20.isAtLeast(MinecraftVersion.MINECRAFT_1_20)); + Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_20_5.isAtLeast(MinecraftVersion.MINECRAFT_1_20)); Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_17.isAtLeast(MinecraftVersion.MINECRAFT_1_18)); } @@ -48,6 +66,24 @@ void testIsBefore() { Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_17.isBefore(MinecraftVersion.MINECRAFT_1_16)); } + @Test + @DisplayName("Test if Minecraft versions #isBefore behaves correctly for minor versions") + void testIsBeforeMinor() { + Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_18.isBefore(16, 5)); + Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_18.isBefore(17, 1)); + Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_18.isBefore(18, 0)); + Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_18.isBefore(18, 1)); + + Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_20.isBefore(20, 0)); + Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_20.isBefore(20, 2)); + Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_20.isBefore(20, 4)); + Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_20.isBefore(20, 5)); + + Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_20_5.isBefore(20, 4)); + Assertions.assertFalse(MinecraftVersion.MINECRAFT_1_20_5.isBefore(20, 5)); + Assertions.assertTrue(MinecraftVersion.MINECRAFT_1_20_5.isBefore(20, 6)); + } + @Test @DisplayName("Test correct behaviour for MinecraftVersion.UNKNOWN.isBefore(...)") void testIsBeforeUnknown() { 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 cdb132d91c..99f7c6100f 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 @@ -34,7 +34,7 @@ /** * This test checks if biome maps work across multiple versions of Minecraft. * A similar test can be written for Material Tags :? - * + * * @author TheBusyBiscuit * */ @@ -45,6 +45,9 @@ class TestBiomeMapCompatibility { @BeforeAll public static void load() { MockBukkit.mock(); + // Needed for JsonUtils.parseString which relies on a valid Slimefun plugin instance to determine the current + // MinecraftVersion + MockBukkit.load(Slimefun.class); for (MinecraftVersion version : MinecraftVersion.values()) { if (!version.isVirtual()) { @@ -91,7 +94,7 @@ void testCompatibilities(String name, MinecraftVersion version) { /** * We manually specify here which biome map works on which minecraft versions. - * + * * @return A {@link Stream} of {@link Arguments} for our unit test. */ private static @Nonnull Stream biomeMaps() { @@ -105,37 +108,37 @@ void testCompatibilities(String name, MinecraftVersion version) { MinecraftVersion.MINECRAFT_1_19, MinecraftVersion.MINECRAFT_1_20 }); - + testCases.put("oil_v1.16", new MinecraftVersion[] { MinecraftVersion.MINECRAFT_1_16, MinecraftVersion.MINECRAFT_1_17 }); - + testCases.put("oil_v1.18", new MinecraftVersion[] { MinecraftVersion.MINECRAFT_1_18, MinecraftVersion.MINECRAFT_1_19, MinecraftVersion.MINECRAFT_1_20 }); - + testCases.put("salt_v1.16", new MinecraftVersion[] { MinecraftVersion.MINECRAFT_1_16, MinecraftVersion.MINECRAFT_1_17 }); - + testCases.put("salt_v1.18", new MinecraftVersion[] { MinecraftVersion.MINECRAFT_1_18, MinecraftVersion.MINECRAFT_1_19, MinecraftVersion.MINECRAFT_1_20 }); - + testCases.put("uranium_v1.16", new MinecraftVersion[] { MinecraftVersion.MINECRAFT_1_16 }); - + testCases.put("uranium_v1.17", new MinecraftVersion[] { MinecraftVersion.MINECRAFT_1_17 }); - + testCases.put("uranium_v1.18", new MinecraftVersion[] { MinecraftVersion.MINECRAFT_1_18, MinecraftVersion.MINECRAFT_1_19, diff --git a/src/test/resources/biomes/1.20.5+.json b/src/test/resources/biomes/1.20.5+.json new file mode 100644 index 0000000000..dfe92f1834 --- /dev/null +++ b/src/test/resources/biomes/1.20.5+.json @@ -0,0 +1,67 @@ +[ + "minecraft:ocean", + "minecraft:plains", + "minecraft:desert", + "minecraft:windswept_hills", + "minecraft:forest", + "minecraft:taiga", + "minecraft:swamp", + "minecraft:mangrove_swamp", + "minecraft:river", + "minecraft:nether_wastes", + "minecraft:the_end", + "minecraft:frozen_ocean", + "minecraft:frozen_river", + "minecraft:snowy_plains", + "minecraft:mushroom_fields", + "minecraft:beach", + "minecraft:jungle", + "minecraft:sparse_jungle", + "minecraft:deep_ocean", + "minecraft:stony_shore", + "minecraft:snowy_beach", + "minecraft:birch_forest", + "minecraft:dark_forest", + "minecraft:snowy_taiga", + "minecraft:old_growth_pine_taiga", + "minecraft:windswept_forest", + "minecraft:savanna", + "minecraft:savanna_plateau", + "minecraft:badlands", + "minecraft:wooded_badlands", + "minecraft:small_end_islands", + "minecraft:end_midlands", + "minecraft:end_highlands", + "minecraft:end_barrens", + "minecraft:warm_ocean", + "minecraft:lukewarm_ocean", + "minecraft:cold_ocean", + "minecraft:deep_lukewarm_ocean", + "minecraft:deep_cold_ocean", + "minecraft:deep_frozen_ocean", + "minecraft:the_void", + "minecraft:sunflower_plains", + "minecraft:windswept_gravelly_hills", + "minecraft:flower_forest", + "minecraft:ice_spikes", + "minecraft:old_growth_birch_forest", + "minecraft:old_growth_spruce_taiga", + "minecraft:windswept_savanna", + "minecraft:eroded_badlands", + "minecraft:bamboo_jungle", + "minecraft:soul_sand_valley", + "minecraft:crimson_forest", + "minecraft:warped_forest", + "minecraft:basalt_deltas", + "minecraft:dripstone_caves", + "minecraft:lush_caves", + "minecraft:deep_dark", + "minecraft:meadow", + "minecraft:grove", + "minecraft:snowy_slopes", + "minecraft:frozen_peaks", + "minecraft:jagged_peaks", + "minecraft:stony_peaks", + "minecraft:cherry_grove", + "minecraft:custom", +] \ No newline at end of file