close #303
This commit is contained in:
parent
c2edcd68c1
commit
3d56f0f826
2 changed files with 11 additions and 2 deletions
|
@ -86,12 +86,18 @@ public interface IotaHolderItem {
|
||||||
return HexIotaTypes.getColor(tag);
|
return HexIotaTypes.getColor(tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Write {@code null} to indicate erasing
|
||||||
|
*/
|
||||||
boolean canWrite(ItemStack stack, @Nullable Iota iota);
|
boolean canWrite(ItemStack stack, @Nullable Iota iota);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Write {@code null} to indicate erasing
|
||||||
|
*/
|
||||||
void writeDatum(ItemStack stack, @Nullable Iota iota);
|
void writeDatum(ItemStack stack, @Nullable Iota iota);
|
||||||
|
|
||||||
static void appendHoverText(IotaHolderItem self, ItemStack stack, List<Component> components,
|
static void appendHoverText(IotaHolderItem self, ItemStack stack, List<Component> components,
|
||||||
TooltipFlag flag) {
|
TooltipFlag flag) {
|
||||||
var datumTag = self.readIotaTag(stack);
|
var datumTag = self.readIotaTag(stack);
|
||||||
if (datumTag != null) {
|
if (datumTag != null) {
|
||||||
var cmp = HexIotaTypes.getDisplay(datumTag);
|
var cmp = HexIotaTypes.getDisplay(datumTag);
|
||||||
|
|
|
@ -86,7 +86,10 @@ public class ItemSlate extends BlockItem implements IotaHolderItem {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canWrite(ItemStack stack, Iota datum) {
|
public boolean canWrite(ItemStack stack, Iota datum) {
|
||||||
return datum instanceof PatternIota && !NBTHelper.hasCompound(stack, BlockEntitySlate.TAG_PATTERN);
|
var isWritten = NBTHelper.hasCompound(stack, "BlockEntityTag")
|
||||||
|
&& stack.getTag().getCompound("BlockEntityTag").contains(BlockEntitySlate.TAG_PATTERN);
|
||||||
|
return (datum instanceof PatternIota && !isWritten)
|
||||||
|
|| (datum == null && isWritten);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue