Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify NMSAdapter#createPalette methods #3036

Merged
merged 1 commit into from
Dec 23, 2024

Conversation

SirYwell
Copy link
Member

Overview

Description

There are a few things we can simplify here:

  • The short[] nonEmptyBlockCount was always null, so we can remove it
  • As a consequence, we don't need to calculate non-air block count anymore
  • We can use int[] instead of char[] for the global palette mapping, and use System.arraycopy then
  • We can extract duplicated code of the two variants into a common method

Submitter Checklist

Preview Give feedback

@SirYwell SirYwell requested a review from a team as a code owner December 21, 2024 10:08
@github-actions github-actions bot added the chore label Dec 21, 2024
@NotMyFault NotMyFault requested a review from a team December 22, 2024 10:14
@NotMyFault NotMyFault merged commit c8f1984 into main Dec 23, 2024
9 checks passed
@NotMyFault NotMyFault deleted the refactor/simplify-createPalette branch December 23, 2024 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants