-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TF IS HAPPENING (more in the Issue #5 discussion)
- Loading branch information
Showing
1 changed file
with
0 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} | ||