mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-28 15:38:00 +01:00
16 lines
465 B
Java
16 lines
465 B
Java
|
package com.minelittlepony.unicopia.item;
|
||
|
|
||
|
import net.minecraft.item.ItemStack;
|
||
|
import net.minecraft.nbt.CompoundTag;
|
||
|
|
||
|
public interface GlowableItem {
|
||
|
default boolean isGlowing(ItemStack stack) {
|
||
|
CompoundTag tag = stack.getSubTag("display");
|
||
|
return tag != null && tag.getBoolean("glowing");
|
||
|
}
|
||
|
|
||
|
default void setGlowing(ItemStack stack, boolean glowing) {
|
||
|
stack.getOrCreateSubTag("display").putBoolean("glowing", glowing);
|
||
|
}
|
||
|
}
|