Skip to content

Commit

Permalink
add /lifecoreutil fixItem
Browse files Browse the repository at this point in the history
  • Loading branch information
acrylic-style committed Aug 5, 2024
1 parent 8bbb727 commit 4f7eedb
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

group = "net.azisaba"
version = "1.15.2+6.16.8-SNAPSHOT"
version = "1.15.2+6.16.8"

java {
toolchain.languageVersion.set(JavaLanguageVersion.of(8))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,24 @@ class LifeCoreUtilCommand(val plugin: LifeCore) : TabExecutor {
MapUtil.initializeMapRenderer((player as Player), player.inventory.itemInMainHand)
}
},
FixItem("displayタグを修正します") {
override fun execute(plugin: LifeCore, player: CommandSender, args: Array<String>) {
val item = (player as Player).inventory.itemInMainHand
val meta = item.itemMeta
if (meta.hasDisplayName()) {
val origName = meta.displayName
meta.setDisplayName(null)
meta.setDisplayName(origName)
}
if (meta.hasLore()) {
val origLore = meta.lore
meta.lore = null
meta.lore = origLore
}
item.itemMeta = meta
player.inventory.setItemInMainHand(item)
}
},
;

abstract fun execute(plugin: LifeCore, player: CommandSender, args: Array<String>)
Expand Down

0 comments on commit 4f7eedb

Please sign in to comment.