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..f0359d5cd6 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 @@ -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(PotionEffectType.RESISTANCE, 600, 20)); Slimefun.getLocalization().sendMessage(p, "machines.TELEPORTER.invulnerability"); } 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..6c09e97501 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 @@ -58,7 +58,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(Particle.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..bdb4778dfd 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 @@ -51,7 +51,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(Enchantment.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..96043a9e95 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 @@ -25,11 +25,11 @@ */ public enum RadiationSymptom { - SLOW(10, PotionEffectType.SLOW, 3), + SLOW(10, PotionEffectType.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, PotionEffectType.INSTANT_DAMAGE, 49); private final int minExposure; private final PotionEffect potionEffect; 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..aa644d2d02 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/SlimefunItems.java @@ -192,8 +192,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(Enchantment.UNBREAKING, 4); + BLADE_OF_VAMPIRES.addUnsafeEnchantment(Enchantment.SHARPNESS, 2); } /* Bows */ @@ -212,8 +212,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(Enchantment.UNBREAKING, 10); + COBALT_PICKAXE.addUnsafeEnchantment(Enchantment.EFFICIENCY, 6); } /* Armor */ @@ -304,7 +304,7 @@ private SlimefunItems() {} static { Map cactusEnchs = new HashMap<>(); cactusEnchs.put(Enchantment.THORNS, 3); - cactusEnchs.put(Enchantment.DURABILITY, 6); + cactusEnchs.put(Enchantment.UNBREAKING, 6); CACTUS_HELMET.addUnsafeEnchantments(cactusEnchs); CACTUS_CHESTPLATE.addUnsafeEnchantments(cactusEnchs); @@ -312,8 +312,8 @@ private SlimefunItems() {} CACTUS_BOOTS.addUnsafeEnchantments(cactusEnchs); Map damascusEnchs = new HashMap<>(); - damascusEnchs.put(Enchantment.DURABILITY, 5); - damascusEnchs.put(Enchantment.PROTECTION_ENVIRONMENTAL, 5); + damascusEnchs.put(Enchantment.UNBREAKING, 5); + damascusEnchs.put(Enchantment.PROTECTION, 5); DAMASCUS_STEEL_HELMET.addUnsafeEnchantments(damascusEnchs); DAMASCUS_STEEL_CHESTPLATE.addUnsafeEnchantments(damascusEnchs); @@ -321,8 +321,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(Enchantment.UNBREAKING, 9); + reinforcedEnchs.put(Enchantment.PROTECTION, 9); REINFORCED_ALLOY_HELMET.addUnsafeEnchantments(reinforcedEnchs); REINFORCED_ALLOY_CHESTPLATE.addUnsafeEnchantments(reinforcedEnchs); @@ -330,22 +330,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(Enchantment.UNBREAKING, 6); + gildedEnchs.put(Enchantment.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(Enchantment.UNBREAKING, 10); + GOLDEN_CHESTPLATE_12K.addUnsafeEnchantment(Enchantment.UNBREAKING, 10); + GOLDEN_LEGGINGS_12K.addUnsafeEnchantment(Enchantment.UNBREAKING, 10); + GOLDEN_BOOTS_12K.addUnsafeEnchantment(Enchantment.UNBREAKING, 10); Map slimeEnchs = new HashMap<>(); - slimeEnchs.put(Enchantment.DURABILITY, 4); - slimeEnchs.put(Enchantment.PROTECTION_ENVIRONMENTAL, 2); + slimeEnchs.put(Enchantment.UNBREAKING, 4); + slimeEnchs.put(Enchantment.PROTECTION, 2); SLIME_HELMET_STEEL.addUnsafeEnchantments(slimeEnchs); SLIME_CHESTPLATE_STEEL.addUnsafeEnchantments(slimeEnchs); @@ -353,8 +353,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(Enchantment.UNBREAKING, 4); + beeEnchs.put(Enchantment.PROTECTION, 2); BEE_HELMET.addUnsafeEnchantments(beeEnchs); BEE_WINGS.addUnsafeEnchantments(beeEnchs); @@ -567,10 +567,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(Enchantment.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(Enchantment.AQUA_AFFINITY, 1); + STAFF_STORM.addUnsafeEnchantment(Enchantment.UNBREAKING, 1); } /* Multiblocks */ 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..9b7d87c893 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 @@ -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(Particle.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..932f15d191 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 @@ -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(Particle.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..379f6ef691 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 @@ -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(Particle.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 56707206d4..a68ad6fdf5 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 @@ -110,9 +110,9 @@ 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 MOOSHROOM: case SHEEP: - case SNOWMAN: + case SNOW_GOLEM: Slimefun.getLocalization().sendMessage(e.getPlayer(), "messages.multi-tool.not-shears"); e.setCancelled(true); break; 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 66f63bd258..39a313219b 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 @@ -10,9 +10,6 @@ import org.bukkit.Material; 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; @@ -36,14 +33,16 @@ public class AutoBrewer extends AContainer implements NotHopperable { private static final Map potionRecipes = new EnumMap<>(Material.class); private static final Map fermentations = new EnumMap<>(PotionType.class); + private static final Map extendedPotions = new EnumMap<>(PotionType.class); + private static final Map upgradedPotions = new EnumMap<>(PotionType.class); static { - potionRecipes.put(Material.SUGAR, PotionType.SPEED); - potionRecipes.put(Material.RABBIT_FOOT, PotionType.JUMP); + potionRecipes.put(Material.SUGAR, PotionType.SWIFTNESS); + potionRecipes.put(Material.RABBIT_FOOT, PotionType.LEAPING); potionRecipes.put(Material.BLAZE_POWDER, PotionType.STRENGTH); - potionRecipes.put(Material.GLISTERING_MELON_SLICE, PotionType.INSTANT_HEAL); + potionRecipes.put(Material.GLISTERING_MELON_SLICE, PotionType.HEALING); potionRecipes.put(Material.SPIDER_EYE, PotionType.POISON); - potionRecipes.put(Material.GHAST_TEAR, PotionType.REGEN); + potionRecipes.put(Material.GHAST_TEAR, PotionType.REGENERATION); potionRecipes.put(Material.MAGMA_CREAM, PotionType.FIRE_RESISTANCE); potionRecipes.put(Material.PUFFERFISH, PotionType.WATER_BREATHING); potionRecipes.put(Material.GOLDEN_CARROT, PotionType.NIGHT_VISION); @@ -54,6 +53,28 @@ public class AutoBrewer extends AContainer implements NotHopperable { fermentations.put(PotionType.HEALING, PotionType.HARMING); fermentations.put(PotionType.POISON, PotionType.HARMING); fermentations.put(PotionType.NIGHT_VISION, PotionType.INVISIBILITY); + + extendedPotions.put(PotionType.NIGHT_VISION, PotionType.LONG_NIGHT_VISION); + extendedPotions.put(PotionType.INVISIBILITY, PotionType.LONG_INVISIBILITY); + extendedPotions.put(PotionType.LEAPING, PotionType.LONG_LEAPING); + extendedPotions.put(PotionType.FIRE_RESISTANCE, PotionType.LONG_FIRE_RESISTANCE); + extendedPotions.put(PotionType.SWIFTNESS, PotionType.LONG_SWIFTNESS); + extendedPotions.put(PotionType.SLOWNESS, PotionType.LONG_SLOWNESS); + extendedPotions.put(PotionType.WATER_BREATHING, PotionType.LONG_WATER_BREATHING); + extendedPotions.put(PotionType.POISON, PotionType.LONG_POISON); + extendedPotions.put(PotionType.REGENERATION, PotionType.LONG_REGENERATION); + extendedPotions.put(PotionType.STRENGTH, PotionType.LONG_STRENGTH); + extendedPotions.put(PotionType.WEAKNESS, PotionType.LONG_WEAKNESS); + extendedPotions.put(PotionType.TURTLE_MASTER, PotionType.LONG_TURTLE_MASTER); + extendedPotions.put(PotionType.SLOW_FALLING, PotionType.LONG_SLOW_FALLING); + + upgradedPotions.put(PotionType.LEAPING, PotionType.STRONG_LEAPING); + upgradedPotions.put(PotionType.SWIFTNESS, PotionType.STRONG_SWIFTNESS); + upgradedPotions.put(PotionType.SLOWNESS, PotionType.STRONG_SLOWNESS); + upgradedPotions.put(PotionType.POISON, PotionType.STRONG_POISON); + upgradedPotions.put(PotionType.REGENERATION, PotionType.STRONG_REGENERATION); + upgradedPotions.put(PotionType.STRENGTH, PotionType.STRONG_STRENGTH); + upgradedPotions.put(PotionType.TURTLE_MASTER, PotionType.STRONG_TURTLE_MASTER); } @ParametersAreNonnullByDefault @@ -105,9 +126,7 @@ public AutoBrewer(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipe @ParametersAreNonnullByDefault private @Nullable ItemStack brew(Material input, Material potionType, PotionMeta potion) { - PotionType data = potion.getBasePotionType(); - - PotionType type = data.getType(); + PotionType type = potion.getBasePotionType(); if (type == PotionType.WATER) { if (input == Material.FERMENTED_SPIDER_EYE) { potion.setBasePotionType(PotionType.WEAKNESS); @@ -127,19 +146,19 @@ public AutoBrewer(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipe potion.setBasePotionType(fermented); return new ItemStack(potionType); } - } else if (input == Material.REDSTONE && type.isExtendable() && !data) { + } else if (input == Material.REDSTONE && extendedPotions.containsKey(type)) { // Fixes #3390 - Potions can only be either extended or upgraded. Not both. - potion.setBasePotionData(new PotionData(type, true, false)); + potion.setBasePotionType(extendedPotions.get(type)); return new ItemStack(potionType); - } else if (input == Material.GLOWSTONE_DUST && type.isUpgradeable() && !data.isExtended()) { + } else if (input == Material.GLOWSTONE_DUST && upgradedPotions.containsKey(type)) { // Fixes #3390 - Potions can only be either extended or upgraded. Not both. - potion.setBasePotionData(new PotionData(type, false, true)); + potion.setBasePotionType(upgradedPotions.get(type)); return new ItemStack(potionType); } else if (type == PotionType.AWKWARD) { PotionType potionRecipe = potionRecipes.get(input); if (potionRecipe != null) { - potion.setBasePotionData(new PotionData(potionRecipe, false, false)); + potion.setBasePotionType(potionRecipe); return new ItemStack(potionType); } } 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 b0bfacd9de..03decc18c3 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 @@ -40,7 +40,6 @@ import me.mrCookieSlime.Slimefun.api.inventory.BlockMenu; import me.mrCookieSlime.Slimefun.api.inventory.BlockMenuPreset; import org.bukkit.inventory.meta.PotionMeta; -import org.bukkit.potion.PotionData; import org.bukkit.potion.PotionType; /** @@ -218,7 +217,7 @@ 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)); + meta.setBasePotionType(PotionType.WATER); waterBottle.setItemMeta(meta); return waterBottle; default: 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..3b33954b6b 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 @@ -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(Particle.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..153bf0d611 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 @@ -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(Particle.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..543edd9875 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 @@ -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(Particle.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(Particle.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..0022b06d21 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 @@ -140,7 +140,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(Particle.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..e842ace617 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 @@ -64,7 +64,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(Particle.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..c82bdb1057 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 @@ -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(PotionEffectType.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..3e98a4fab1 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 @@ -32,10 +32,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(PotionEffectType.SLOWNESS); + curedEffects.add(PotionEffectType.MINING_FATIGUE); curedEffects.add(PotionEffectType.WEAKNESS); - curedEffects.add(PotionEffectType.CONFUSION); + curedEffects.add(PotionEffectType.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..f2b7cea381 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 @@ -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(PotionEffectType.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..b3e5b8f2f2 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 @@ -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(Particle.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..73da88a5bc 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 @@ -147,7 +147,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(Enchantment.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..43275682eb 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 @@ -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(Particle.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..c1daaf6821 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 @@ -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(PotionEffectType.SLOWNESS, 20 * 2, 10)); + n.addPotionEffect(new PotionEffect(PotionEffectType.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 12937e45a4..e2a6f0216d 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 @@ -374,7 +374,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(Enchantment.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..a6b2be2470 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 @@ -301,7 +301,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) && Enchantment.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 +310,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(Enchantment.FORTUNE, random.nextInt(3) + 3); } } @@ -351,7 +351,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(Enchantment.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/tasks/AncientAltarTask.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/tasks/AncientAltarTask.java index b32e719efc..1bc174e740 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 @@ -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(Particle.WITCH, dropLocation, 16, 1.2F, 0F, 1.2F); + dropLocation.getWorld().spawnParticle(Particle.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(Particle.ENCHANT, loc, 16, 0.3F, 0.2F, 0.3F); + dropLocation.getWorld().spawnParticle(Particle.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(Particle.ENCHANT, pedestal.getLocation().add(0.5, 1.5, 0.5), 16, 0.3F, 0.2F, 0.3F); + dropLocation.getWorld().spawnParticle(Particle.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/utils/FireworkUtils.java b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/FireworkUtils.java index 808c5364ce..e96633539c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/FireworkUtils.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/FireworkUtils.java @@ -39,7 +39,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, EntityType.FIREWORK_ROCKET); 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..15e8301ca6 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/utils/SlimefunUtils.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/utils/SlimefunUtils.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.Base64; import java.util.List; +import java.util.Objects; import java.util.Optional; import java.util.OptionalInt; @@ -485,8 +486,8 @@ 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 Objects.equals(potionMeta.getBasePotionType(), sfPotionMeta.getBasePotionType()); } return true;