Attach serializer to object

This commit is contained in:
Marcel Konrad
2020-05-22 14:55:07 +02:00
parent 93cb07647d
commit f161867a1a
3 changed files with 7 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ package exopandora.worldhandler.util;
import javax.annotation.Nullable;
import net.minecraft.nbt.StringNBT;
import net.minecraft.util.text.event.ClickEvent;
import net.minecraft.util.text.event.ClickEvent.Action;
import net.minecraftforge.api.distmarker.Dist;
@@ -61,6 +62,11 @@ public class SignText
return this.text.getStyle().getClickEvent() != null && this.text.getStyle().getClickEvent().getAction() == Action.RUN_COMMAND && this.text.getStyle().getClickEvent().getValue() != null;
}
public StringNBT toNBT()
{
return StringNBT.valueOf(this.toString());
}
@Override
public String toString()
{