Skip to content

Commit a8eaff8

Browse files
committed
Improve code
1 parent cd2391a commit a8eaff8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

bukkit/src/main/kotlin/io/github/rothes/protocolstringreplacer/replacer/containers/ItemContentContainer.kt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ open class ItemContentContainer(item: Item, root: Container<*>?) : AbstractConta
1212
private val container: ItemStackContainer?
1313

1414
init {
15-
if (content.tag != null) {
15+
if (content.tag != null && content.id != "minecraft:air") {
1616
val nbt = NBT.createNBTObject()
1717
nbt.setString("id", content.id)
1818
if (NEW_NBT) {
@@ -32,7 +32,15 @@ open class ItemContentContainer(item: Item, root: Container<*>?) : AbstractConta
3232
override fun createDefaultChildren() {
3333
if (container != null) {
3434
children.add(container)
35+
}
36+
super.createDefaultChildren()
37+
}
38+
39+
override fun createTexts(root: Container<*>) {
40+
if (container != null) {
3541
container.entriesPeriod()
42+
container.createDefaultChildrenDeep()
43+
container.createTexts(root)
3644
}
3745
}
3846

0 commit comments

Comments
 (0)