Skip to content

Commit

Permalink
[追加] バージョン不一致通知機能
Browse files Browse the repository at this point in the history
  • Loading branch information
Ringoame196 committed Jul 28, 2024
1 parent 86ae2da commit 4a0f88a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/kotlin/com/github/Ringoame196/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.github.Ringoame196

import com.github.Ringoame196.command.Command
import com.github.Ringoame196.command.TabComplete
import org.bukkit.Bukkit
import org.bukkit.plugin.java.JavaPlugin

class Main : JavaPlugin() {
Expand All @@ -10,5 +11,14 @@ class Main : JavaPlugin() {
val command = getCommand("itemname")
command!!.setExecutor(Command())
command.tabCompleter = TabComplete()

notificationVersionMismatch()
}
private fun notificationVersionMismatch() {
val pluginVersion = description.apiVersion
val mcVersion = Bukkit.getVersion()
if (pluginVersion != mcVersion) {
Bukkit.getConsoleSender().sendMessage("[${this.name}] Some items may not be compatible due to version mismatch(version:$pluginVersion)")
}
}
}

0 comments on commit 4a0f88a

Please sign in to comment.