Clean up empty NBT when clearing projector channels (#75)

This commit is contained in:
Chitak 985 authored and GitHub committed 2026-09-20 09:13:19 +08:00
1 parent d829ae466b
commit 89057ebb2d
1 file changed
+6 -1
@@ -146,7 +146,12 @@ public class ChannelDataAccessor {
*/
public static void wipeChannelData(ItemStack masterStack) {
if (masterStack == null) throw new IllegalArgumentException();
if (masterStack.stackTagCompound != null) masterStack.stackTagCompound.removeTag(SECONDARY_HINT_TAG);
if (masterStack.stackTagCompound != null) {
masterStack.stackTagCompound.removeTag(SECONDARY_HINT_TAG);
if (masterStack.stackTagCompound.hasNoTags()) {
masterStack.stackTagCompound = null;
}
}
}
/**