Skip to content

Commit

Permalink
Merge branch 'refs/heads/master' into ver/1.20.2
Browse files Browse the repository at this point in the history
# Conflicts:
#	build.gradle.kts
  • Loading branch information
acrylic-style committed Aug 5, 2024
2 parents 6438e2e + 4f7eedb commit 9866f9a
Show file tree
Hide file tree
Showing 3 changed files with 24 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 @@ -11,7 +11,7 @@ plugins {
}

group = "net.azisaba"
version = "1.20.2+6.16.7"
version = "1.20.2+6.16.8"

java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,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
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ public static ItemStack backupTag(@Nullable ItemStack stack) {
if (stack == null || stack.getType().isAir()) return null;
CompoundTag tag = CraftItemStack.asNMSCopy(stack).getTag();
if (tag == null || tag.isEmpty()) return stack;
if (!tag.getCompound("backup").isEmpty()) return stack;
// exclude some items
if (tag.getCompound("PublicBukkitValues").getInt("minecraft:admin_item") == 1) {
return stack;
}
return setTag(stack, "backup", tag);
}

Expand Down

0 comments on commit 9866f9a

Please sign in to comment.