Dieser Commit ist enthalten in:
Ursprung
9d914e9af8
Commit
803703a6e0
@ -20,6 +20,8 @@
|
|||||||
package de.steamwar.misslewars.items;
|
package de.steamwar.misslewars.items;
|
||||||
|
|
||||||
import de.steamwar.misslewars.Config;
|
import de.steamwar.misslewars.Config;
|
||||||
|
import net.md_5.bungee.api.ChatMessageType;
|
||||||
|
import net.md_5.bungee.api.chat.TextComponent;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
@ -29,6 +31,7 @@ import org.bukkit.event.entity.ProjectileLaunchEvent;
|
|||||||
import org.bukkit.inventory.ItemFlag;
|
import org.bukkit.inventory.ItemFlag;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.ItemMeta;
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -55,10 +58,6 @@ public abstract class SpecialItem {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack createItem(Material material, String name, int amount) {
|
|
||||||
return createItem(material, name, amount, new ArrayList<>());
|
|
||||||
}
|
|
||||||
|
|
||||||
public ItemStack createItem(Material material, String name, int amount, List<String> lore) {
|
public ItemStack createItem(Material material, String name, int amount, List<String> lore) {
|
||||||
ItemStack item = new ItemStack(material, amount);
|
ItemStack item = new ItemStack(material, amount);
|
||||||
ItemMeta meta = item.getItemMeta();
|
ItemMeta meta = item.getItemMeta();
|
||||||
@ -71,6 +70,10 @@ public abstract class SpecialItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean handleUse(ItemStack item, Player player) {
|
public static boolean handleUse(ItemStack item, Player player) {
|
||||||
|
if (player.hasPotionEffect(PotionEffectType.LEVITATION)) {
|
||||||
|
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText("§cDu kannst dieses Item derzeit nicht nutzen!"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return handleUse(item, player, missileItems) || handleUse(item, player, supportItems);
|
return handleUse(item, player, missileItems) || handleUse(item, player, supportItems);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren