Добавление поддержки java 8 (1.8), команда /vpsecure reload
This commit is contained in:
parent
752c262c1e
commit
f37eac702f
10
.idea/kotlinc.xml
generated
10
.idea/kotlinc.xml
generated
@ -1,5 +1,15 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
|
<component name="Kotlin2JsCompilerArguments">
|
||||||
|
<option name="moduleKind" value="plain" />
|
||||||
|
</component>
|
||||||
|
<component name="Kotlin2JvmCompilerArguments">
|
||||||
|
<option name="jvmTarget" value="1.8" />
|
||||||
|
</component>
|
||||||
|
<component name="KotlinCommonCompilerArguments">
|
||||||
|
<option name="apiVersion" value="2.1" />
|
||||||
|
<option name="languageVersion" value="2.1" />
|
||||||
|
</component>
|
||||||
<component name="KotlinJpsPluginSettings">
|
<component name="KotlinJpsPluginSettings">
|
||||||
<option name="version" value="2.2.20-RC2" />
|
<option name="version" value="2.2.20-RC2" />
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@ -8,7 +8,7 @@
|
|||||||
</list>
|
</list>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="temurin-21" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="corretto-1.8" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
@ -4,7 +4,7 @@
|
|||||||
<groupId>main</groupId>
|
<groupId>main</groupId>
|
||||||
<artifactId>vpSecure</artifactId>
|
<artifactId>vpSecure</artifactId>
|
||||||
<name>vpSecure</name>
|
<name>vpSecure</name>
|
||||||
<version>1.0</version>
|
<version>1.0.1</version>
|
||||||
<build>
|
<build>
|
||||||
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
|
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
|
||||||
<defaultGoal>clean package</defaultGoal>
|
<defaultGoal>clean package</defaultGoal>
|
||||||
@ -29,7 +29,7 @@
|
|||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
<configuration>
|
<configuration>
|
||||||
<jvmTarget>${java.version}</jvmTarget>
|
<jvmTarget>1.8</jvmTarget>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
@ -117,8 +117,8 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<properties>
|
<properties>
|
||||||
<kotlin.version>2.2.20-RC2</kotlin.version>
|
|
||||||
<java.version>17</java.version>
|
<java.version>17</java.version>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
<kotlin.version>2.2.20-RC2</kotlin.version>
|
||||||
</properties>
|
</properties>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
4
pom.xml
4
pom.xml
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>main</groupId>
|
<groupId>main</groupId>
|
||||||
<artifactId>vpSecure</artifactId>
|
<artifactId>vpSecure</artifactId>
|
||||||
<version>1.0</version>
|
<version>1.0.1</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>vpSecure</name>
|
<name>vpSecure</name>
|
||||||
@ -35,7 +35,7 @@
|
|||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
<configuration>
|
<configuration>
|
||||||
<jvmTarget>${java.version}</jvmTarget>
|
<jvmTarget>1.8</jvmTarget>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
|||||||
@ -1,12 +1,15 @@
|
|||||||
package main.vpSecure
|
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.EventHandler
|
||||||
import org.bukkit.event.Listener
|
import org.bukkit.event.Listener
|
||||||
import org.bukkit.event.player.PlayerLoginEvent
|
import org.bukkit.event.player.PlayerLoginEvent
|
||||||
import org.bukkit.plugin.java.JavaPlugin
|
import org.bukkit.plugin.java.JavaPlugin
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
class VpSecure : JavaPlugin(), Listener {
|
class VpSecure : JavaPlugin(), Listener, CommandExecutor {
|
||||||
|
|
||||||
private var ALLOWED_PROXY_IPS: List<String> = listOf("127.0.0.1")
|
private var ALLOWED_PROXY_IPS: List<String> = listOf("127.0.0.1")
|
||||||
|
|
||||||
@ -17,6 +20,9 @@ class VpSecure : JavaPlugin(), Listener {
|
|||||||
// Register event listener
|
// Register event listener
|
||||||
server.pluginManager.registerEvents(this, this)
|
server.pluginManager.registerEvents(this, this)
|
||||||
|
|
||||||
|
// Register command
|
||||||
|
getCommand("vpsecure")?.setExecutor(this)
|
||||||
|
|
||||||
logger.info("VpSecure has been enabled with allowed proxy IPs: $ALLOWED_PROXY_IPS")
|
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<out String>): 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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -1,6 +1,15 @@
|
|||||||
name: vpSecure
|
name: vpSecure
|
||||||
version: '1.0'
|
version: '1.0.1'
|
||||||
main: main.vpSecure.VpSecure
|
main: main.vpSecure.VpSecure
|
||||||
load: STARTUP
|
load: STARTUP
|
||||||
authors: [ _SAN5_SkeLet0n_ ]
|
authors: [ _SAN5_SkeLet0n_ ]
|
||||||
website: voidproject.del.pw
|
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
|
||||||
Loading…
Reference in New Issue
Block a user