mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 03:35:51 +00:00
Removed unused imports
This commit is contained in:
parent
26750e5cfc
commit
e0d12f467a
@ -1,15 +1,19 @@
|
||||
package me.mrCookieSlime.Slimefun.Objects.SlimefunItem.items;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Item;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import me.mrCookieSlime.Slimefun.SlimefunPlugin;
|
||||
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
|
||||
import me.mrCookieSlime.Slimefun.Lists.SlimefunItems;
|
||||
import me.mrCookieSlime.Slimefun.Objects.Category;
|
||||
@ -17,13 +21,8 @@ import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem;
|
||||
import me.mrCookieSlime.Slimefun.Objects.handlers.ItemDropHandler;
|
||||
import me.mrCookieSlime.Slimefun.Setup.Messages;
|
||||
import me.mrCookieSlime.Slimefun.Setup.SlimefunManager;
|
||||
import me.mrCookieSlime.Slimefun.SlimefunPlugin;
|
||||
import me.mrCookieSlime.Slimefun.api.Slimefun;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public class SoulboundRune extends SimpleSlimefunItem<ItemDropHandler> {
|
||||
|
||||
public SoulboundRune(Category category, ItemStack item, String id, RecipeType type, ItemStack[] recipe) {
|
||||
@ -35,9 +34,12 @@ public class SoulboundRune extends SimpleSlimefunItem<ItemDropHandler> {
|
||||
return (e, p, i) -> {
|
||||
ItemStack item = i.getItemStack();
|
||||
if (SlimefunManager.isItemSimiliar(item, SlimefunItems.RUNE_SOULBOUND, true)) {
|
||||
if (!Slimefun.hasUnlocked(p, SlimefunItems.RUNE_SOULBOUND, true)) return true;
|
||||
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunPlugin.instance, () -> {
|
||||
|
||||
if (!Slimefun.hasUnlocked(p, SlimefunItems.RUNE_SOULBOUND, true)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunPlugin.instance, () -> {
|
||||
// Being sure the entity is still valid and not picked up or whatsoever.
|
||||
if (!i.isValid()) return;
|
||||
|
||||
@ -46,6 +48,7 @@ public class SoulboundRune extends SimpleSlimefunItem<ItemDropHandler> {
|
||||
entity -> entity instanceof Item && !SlimefunManager.isItemSoulbound(((Item) entity).getItemStack()) &&
|
||||
!SlimefunManager.isItemSimiliar(((Item) entity).getItemStack(), SlimefunItems.RUNE_SOULBOUND, true)
|
||||
);
|
||||
|
||||
if (entites.isEmpty()) return;
|
||||
|
||||
Entity entity = entites.stream().findFirst().get();
|
||||
@ -56,10 +59,7 @@ public class SoulboundRune extends SimpleSlimefunItem<ItemDropHandler> {
|
||||
e.setCancelled(true);
|
||||
|
||||
ItemMeta enchMeta = ench.getItemMeta();
|
||||
|
||||
List<String> lore;
|
||||
if (enchMeta.hasLore()) lore = enchMeta.getLore();
|
||||
else lore = new ArrayList<>();
|
||||
List<String> lore = enchMeta.hasLore() ? enchMeta.getLore(): new ArrayList<>();
|
||||
|
||||
// This lightning is just an effect, it deals no damage.
|
||||
l.getWorld().strikeLightningEffect(l);
|
||||
@ -83,10 +83,12 @@ public class SoulboundRune extends SimpleSlimefunItem<ItemDropHandler> {
|
||||
Messages.local.sendTranslation(p, "messages.soulbound-rune.success", true);
|
||||
}
|
||||
}, 10L);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
Messages.local.sendTranslation(p, "messages.soulbound-rune.fail", true);
|
||||
}
|
||||
}, 20L);
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user