fix: rename getScrollbarPosition() to scrollBarX()

fixes game crashing
This commit is contained in:
trafficlunar 2024-12-07 13:17:28 +00:00
parent fb1f1bb65b
commit 44ab1a7f5e
2 changed files with 6 additions and 6 deletions

View file

@ -70,8 +70,8 @@ public class OptionsToggleList extends ContainerObjectSelectionList<OptionsToggl
} }
} }
protected int getScrollbarPosition() { protected int scrollBarX() {
return super.getScrollbarPosition() + 15; return super.scrollBarX() + 15;
} }
public int getRowWidth() { public int getRowWidth() {
@ -113,7 +113,7 @@ public class OptionsToggleList extends ContainerObjectSelectionList<OptionsToggl
public void render(GuiGraphics guiGraphics, int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean hovered, float tickDelta) { public void render(GuiGraphics guiGraphics, int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean hovered, float tickDelta) {
Font fontRenderer = OptionsToggleList.this.minecraft.font; Font fontRenderer = OptionsToggleList.this.minecraft.font;
int posX = OptionsToggleList.this.getScrollbarPosition() - this.toggleButton.getWidth() - 10; int posX = OptionsToggleList.this.scrollBarX() - this.toggleButton.getWidth() - 10;
int posY = y - 2; int posY = y - 2;
int textY = y + entryHeight / 2; int textY = y + entryHeight / 2;

View file

@ -56,8 +56,8 @@ public class ProfilesList extends ContainerObjectSelectionList<ProfilesList.Prof
this.children().forEach(ProfileEntry::checkLoaded); this.children().forEach(ProfileEntry::checkLoaded);
} }
protected int getScrollbarPosition() { protected int scrollBarX() {
return super.getScrollbarPosition() + 15; return super.scrollBarX() + 15;
} }
public int getRowWidth() { public int getRowWidth() {
@ -102,7 +102,7 @@ public class ProfilesList extends ContainerObjectSelectionList<ProfilesList.Prof
public void render(GuiGraphics guiGraphics, int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean hovered, float tickDelta) { public void render(GuiGraphics guiGraphics, int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean hovered, float tickDelta) {
Font fontRenderer = ProfilesList.this.minecraft.font; Font fontRenderer = ProfilesList.this.minecraft.font;
int posX = ProfilesList.this.getScrollbarPosition() - this.loadButton.getWidth() - 10; int posX = ProfilesList.this.scrollBarX() - this.loadButton.getWidth() - 10;
int posY = y - 2; int posY = y - 2;
int textY = y + entryHeight / 2; int textY = y + entryHeight / 2;