Commit c46c53e3 by Jonathan Thomas

Added hooks for server LOAD and UNLOAD, for future data saving operations

parent 487a1d74
Pipeline #11640 passed with stage
in 19 seconds
......@@ -4,6 +4,7 @@ import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking;
import net.minecraft.entity.Entity;
import net.minecraft.util.Identifier;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerWorldEvents;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -32,6 +33,15 @@ public class ModInit implements ModInitializer {
});
});
ServerWorldEvents.LOAD.register((server, world) -> {
// Load chat data...
LOGGER.info("LOAD chat data from NBT: " + world.getRegistryKey().getValue());
});
ServerWorldEvents.UNLOAD.register((server, world) -> {
// Save chat data...
LOGGER.info("SAVE chat data to NBT: " + world.getRegistryKey().getValue());
});
LOGGER.info("MobGPT Initialized!");
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment