realize spawneggservice is useless

This commit is contained in:
ayunami2000 2022-04-07 00:06:18 -04:00
parent 262b600b11
commit 639365bd52
3 changed files with 2 additions and 27 deletions

View File

@ -9,11 +9,12 @@ import org.bukkit.event.EventPriority;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
import java.util.Arrays;
import java.util.List;
public class SpawnEggListener extends PlexListener
{
public static List<Material> SPAWN_EGGS;
public static final List<Material> SPAWN_EGGS = Arrays.stream(Material.values()).filter((mat) -> mat.name().endsWith("_SPAWN_EGG")).toList();
@EventHandler(priority = EventPriority.HIGH)
public void onPlayerInteract(PlayerInteractEvent event)

View File

@ -5,7 +5,6 @@ import dev.plex.Plex;
import dev.plex.services.impl.AutoWipeService;
import dev.plex.services.impl.BanService;
import dev.plex.services.impl.GameRuleService;
import dev.plex.services.impl.SpawnEggService;
import dev.plex.services.impl.UpdateCheckerService;
import org.bukkit.Bukkit;
import org.bukkit.scheduler.BukkitTask;
@ -21,7 +20,6 @@ public class ServiceManager
registerService(new BanService());
registerService(new GameRuleService());
registerService(new UpdateCheckerService());
registerService(new SpawnEggService());
registerService(new AutoWipeService());
}

View File

@ -1,24 +0,0 @@
package dev.plex.services.impl;
import dev.plex.listener.impl.SpawnEggListener;
import dev.plex.services.AbstractService;
import org.bukkit.Material;
import java.util.Arrays;
public class SpawnEggService extends AbstractService
{
public SpawnEggService() {
super(false, true);
}
@Override
public void run() {
SpawnEggListener.SPAWN_EGGS = Arrays.stream(Material.values()).filter((mat) -> mat.name().endsWith("_SPAWN_EGG")).toList();
}
@Override
public int repeatInSeconds() {
return 0;
}
}