diff --git a/pom.xml b/pom.xml index 1cc216d1f4..ad57504c87 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ 16 - 1.20.4 + 1.20.5 https://hub.spigotmc.org/javadocs/spigot/ 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..66f63bd258 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 @@ -11,6 +11,8 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.PotionMeta; import org.bukkit.potion.PotionData; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; import org.bukkit.potion.PotionType; import io.github.bakedlibs.dough.inventory.InvUtils; @@ -48,10 +50,9 @@ public class AutoBrewer extends AContainer implements NotHopperable { 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(PotionType.LEAPING, PotionType.SLOWNESS); + fermentations.put(PotionType.HEALING, PotionType.HARMING); + fermentations.put(PotionType.POISON, PotionType.HARMING); fermentations.put(PotionType.NIGHT_VISION, PotionType.INVISIBILITY); } @@ -104,15 +105,15 @@ public AutoBrewer(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipe @ParametersAreNonnullByDefault private @Nullable ItemStack brew(Material input, Material potionType, PotionMeta potion) { - PotionData data = potion.getBasePotionData(); + PotionType data = potion.getBasePotionType(); PotionType type = data.getType(); if (type == PotionType.WATER) { if (input == Material.FERMENTED_SPIDER_EYE) { - potion.setBasePotionData(new PotionData(PotionType.WEAKNESS, false, false)); + potion.setBasePotionType(PotionType.WEAKNESS); return new ItemStack(potionType); } else if (input == Material.NETHER_WART) { - potion.setBasePotionData(new PotionData(PotionType.AWKWARD, false, false)); + potion.setBasePotionType(PotionType.AWKWARD); return new ItemStack(potionType); } else if (potionType == Material.POTION && input == Material.GUNPOWDER) { return new ItemStack(Material.SPLASH_POTION); @@ -123,10 +124,10 @@ public AutoBrewer(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipe PotionType fermented = fermentations.get(type); if (fermented != null) { - potion.setBasePotionData(new PotionData(fermented, data.isExtended(), data.isUpgraded())); + potion.setBasePotionType(fermented); return new ItemStack(potionType); } - } else if (input == Material.REDSTONE && type.isExtendable() && !data.isUpgraded()) { + } else if (input == Material.REDSTONE && type.isExtendable() && !data) { // Fixes #3390 - Potions can only be either extended or upgraded. Not both. potion.setBasePotionData(new PotionData(type, true, false)); return new ItemStack(potionType); 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..84cfffff2d 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 @@ -11,7 +11,6 @@ import org.bukkit.NamespacedKey; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.PotionMeta; -import org.bukkit.potion.PotionData; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import org.bukkit.potion.PotionType; @@ -378,7 +377,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(PotionEffectType.JUMP_BOOST, 300, 5)}, SoundEffect.SLIME_BOOTS_FALL_SOUND) .register(plugin); @@ -839,7 +838,7 @@ public static void setup(@Nonnull Slimefun plugin) { ItemStack weaknessPotion = new ItemStack(Material.POTION); PotionMeta meta = (PotionMeta) weaknessPotion.getItemMeta(); - meta.setBasePotionData(new PotionData(PotionType.WEAKNESS, false, false)); + meta.setBasePotionType(PotionType.WEAKNESS); weaknessPotion.setItemMeta(meta); new MagicalZombiePills(itemGroups.magicalGadgets, SlimefunItems.MAGICAL_ZOMBIE_PILLS, RecipeType.MAGIC_WORKBENCH, @@ -907,7 +906,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(PotionEffectType.STRENGTH, 3600, 2)) .register(plugin); new Talisman(SlimefunItems.TALISMAN_KNIGHT, @@ -917,7 +916,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(PotionEffectType.HASTE, 800, 2)) .register(plugin); new Talisman(SlimefunItems.TALISMAN_WISE, @@ -1085,7 +1084,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(PotionEffectType.JUMP_BOOST, 300, 5)}, SoundEffect.SLIME_BOOTS_FALL_SOUND) .register(plugin); @@ -2646,7 +2645,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(PotionEffectType.JUMP_BOOST, 300, 2)}, SoundEffect.BEE_BOOTS_FALL_SOUND) .register(plugin); 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..1d78469b53 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,8 @@ 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.itemstack.ItemStackWrapper; /** @@ -55,10 +53,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(PotionEffectType.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(PotionEffectType.SLOWNESS, 400, 1)); + effects.add(new PotionEffect(PotionEffectType.MINING_FATIGUE, 400, 1)); radiationEffects = Collections.unmodifiableSet(effects); }