diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml
index 8b7c9c2..6a47036 100644
--- a/.idea/kotlinc.xml
+++ b/.idea/kotlinc.xml
@@ -1,5 +1,15 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 7ace097..a4e07a8 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -8,7 +8,7 @@
-
+
\ No newline at end of file
diff --git a/dependency-reduced-pom.xml b/dependency-reduced-pom.xml
index f9f25c2..f651d1d 100644
--- a/dependency-reduced-pom.xml
+++ b/dependency-reduced-pom.xml
@@ -4,7 +4,7 @@
main
vpSecure
vpSecure
- 1.0
+ 1.0.1
${project.basedir}/src/main/kotlin
clean package
@@ -29,7 +29,7 @@
- ${java.version}
+ 1.8
@@ -117,8 +117,8 @@
- 2.2.20-RC2
17
UTF-8
+ 2.2.20-RC2
diff --git a/pom.xml b/pom.xml
index 41f4f43..5180865 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
main
vpSecure
- 1.0
+ 1.0.1
jar
vpSecure
@@ -35,7 +35,7 @@
- ${java.version}
+ 1.8
diff --git a/src/main/kotlin/main/vpSecure/VpSecure.kt b/src/main/kotlin/main/vpSecure/VpSecure.kt
index 18dd7bd..791cdec 100644
--- a/src/main/kotlin/main/vpSecure/VpSecure.kt
+++ b/src/main/kotlin/main/vpSecure/VpSecure.kt
@@ -1,12 +1,15 @@
package main.vpSecure
+import org.bukkit.command.Command
+import org.bukkit.command.CommandExecutor
+import org.bukkit.command.CommandSender
import org.bukkit.event.EventHandler
import org.bukkit.event.Listener
import org.bukkit.event.player.PlayerLoginEvent
import org.bukkit.plugin.java.JavaPlugin
import java.io.File
-class VpSecure : JavaPlugin(), Listener {
+class VpSecure : JavaPlugin(), Listener, CommandExecutor {
private var ALLOWED_PROXY_IPS: List = listOf("127.0.0.1")
@@ -17,6 +20,9 @@ class VpSecure : JavaPlugin(), Listener {
// Register event listener
server.pluginManager.registerEvents(this, this)
+ // Register command
+ getCommand("vpsecure")?.setExecutor(this)
+
logger.info("VpSecure has been enabled with allowed proxy IPs: $ALLOWED_PROXY_IPS")
}
@@ -54,4 +60,19 @@ class VpSecure : JavaPlugin(), Listener {
)
}
}
+
+ override fun onCommand(sender: CommandSender, command: Command, label: String, args: Array): Boolean {
+ if (command.name.equals("vpsecure", ignoreCase = true)) {
+ if (args.isNotEmpty() && args[0].equals("reload", ignoreCase = true)) {
+ loadConfig()
+ sender.sendMessage("VpSecure configuration reloaded. Allowed proxy IPs: $ALLOWED_PROXY_IPS")
+ logger.info("VpSecure configuration reloaded by ${sender.name}")
+ return true
+ } else {
+ sender.sendMessage("Usage: /vpsecure reload")
+ return true
+ }
+ }
+ return false
+ }
}
\ No newline at end of file
diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml
index cc8749d..adf91fa 100644
--- a/src/main/resources/plugin.yml
+++ b/src/main/resources/plugin.yml
@@ -1,6 +1,15 @@
name: vpSecure
-version: '1.0'
+version: '1.0.1'
main: main.vpSecure.VpSecure
load: STARTUP
authors: [ _SAN5_SkeLet0n_ ]
website: voidproject.del.pw
+commands:
+ vpsecure:
+ description: VpSecure management commands
+ usage: /vpsecure reload
+ permission: vpsecure.admin
+permissions:
+ vpsecure.admin:
+ description: Allows reloading VpSecure configuration
+ default: op
\ No newline at end of file