mirror of
https://github.com/ceratic/project_vollidioten_mod.git
synced 2026-05-14 00:16:47 +02:00
first commit
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package ceratic.projectvollidioten;
|
||||
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
import net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class Projectvollidioten implements ModInitializer {
|
||||
public static final String MOD_ID = "projectvollidioten";
|
||||
|
||||
// This logger is used to write text to the console and the log file.
|
||||
// It is considered best practice to use your mod id as the logger's name.
|
||||
// That way, it's clear which mod wrote info, warnings, and errors.
|
||||
public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);
|
||||
|
||||
@Override
|
||||
public void onInitialize() {
|
||||
// This code runs as soon as Minecraft is in a mod-load-ready state.
|
||||
// However, some things (like resources) may still be uninitialized.
|
||||
// Proceed with mild caution.
|
||||
|
||||
LOGGER.info("Hello Fabric world!");
|
||||
|
||||
// Event: Player Join
|
||||
ServerPlayConnectionEvents.JOIN.register((handler, sender, server) -> {
|
||||
PlayerDataLogger.sendPlayerData(handler.getPlayer(), server, "JOIN");
|
||||
});
|
||||
|
||||
// Event: Player Leave
|
||||
ServerPlayConnectionEvents.DISCONNECT.register((handler, server) -> {
|
||||
PlayerDataLogger.sendPlayerData(handler.getPlayer(), server, "LEAVE");
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user