Skip to content

refactor(platform): centralize screen access - #891

Merged
Wyvest merged 2 commits into
Polyfrost:v1from
saadndm:v1-platform
Aug 2, 2026
Merged

refactor(platform): centralize screen access#891
Wyvest merged 2 commits into
Polyfrost:v1from
saadndm:v1-platform

Conversation

@saadndm

@saadndm saadndm commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Description

This PR has no actual functional changes, but makes use of ScreenPlatform whenever possible to make multiversion/modloader screen access easier to work with.

  • Added guiWidth and guiHeight to ScreenPlatform
  • Updated API dump

client.window.width -> Platform.screen().viewportWidth()
client.window.height -> Platform.screen().viewportHeight()

client.window.screenWidth -> Platform.screen().windowWidth()
client.window.screenHeight -> Platform.screen().windowHeight()

graphics.guiWidth() -> Platform.screen().guiWidth()
graphics.guiHeight() -> Platform.screen().guiHeight()

Minecraft.getInstance().gui.screen -> Platform.screen().current()
Minecraft.getInstance().screen -> Platform.screen().current()f

Related Issue(s)

Checklist

  • I made a clear description of what was changed
  • I stated why these changes were necessary
  • [] I updated documentation or said what needs to be updated
  • I made sure these changes are backwards compatible
  • This pull request is for one feature/bug fix

@awruff awruff left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Wyvest
Wyvest merged commit aafe483 into Polyfrost:v1 Aug 2, 2026
1 check failed
@github-project-automation github-project-automation Bot moved this to Done in OneConfig Aug 2, 2026
@saadndm
saadndm deleted the v1-platform branch August 2, 2026 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants