Skip to content

Commit

Permalink
TF IS HAPPENING (more in the Issue #5 discussion)
Browse files Browse the repository at this point in the history
  • Loading branch information
forkgenesis committed Aug 23, 2024
2 parents 8e7eb6e + 80b7c95 commit a50fc49
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions src/main/java/io/github/vpgel/mcworldapi/MCWAPI.java
Original file line number Diff line number Diff line change
@@ -1,35 +0,0 @@
package io.github.vpgel.mcworldapi;


import org.slf4j.Logger;

import com.mojang.logging.LogUtils;

import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.server.ServerStartedEvent;
import net.minecraftforge.event.server.ServerStoppingEvent;
import net.minecraftforge.fml.common.Mod;

@Mod(MCWAPI.MODID)
public class MCWAPI {
static final String MODID = "mcworldapi";
static final Logger logger = LogUtils.getLogger();
static ServerThread server;

public MCWAPI() {
MinecraftForge.EVENT_BUS.register(this);
MinecraftForge.EVENT_BUS.addListener(this::onServerStart);
MinecraftForge.EVENT_BUS.addListener(this::onServerStop);
}

void onServerStart(ServerStartedEvent event) {
server = new ServerThread(event.getServer());
logger.info("Server starting");
server.start();
}

void onServerStop(ServerStoppingEvent event) {
logger.info("Server stopping");
server.interrupt();
}
}

0 comments on commit a50fc49

Please sign in to comment.