|
| 1 | +package net.swofty.type.backwaterbayou; |
| 2 | + |
| 3 | +import net.minestom.server.MinecraftServer; |
| 4 | +import net.minestom.server.coordinate.Pos; |
| 5 | +import net.swofty.commons.CustomWorlds; |
| 6 | +import net.swofty.commons.ServerType; |
| 7 | +import net.swofty.commons.ServiceType; |
| 8 | +import net.swofty.proxyapi.redis.ProxyToClient; |
| 9 | +import net.swofty.proxyapi.redis.ServiceToClient; |
| 10 | +import net.swofty.type.backwaterbayou.tab.BackwaterBayouServerModule; |
| 11 | +import net.swofty.type.generic.SkyBlockTypeLoader; |
| 12 | +import net.swofty.type.generic.entity.npc.HypixelNPC; |
| 13 | +import net.swofty.type.generic.event.HypixelEventClass; |
| 14 | +import net.swofty.type.generic.tab.TablistManager; |
| 15 | +import net.swofty.type.generic.tab.TablistModule; |
| 16 | +import net.swofty.type.skyblockgeneric.SkyBlockGenericLoader; |
| 17 | +import net.swofty.type.skyblockgeneric.tabmodules.AccountInformationModule; |
| 18 | +import net.swofty.type.skyblockgeneric.tabmodules.SkyBlockPlayersOnlineModule; |
| 19 | +import org.jetbrains.annotations.Nullable; |
| 20 | +import org.tinylog.Logger; |
| 21 | + |
| 22 | +import java.util.ArrayList; |
| 23 | +import java.util.List; |
| 24 | +import java.util.stream.Collectors; |
| 25 | + |
| 26 | +public class TypeBackwaterBayouLoader implements SkyBlockTypeLoader { |
| 27 | + @Override |
| 28 | + public ServerType getType() { |
| 29 | + return ServerType.SKYBLOCK_BACKWATER_BAYOU; |
| 30 | + } |
| 31 | + |
| 32 | + @Override |
| 33 | + public void onInitialize(MinecraftServer server) { |
| 34 | + Logger.info("TypeBackwaterBayouLoader initialized!"); |
| 35 | + } |
| 36 | + |
| 37 | + @Override |
| 38 | + public void afterInitialize(MinecraftServer server) { |
| 39 | + |
| 40 | + } |
| 41 | + |
| 42 | + @Override |
| 43 | + public LoaderValues getLoaderValues() { |
| 44 | + return new LoaderValues( |
| 45 | + (type) -> switch (type) { |
| 46 | + default -> new Pos(-12.5, 74, -10.5, -55, 0); |
| 47 | + }, // Spawn position |
| 48 | + true // Announce death messages |
| 49 | + ); |
| 50 | + } |
| 51 | + |
| 52 | + public TablistManager getTablistManager() { |
| 53 | + return new TablistManager() { |
| 54 | + @Override |
| 55 | + public List<TablistModule> getModules() { |
| 56 | + return new ArrayList<>(List.of( |
| 57 | + new SkyBlockPlayersOnlineModule(1), |
| 58 | + new SkyBlockPlayersOnlineModule(2), |
| 59 | + new BackwaterBayouServerModule(), |
| 60 | + new AccountInformationModule() |
| 61 | + )); |
| 62 | + } |
| 63 | + }; |
| 64 | + } |
| 65 | + |
| 66 | + @Override |
| 67 | + public List<HypixelEventClass> getTraditionalEvents() { |
| 68 | + return SkyBlockGenericLoader.loopThroughPackage( |
| 69 | + "net.swofty.type.backwaterbayou.events", |
| 70 | + HypixelEventClass.class |
| 71 | + ).collect(Collectors.toList()); |
| 72 | + } |
| 73 | + |
| 74 | + @Override |
| 75 | + public List<HypixelEventClass> getCustomEvents() { |
| 76 | + return new ArrayList<>(); |
| 77 | + } |
| 78 | + |
| 79 | + @Override |
| 80 | + public List<HypixelNPC> getNPCs() { |
| 81 | + return new ArrayList<>(SkyBlockGenericLoader.loopThroughPackage( |
| 82 | + "net.swofty.type.backwaterbayou.npcs", |
| 83 | + HypixelNPC.class |
| 84 | + ).toList()); |
| 85 | + } |
| 86 | + |
| 87 | + @Override |
| 88 | + public List<ServiceToClient> getServiceRedisListeners() { |
| 89 | + return List.of(); |
| 90 | + } |
| 91 | + |
| 92 | + @Override |
| 93 | + public List<ProxyToClient> getProxyRedisListeners() { |
| 94 | + return List.of(); |
| 95 | + } |
| 96 | + |
| 97 | + @Override |
| 98 | + public List<ServiceType> getRequiredServices() { |
| 99 | + return new ArrayList<>(List.of(ServiceType.DATA_MUTEX)); |
| 100 | + } |
| 101 | + |
| 102 | + @Override |
| 103 | + public @Nullable CustomWorlds getMainInstance() { |
| 104 | + return CustomWorlds.SKYBLOCK_BACKWATER_BAYOU; |
| 105 | + } |
| 106 | +} |
0 commit comments