mirror of
https://github.com/darksaid98/nightcore-spigot.git
synced 2026-12-02 22:17:42 +00:00
revert listener rename
This commit is contained in:
1 parent
085436c6ca
commit
c1e4711894
5 files changed
+9
-19
No files matched your search
@@ -3,7 +3,7 @@ package su.nightexpress.nightcore.manager;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import su.nightexpress.nightcore.NightCorePlugin;
|
||||
|
||||
public abstract class AbstractListener<P extends NightCorePlugin> implements SimpleListener {
|
||||
public abstract class AbstractListener<P extends NightCorePlugin> implements SimpeListener {
|
||||
|
||||
@NotNull
|
||||
public final P plugin;
|
||||
|
||||
@@ -11,7 +11,7 @@ import java.util.Set;
|
||||
|
||||
public abstract class AbstractManager<P extends NightCorePlugin> extends SimpleManager<P> {
|
||||
|
||||
protected final Set<SimpleListener> listeners;
|
||||
protected final Set<SimpeListener> listeners;
|
||||
protected final List<UniTask> tasks;
|
||||
|
||||
public AbstractManager(@NotNull P plugin) {
|
||||
@@ -24,12 +24,12 @@ public abstract class AbstractManager<P extends NightCorePlugin> extends SimpleM
|
||||
public void shutdown() {
|
||||
this.tasks.forEach(UniTask::stop);
|
||||
this.tasks.clear();
|
||||
this.listeners.forEach(SimpleListener::unregisterListeners);
|
||||
this.listeners.forEach(SimpeListener::unregisterListeners);
|
||||
this.listeners.clear();
|
||||
super.shutdown();
|
||||
}
|
||||
|
||||
protected void addListener(@NotNull SimpleListener listener) {
|
||||
protected void addListener(@NotNull SimpeListener listener) {
|
||||
if (this.listeners.add(listener)) {
|
||||
listener.registerListeners();
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package su.nightexpress.nightcore.manager;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
@Deprecated
|
||||
public interface SimpeListener extends Listener {
|
||||
|
||||
void registerListeners();
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
package su.nightexpress.nightcore.manager;
|
||||
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
public interface SimpleListener extends Listener {
|
||||
|
||||
void registerListeners();
|
||||
|
||||
default void unregisterListeners() {
|
||||
HandlerList.unregisterAll(this);
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,8 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
public class EntityUtil {
|
||||
|
||||
public static final EquipmentSlot[] EQUIPMENT_SLOTS = {EquipmentSlot.HAND, EquipmentSlot.OFF_HAND, EquipmentSlot.HEAD, EquipmentSlot.CHEST, EquipmentSlot.LEGS, EquipmentSlot.FEET};
|
||||
|
||||
private static AtomicInteger entityCounter;
|
||||
|
||||
public static boolean setupEntityCounter(@NotNull NightCore core) {
|
||||
@@ -67,7 +69,7 @@ public class EntityUtil {
|
||||
|
||||
@NotNull
|
||||
public static Map<EquipmentSlot, ItemStack> getEquippedItems(@NotNull LivingEntity entity) {
|
||||
return getEquippedItems(entity, EquipmentSlot.values());
|
||||
return getEquippedItems(entity, EQUIPMENT_SLOTS);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -77,6 +79,8 @@ public class EntityUtil {
|
||||
|
||||
Map<EquipmentSlot, ItemStack> map = new HashMap<>();
|
||||
for (EquipmentSlot slot : slots) {
|
||||
if (slot.name().equalsIgnoreCase("BODY")) continue; // from 1.20.6
|
||||
|
||||
map.put(slot, equipment.getItem(slot));
|
||||
}
|
||||
return map;
|
||||
|
||||
Reference in new issue
Block a user