Unicopia/src/main/java/com/minelittlepony/unicopia/item/GlowableItem.java
2021-12-22 11:15:09 +02:00

15 lines
465 B
Java

package com.minelittlepony.unicopia.item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NbtCompound;
public interface GlowableItem {
default boolean isGlowing(ItemStack stack) {
NbtCompound tag = stack.getSubNbt("display");
return tag != null && tag.getBoolean("glowing");
}
default void setGlowing(ItemStack stack, boolean glowing) {
stack.getOrCreateSubNbt("display").putBoolean("glowing", glowing);
}
}