diff --git a/src/main/kotlin/dev/znci/rocket/Rocket.kt b/src/main/kotlin/dev/znci/rocket/Rocket.kt index 3aee1e8..b249b05 100644 --- a/src/main/kotlin/dev/znci/rocket/Rocket.kt +++ b/src/main/kotlin/dev/znci/rocket/Rocket.kt @@ -19,8 +19,8 @@ import dev.znci.rocket.commands.RocketCommand import dev.znci.rocket.i18n.LocaleManager import dev.znci.rocket.scripting.AddonManager import dev.znci.rocket.scripting.ScriptManager -import dev.znci.rocket.scripting.events.EventListener import dev.znci.rocket.scripting.api.RocketAddon +import dev.znci.rocket.scripting.events.EventListener import java.io.File open class Rocket : RocketAddon() { diff --git a/src/main/kotlin/dev/znci/rocket/scripting/AddonManager.kt b/src/main/kotlin/dev/znci/rocket/scripting/AddonManager.kt index 8bb150d..5a359d8 100644 --- a/src/main/kotlin/dev/znci/rocket/scripting/AddonManager.kt +++ b/src/main/kotlin/dev/znci/rocket/scripting/AddonManager.kt @@ -1,3 +1,18 @@ +/** + * Copyright 2025 znci + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package dev.znci.rocket.scripting import dev.znci.rocket.scripting.api.RocketAddon diff --git a/src/main/kotlin/dev/znci/rocket/scripting/ScriptManager.kt b/src/main/kotlin/dev/znci/rocket/scripting/ScriptManager.kt index 722b8b3..0117d7f 100644 --- a/src/main/kotlin/dev/znci/rocket/scripting/ScriptManager.kt +++ b/src/main/kotlin/dev/znci/rocket/scripting/ScriptManager.kt @@ -22,12 +22,11 @@ import dev.znci.twine.TwineProperty import dev.znci.twine.TwineTable import dev.znci.twine.TwineValueBase import org.bukkit.event.Event -import java.io.File import org.luaj.vm2.Globals import org.luaj.vm2.LuaError import org.luaj.vm2.LuaValue import org.luaj.vm2.lib.jse.JsePlatform -import java.util.ArrayList +import java.io.File /** * The `ScriptManager` object is responsible for managing Lua scripts, global values, and event handling in the plugin. diff --git a/src/main/kotlin/dev/znci/rocket/scripting/api/RocketAddon.kt b/src/main/kotlin/dev/znci/rocket/scripting/api/RocketAddon.kt index adc5b66..e9a73a9 100644 --- a/src/main/kotlin/dev/znci/rocket/scripting/api/RocketAddon.kt +++ b/src/main/kotlin/dev/znci/rocket/scripting/api/RocketAddon.kt @@ -1,6 +1,20 @@ +/** + * Copyright 2025 znci + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package dev.znci.rocket.scripting.api -import dev.znci.rocket.scripting.AddonManager import dev.znci.rocket.scripting.ScriptManager import dev.znci.rocket.scripting.annotations.Global import dev.znci.twine.TwineValueBase diff --git a/src/main/kotlin/dev/znci/rocket/scripting/events/EventListener.kt b/src/main/kotlin/dev/znci/rocket/scripting/events/EventListener.kt index 803b14e..72f4a35 100644 --- a/src/main/kotlin/dev/znci/rocket/scripting/events/EventListener.kt +++ b/src/main/kotlin/dev/znci/rocket/scripting/events/EventListener.kt @@ -23,7 +23,6 @@ import org.bukkit.event.Event import org.bukkit.event.EventPriority import org.bukkit.event.Listener import org.bukkit.plugin.Plugin -import org.luaj.vm2.LuaBoolean import org.luaj.vm2.LuaTable import org.luaj.vm2.LuaValue import org.luaj.vm2.lib.ZeroArgFunction diff --git a/src/main/kotlin/dev/znci/rocket/scripting/globals/tables/Commands.kt b/src/main/kotlin/dev/znci/rocket/scripting/globals/tables/Commands.kt index 848c027..802b4fc 100644 --- a/src/main/kotlin/dev/znci/rocket/scripting/globals/tables/Commands.kt +++ b/src/main/kotlin/dev/znci/rocket/scripting/globals/tables/Commands.kt @@ -23,11 +23,7 @@ import dev.znci.rocket.util.MessageFormatter import dev.znci.twine.TwineNative import dev.znci.twine.annotations.TwineNativeFunction import org.bukkit.Bukkit -import org.bukkit.command.Command -import org.bukkit.command.CommandExecutor -import org.bukkit.command.CommandMap -import org.bukkit.command.CommandSender -import org.bukkit.command.TabCompleter +import org.bukkit.command.* import org.bukkit.entity.Player import org.luaj.vm2.LuaTable diff --git a/src/main/kotlin/dev/znci/rocket/scripting/globals/tables/Math.kt b/src/main/kotlin/dev/znci/rocket/scripting/globals/tables/Math.kt index 70254eb..ade7857 100644 --- a/src/main/kotlin/dev/znci/rocket/scripting/globals/tables/Math.kt +++ b/src/main/kotlin/dev/znci/rocket/scripting/globals/tables/Math.kt @@ -1,3 +1,18 @@ +/** + * Copyright 2025 znci + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package dev.znci.rocket.scripting.globals.tables import dev.znci.rocket.scripting.annotations.Global diff --git a/src/main/kotlin/dev/znci/rocket/scripting/globals/tables/Players.kt b/src/main/kotlin/dev/znci/rocket/scripting/globals/tables/Players.kt index 8932e34..82989a9 100644 --- a/src/main/kotlin/dev/znci/rocket/scripting/globals/tables/Players.kt +++ b/src/main/kotlin/dev/znci/rocket/scripting/globals/tables/Players.kt @@ -29,7 +29,7 @@ import org.bukkit.GameMode import org.bukkit.OfflinePlayer import org.bukkit.entity.Player import java.time.Duration -import java.util.UUID +import java.util.* @Suppress("unused") @Global diff --git a/src/main/kotlin/dev/znci/rocket/scripting/globals/tables/Server.kt b/src/main/kotlin/dev/znci/rocket/scripting/globals/tables/Server.kt index 800a359..6edebbf 100644 --- a/src/main/kotlin/dev/znci/rocket/scripting/globals/tables/Server.kt +++ b/src/main/kotlin/dev/znci/rocket/scripting/globals/tables/Server.kt @@ -1,3 +1,18 @@ +/** + * Copyright 2025 znci + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package dev.znci.rocket.scripting.globals.tables import dev.znci.rocket.Rocket @@ -159,7 +174,4 @@ class LuaServer : TwineNative("server") { @TwineNativeFunction fun shutdown() = server.shutdown() - @TwineNativeFunction - fun restart() = server.restart() - } \ No newline at end of file diff --git a/src/main/kotlin/dev/znci/rocket/scripting/globals/tables/Vector3.kt b/src/main/kotlin/dev/znci/rocket/scripting/globals/tables/Vector3.kt index aea7cf0..9f796b4 100644 --- a/src/main/kotlin/dev/znci/rocket/scripting/globals/tables/Vector3.kt +++ b/src/main/kotlin/dev/znci/rocket/scripting/globals/tables/Vector3.kt @@ -1,3 +1,18 @@ +/** + * Copyright 2025 znci + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package dev.znci.rocket.scripting.globals.tables import dev.znci.rocket.scripting.annotations.Global diff --git a/src/main/kotlin/dev/znci/rocket/scripting/globals/values/TestValue.kt b/src/main/kotlin/dev/znci/rocket/scripting/globals/values/TestValue.kt index acd7440..dbd90ce 100644 --- a/src/main/kotlin/dev/znci/rocket/scripting/globals/values/TestValue.kt +++ b/src/main/kotlin/dev/znci/rocket/scripting/globals/values/TestValue.kt @@ -1,3 +1,18 @@ +/** + * Copyright 2025 znci + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package dev.znci.rocket.scripting.globals.values import dev.znci.twine.TwineProperty diff --git a/src/main/kotlin/dev/znci/rocket/util/MessageFormatter.kt b/src/main/kotlin/dev/znci/rocket/util/MessageFormatter.kt index f82086e..2d2a7d1 100644 --- a/src/main/kotlin/dev/znci/rocket/util/MessageFormatter.kt +++ b/src/main/kotlin/dev/znci/rocket/util/MessageFormatter.kt @@ -1,3 +1,18 @@ +/** + * Copyright 2025 znci + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package dev.znci.rocket.util import net.kyori.adventure.text.Component