Skip to content

Commit

Permalink
Fix Build
Browse files Browse the repository at this point in the history
  • Loading branch information
MrNavaStar committed Jun 18, 2022
1 parent 81f4fe8 commit 9a5d327
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '0.11-SNAPSHOT'
id 'fabric-loom' version '0.12-SNAPSHOT'
id 'maven-publish'
}

Expand Down
10 changes: 5 additions & 5 deletions src/main/java/mrnavastar/invsync/InvSync.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents;
import net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.network.ServerPlayerEntity;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;

Expand All @@ -22,7 +24,6 @@ public class InvSync implements ModInitializer {
public static Table playerData;
public static Settings settings;
private static Database database;
private static MinecraftServer server;

@Override
public void onInitialize() {
Expand All @@ -41,14 +42,13 @@ public void onInitialize() {
validConfig = true;
}

ServerLifecycleEvents.SERVER_STARTING.register(s -> server = s);

if (!validConfig) {
log(Level.INFO, "Halting initialization! You need to change some settings in the InvSync config");
server.stop(true);
log(Level.FATAL, "Halting initialization! You need to change some settings in the InvSync config");
System.exit(0);
}

playerData = database.createTable("PlayerData");
log(Level.INFO, "Database initialized successfully!");

ServerPlayConnectionEvents.JOIN.register((handler, s, server) -> {
try {
Expand Down

0 comments on commit 9a5d327

Please sign in to comment.