diff --git a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java index e532a6f..f60499f 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java @@ -3,6 +3,7 @@ package de.steamwar.bausystem; import de.steamwar.bausystem.commands.*; import de.steamwar.bausystem.world.*; import de.steamwar.core.CommandRemover; +import de.steamwar.core.Core; import de.steamwar.scoreboard.SWScoreboard; import de.steamwar.sql.SteamwarUser; import org.bukkit.Bukkit; @@ -20,8 +21,6 @@ import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.plugin.java.JavaPlugin; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; import org.bukkit.scheduler.BukkitTask; import java.io.File; @@ -282,6 +281,16 @@ public class BauSystem extends JavaPlugin implements Listener { } } Player p = (Player) e.getWhoClicked(); + + Material material = stack.getType(); + if (material == Material.POTION || material == Material.SPLASH_POTION || material == Material.LINGERING_POTION) + stack.setType(Material.MILK_BUCKET); + + if(Core.getVersion() < 14){ + e.setCurrentItem(stack); + return; + } + if (stack.getItemMeta().hasAttributeModifiers()) { ItemMeta meta = stack.getItemMeta(); for (Attribute a : Attribute.values()) @@ -289,9 +298,6 @@ public class BauSystem extends JavaPlugin implements Listener { stack.setItemMeta(meta); Bukkit.getLogger().log(Level.SEVERE, "Spieler " + p.getName() + " (" + p.getUniqueId().toString() + ") hat versucht ein Item mit einem Attribute-Modifier zu bekommen."); } - Material material = stack.getType(); - if (material == Material.POTION || material == Material.SPLASH_POTION || material == Material.LINGERING_POTION) - stack.setType(Material.MILK_BUCKET); e.setCurrentItem(stack); } }