-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0ec9c28
commit e22b3a8
Showing
9 changed files
with
49 additions
and
25 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
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
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
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,29 +1,14 @@ | ||
package me.mrnavastar.sqlib; | ||
|
||
import me.mrnavastar.sqlib.database.Database; | ||
import net.fabricmc.api.ClientModInitializer; | ||
import net.fabricmc.api.DedicatedServerModInitializer; | ||
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientLifecycleEvents; | ||
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents; | ||
import net.fabricmc.loader.api.FabricLoader; | ||
import net.fabricmc.loader.api.entrypoint.PreLaunchEntrypoint; | ||
|
||
import java.nio.file.Path; | ||
|
||
public class Fabric extends SQLib implements PreLaunchEntrypoint, DedicatedServerModInitializer, ClientModInitializer { | ||
public class Fabric extends SQLib implements PreLaunchEntrypoint { | ||
|
||
@Override | ||
public void onPreLaunch() { | ||
init(Path.of(FabricLoader.getInstance().getGameDir() + "/sqlib"), FabricLoader.getInstance().getConfigDir()); | ||
} | ||
|
||
@Override | ||
public void onInitializeServer() { | ||
ServerLifecycleEvents.SERVER_STOPPING.register(server -> databases.forEach(Database::close)); | ||
} | ||
|
||
@Override | ||
public void onInitializeClient() { | ||
ClientLifecycleEvents.CLIENT_STOPPING.register(client -> databases.forEach(Database::close)); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package me.mrnavastar.sqlib; | ||
|
||
import net.minecraftforge.fml.common.Mod; | ||
|
||
import java.nio.file.Path; | ||
|
||
@Mod(SQLib.MOD_ID) | ||
public class Forge extends SQLib { | ||
|
||
public Forge() { | ||
init(Path.of("./sqlib"), Path.of("./config")); | ||
} | ||
} |
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
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
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
modLoader = "javafml" | ||
loaderVersion = "[36,)" | ||
license = "CC0-1.0" | ||
issueTrackerURL="https://github.com/MrNavaStar/SQLib/issues" | ||
|
||
[[mods]] | ||
modId = "sqlib" | ||
version = "0.debug-build" | ||
displayName = "SQLib" | ||
displayURL="https://github.com/MrNavaStar/SQLib" | ||
logoFile="assets/sqlib/icon.png" | ||
authors="MrNavaStar" | ||
description = 'A simple SQL wrapper with a focus on Minecraft use cases' | ||
|
||
displayTest="IGNORE_ALL_VERSION" |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"pack": { | ||
"description": "ProtoWeaver", | ||
"pack_format": 8 | ||
} | ||
} |