Added visibility option for texts for usercontents

This commit is contained in:
Marcel Konrad
2019-11-12 18:10:28 +01:00
parent 5e6b36e9c1
commit dc4e3722c2
3 changed files with 24 additions and 3 deletions

View File

@@ -146,7 +146,10 @@ public class ContentUsercontent extends Content
{
for(JsonText text : this.content.getGui().getTexts())
{
container.getMinecraft().fontRenderer.drawString(TextFormatting.formatNullable(text.getText()), text.getX() + x, text.getY() + y, text.getColor());
if(text.getVisible() == null || text.getVisible().eval(this.engineAdapter))
{
container.getMinecraft().fontRenderer.drawString(TextFormatting.formatNullable(text.getText()), text.getX() + x, text.getY() + y, text.getColor());
}
}
}
}