Rework fabric hooks to use more fabric api if possible

(Since, honestly, their hooks location is way better when it exists...)
This commit is contained in:
TomTheFurry
2022-06-02 12:57:32 +08:00
parent f4f186ff78
commit d5e24ad2bb
2 changed files with 10 additions and 0 deletions
@@ -65,12 +65,14 @@ public class ServerApi
}
}
//TODO: rename to serverLoadEvent
public void serverWorldLoadEvent() {
Server server = new Server();
SharedApi.currentServer = server;
SharedApi.currentWorld = new DHWorld();
}
//TODO: rename to serverUnloadEvent
public void serverWorldUnloadEvent() {
SharedApi.currentWorld.close();
SharedApi.currentWorld = null;
@@ -83,9 +85,13 @@ public class ServerApi
public void serverLevelUnloadEvent(IWorldWrapper world) {
SharedApi.currentWorld.unloadLevel(world);
}
@Deprecated
public void serverSaveEvent() {
SharedApi.currentWorld.save();
}
public void chunkSaveEvent(IChunkWrapper chunk, IWorldWrapper world) {
//TODO
@@ -93,4 +99,6 @@ public class ServerApi
public void serverChunkLoadEvent(IChunkWrapper chunk, IWorldWrapper world) {
}
public void serverChunkSaveEvent(IChunkWrapper chunk, IWorldWrapper world) {
}
}
@@ -15,4 +15,6 @@ public class SharedApi {
public static IMinecraftSharedWrapper MC;
public static Logger LOGGER = DhLoggerBuilder.getLogger("DH Events");
public static boolean inDedicatedEnvironment;
}