Skip to content

Commit

Permalink
Remove now unused bot event buses
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexProgrammerDE committed Nov 8, 2024
1 parent e97367a commit 99071e8
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 31 deletions.
15 changes: 0 additions & 15 deletions server/src/main/java/com/soulfiremc/server/InstanceManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
import com.soulfiremc.server.account.OfflineAuthService;
import com.soulfiremc.server.api.AttackLifecycle;
import com.soulfiremc.server.api.SoulFireAPI;
import com.soulfiremc.server.api.event.EventExceptionHandler;
import com.soulfiremc.server.api.event.SoulFireInstanceEvent;
import com.soulfiremc.server.api.event.attack.AttackEndedEvent;
import com.soulfiremc.server.api.event.attack.AttackStartEvent;
import com.soulfiremc.server.api.event.attack.AttackTickEvent;
Expand All @@ -47,8 +45,6 @@
import io.netty.channel.EventLoopGroup;
import lombok.Getter;
import lombok.Setter;
import net.lenni0451.lambdaevents.LambdaManager;
import net.lenni0451.lambdaevents.generator.ASMGenerator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -67,17 +63,6 @@ public class InstanceManager {
private final Logger logger;
private final SoulFireScheduler scheduler;
private final SettingsDelegate settingsSource;
private final LambdaManager eventBus =
LambdaManager.basic(new ASMGenerator())
.setExceptionHandler(EventExceptionHandler.INSTANCE)
.setEventFilter(
(c, h) -> {
if (SoulFireInstanceEvent.class.isAssignableFrom(c)) {
return true;
} else {
throw new IllegalStateException("This event handler only accepts attack events");
}
});
private final Map<UUID, BotConnection> botConnections = new ConcurrentHashMap<>();
private final SoulFireServer soulFireServer;
@Setter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
public class SoulFireAPI {
private static final List<Plugin> SERVER_EXTENSIONS = new ArrayList<>();
private static final LambdaManager EVENT_BUS =
LambdaManager.basic(new ASMGenerator())
LambdaManager.threadSafe(new ASMGenerator())
.setExceptionHandler(EventExceptionHandler.INSTANCE)
.setEventFilter(
(c, h) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
import com.soulfiremc.server.account.MinecraftAccount;
import com.soulfiremc.server.account.service.OnlineJavaDataLike;
import com.soulfiremc.server.api.SoulFireAPI;
import com.soulfiremc.server.api.event.EventExceptionHandler;
import com.soulfiremc.server.api.event.SoulFireBotEvent;
import com.soulfiremc.server.api.event.bot.BotPostTickEvent;
import com.soulfiremc.server.api.event.bot.BotPreTickEvent;
import com.soulfiremc.server.api.event.bot.PreBotConnectEvent;
Expand All @@ -43,8 +41,6 @@
import io.netty.handler.traffic.GlobalTrafficShapingHandler;
import lombok.Getter;
import net.kyori.adventure.text.Component;
import net.lenni0451.lambdaevents.LambdaManager;
import net.lenni0451.lambdaevents.generator.ASMGenerator;
import org.geysermc.mcprotocollib.network.packet.Packet;
import org.geysermc.mcprotocollib.protocol.MinecraftProtocol;
import org.geysermc.mcprotocollib.protocol.data.ProtocolState;
Expand All @@ -64,17 +60,6 @@
public final class BotConnection {
public static final ThreadLocal<BotConnection> CURRENT = new ThreadLocal<>();
private final UUID connectionId = UUID.randomUUID();
private final LambdaManager eventBus = LambdaManager.basic(new ASMGenerator())
.setExceptionHandler(EventExceptionHandler.INSTANCE)
.setEventFilter(
(c, h) -> {
if (SoulFireBotEvent.class.isAssignableFrom(c)) {
return true;
} else {
throw new IllegalStateException(
"This event handler only accepts bot events");
}
});
private final List<Runnable> shutdownHooks = new CopyOnWriteArrayList<>();
private final Queue<Runnable> preTickHooks = new ConcurrentLinkedQueue<>();
private final ControlState controlState = new ControlState();
Expand Down

0 comments on commit 99071e8

Please sign in to comment.