@@ -2,12 +2,12 @@ package com.mairwunnx.projectessentialspermissions
22
33import com.mairwunnx.projectessentialspermissions.commands.EssPermissionsCommand
44import com.mairwunnx.projectessentialspermissions.helpers.validateForgeVersion
5+ import com.mairwunnx.projectessentialspermissions.permissions.PermissionBase
56import com.mojang.brigadier.CommandDispatcher
7+ import kotlinx.serialization.ImplicitReflectionSerializer
8+ import kotlinx.serialization.UnstableDefault
69import net.minecraft.command.CommandSource
7- import net.minecraft.entity.player.ServerPlayerEntity
810import net.minecraftforge.common.MinecraftForge
9- import net.minecraftforge.event.CommandEvent
10- import net.minecraftforge.eventbus.api.EventPriority
1111import net.minecraftforge.eventbus.api.SubscribeEvent
1212import net.minecraftforge.fml.common.Mod
1313import net.minecraftforge.fml.event.server.FMLServerStartingEvent
@@ -26,6 +26,9 @@ internal const val MOD_TARGET_MC = "1.14.4"
2626internal const val MOD_SOURCES_LINK = " https://github.com/MairwunNx/ProjectEssentials-Permissions/"
2727internal const val MOD_TELEGRAM_LINK = " https://t.me/minecraftforge"
2828
29+ @UnstableDefault
30+ @ImplicitReflectionSerializer
31+ @Suppress(" unused" )
2932@Mod(MOD_ID )
3033class EntryPoint {
3134 private val logger = LogManager .getLogger()
@@ -36,7 +39,7 @@ class EntryPoint {
3639 logger.debug(" Register event bus for $MOD_NAME mod ..." )
3740 MinecraftForge .EVENT_BUS .register(this )
3841 logger.info(" Loading $MOD_NAME permissions data ..." )
39- // load data
42+ PermissionBase .loadData()
4043 }
4144
4245 private fun logBaseInfo () {
@@ -63,17 +66,11 @@ class EntryPoint {
6366 EssPermissionsCommand .register(cmdDispatcher)
6467 }
6568
69+ @Suppress(" UNUSED_PARAMETER" )
6670 @SubscribeEvent
6771 fun onServerStopping (it : FMLServerStoppingEvent ) {
6872 logger.info(" Shutting down $MOD_NAME mod ..." )
6973 logger.info(" - Saving modification user data ..." )
70- // save data
71- }
72-
73- @SubscribeEvent(priority = EventPriority .HIGH )
74- fun onPlayerCommand (it : CommandEvent ) {
75- if (it.parseResults.context.source.entity is ServerPlayerEntity ) {
76- // check command permissions
77- }
74+ PermissionBase .saveData()
7875 }
7976}
0 commit comments