Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class TestScreen extends Screen {
- protected TestScreen(Component pTitle) {
- super(pTitle);
- }
- public static final ResourceLocation BOOK_LOCATION = new ResourceLocation("textures/gui/book.png");
- private final List<EncyclopediaCodec> encyclopediaEntries = EncyclopediaJsonManager.getEncyclopediaEntries().values().stream().toList();
- @Override
- public void render(PoseStack pPoseStack, int pMouseX, int pMouseY, float pPartialTick) {
- this.renderBackground(pPoseStack);
- RenderSystem.enableBlend();
- RenderSystem.setShader(GameRenderer::getPositionTexShader);
- RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
- RenderSystem.setShaderTexture(0, BOOK_LOCATION);
- int i = (this.width - 192) / 2;
- this.blit(pPoseStack, i, 2, 0, 0, 192, 192);
- if(!encyclopediaEntries.isEmpty()) {
- int k = encyclopediaEntries.get(0).getText().size();
- for (int l = 0; l < k; ++l) {
- String formattedcharsequence = encyclopediaEntries.get(0).getText().get(l);
- this.font.draw(pPoseStack, formattedcharsequence, (float) (i + 36), (float) (32 + l * 9), 0);
- }
- }
- super.render(pPoseStack, pMouseX, pMouseY, pPartialTick);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement