QUOTE: Life is a journey, not a destination.

fix: Fixed version API changes - poppy - A feature-rich Minecraft plugin which enhances gaming experience

poppy

A feature-rich Minecraft plugin which enhances gaming experience
git clone git://192.168.2.2/poppy
Log | Files | Refs | README

commit bde531f6fc60bc2a194062c3f8fc8e8071ec3b2f
parent 59cf650309b16243572e63ec617bae16686f0c7a
Author: chunksize <reisingerluca@gmail.com>
Date:   Thu, 29 Aug 2024 03:48:30 +0200

fix: Fixed version API changes

Diffstat:
Msrc/poppy/Utils.java | 12+-----------
Msrc/poppy/modules/AutoBreakerModule.java | 2+-
Msrc/poppy/modules/CauldronModule.java | 3+--
Msrc/poppy/modules/ChairModule.java | 2+-
Msrc/poppy/modules/CommonModule.java | 2+-
5 files changed, 5 insertions(+), 16 deletions(-)

diff --git a/src/poppy/Utils.java b/src/poppy/Utils.java @@ -10,7 +10,6 @@ import org.bukkit.entity.Entity; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.Plugin; -import org.bukkit.GameMode; import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.ChatMessageType; @@ -87,7 +86,7 @@ public class Utils public static void sendActionMessage(Player player, String message) { - player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(message)); + player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacy(message)); } public static void sendCountdown(Plugin plugin, final String message, final int time, Runnable runnable) @@ -197,15 +196,6 @@ public class Utils player.sendMessage(ChatColor.RED + "The warppoint cannot be located in this world!"); return false; } - - final int fee = Utils.calcTravelFee(player.getLocation(), location); - final String unit = fee == 1 ? "emerald" : "emeralds"; - - // if(!payFee(player, Material.EMERALD, fee) && player.getGameMode() == GameMode.SURVIVAL) - // { - // player.sendMessage(ChatColor.RED + "Not enough emeralds to teleport! Travel fee: " + fee + " " + unit); - // return false; - // } if(player.getVehicle() != null) { diff --git a/src/poppy/modules/AutoBreakerModule.java b/src/poppy/modules/AutoBreakerModule.java @@ -221,7 +221,7 @@ public class AutoBreakerModule implements Listener public void setDamage(ItemStack item, Dispenser dispenser) { Bukkit.getScheduler().runTaskLater(plugin, () -> { - if(Utils.randomlyReduceDurability(item.getEnchantmentLevel(Enchantment.DURABILITY))) + if(Utils.randomlyReduceDurability(item.getEnchantmentLevel(Enchantment.UNBREAKING))) { final ItemMeta itemMeta = item.getItemMeta(); final int slot = dispenser.getInventory().first(item); diff --git a/src/poppy/modules/CauldronModule.java b/src/poppy/modules/CauldronModule.java @@ -13,7 +13,6 @@ import org.bukkit.event.block.BlockDispenseEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.PotionMeta; import org.bukkit.plugin.Plugin; -import org.bukkit.potion.PotionData; import org.bukkit.potion.PotionType; @@ -72,7 +71,7 @@ public class CauldronModule implements Listener final Levelled cauldronData = (Levelled) cauldron.getBlockData(); final ItemStack waterBottle = new ItemStack(Material.POTION); final PotionMeta potionMeta = (PotionMeta) waterBottle.getItemMeta(); - potionMeta.setBasePotionData(new PotionData(PotionType.WATER)); + potionMeta.setBasePotionType(PotionType.WATER); waterBottle.setItemMeta(potionMeta); if(cauldronData.getLevel() == 1) diff --git a/src/poppy/modules/ChairModule.java b/src/poppy/modules/ChairModule.java @@ -17,8 +17,8 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.block.Action; import org.bukkit.event.block.BlockBreakEvent; +import org.bukkit.event.entity.EntityDismountEvent; import org.bukkit.event.player.PlayerInteractEvent; -import org.spigotmc.event.entity.EntityDismountEvent; import poppy.Utils; diff --git a/src/poppy/modules/CommonModule.java b/src/poppy/modules/CommonModule.java @@ -174,7 +174,7 @@ public class CommonModule implements Listener { final Player player = (Player) event.getEntity(); - player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 20 * 2, 1)); + player.addPotionEffect(new PotionEffect(PotionEffectType.SLOWNESS, 20 * 2, 1)); event.setDamage(1); } }