level < 0 means never show this page

This commit is contained in:
Sollace 2022-09-01 20:04:36 +02:00
parent 15703db16c
commit 85bb51ed78

View file

@ -132,7 +132,7 @@ public class DynamicContent implements Content {
compile(); compile();
TextRenderer font = MinecraftClient.getInstance().textRenderer; TextRenderer font = MinecraftClient.getInstance().textRenderer;
boolean needsMoreXp = Pony.of(MinecraftClient.getInstance().player).getLevel().get() < level; boolean needsMoreXp = level < 0 || Pony.of(MinecraftClient.getInstance().player).getLevel().get() < level;
matrices.push(); matrices.push();
matrices.translate(bounds.left, bounds.top - 10, mouseY); matrices.translate(bounds.left, bounds.top - 10, mouseY);
@ -144,7 +144,7 @@ public class DynamicContent implements Content {
matrices.translate(bounds.left, bounds.top - 10, mouseY); matrices.translate(bounds.left, bounds.top - 10, mouseY);
matrices.translate(0, 12, 0); matrices.translate(0, 12, 0);
matrices.scale(0.8F, 0.8F, 1); matrices.scale(0.8F, 0.8F, 1);
font.draw(matrices, Text.literal("Level: " + (level + 1)).formatted(Formatting.DARK_GREEN), 0, 0, mouseY); font.draw(matrices, Text.literal(level < 0 ? "Level: ???" : "Level: " + (level + 1)).formatted(Formatting.DARK_GREEN), 0, 0, mouseY);
matrices.pop(); matrices.pop();
matrices.push(); matrices.push();