Skip to content

Commit

Permalink
One fewer allocation, waaow
Browse files Browse the repository at this point in the history
  • Loading branch information
Protonull committed Oct 1, 2024
1 parent 2b4f2b2 commit a16d63d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 136 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import uk.protonull.civ.chesttracker.gui.widgets.TextRenderable;
import uk.protonull.civ.chesttracker.mixing.InventoryWindow;
import uk.protonull.civ.chesttracker.utilities.Shortcuts;

Expand Down Expand Up @@ -57,14 +56,6 @@ public ContainerLocationDeciderScreen(

@Override
protected void init() {
addRenderableOnly(new TextRenderable.CentreAligned(
this.font,
this.width / 2,
20,
Component.translatable("civchesttracker.picker.header"),
PICKER_COLOUR_RBG
));

addRenderableWidget(new Button(
(this.width / 2) - (Button.DEFAULT_WIDTH / 2),
this.height - 40 - Button.DEFAULT_HEIGHT,
Expand Down Expand Up @@ -112,7 +103,25 @@ public void renderBackground(
final int mouseY,
final float partialTick
) {
// DO NOTHING
// Prevent the blurry background from being rendered as the player needs to be able to see the world.
}

@Override
public void render(
final @NotNull GuiGraphics guiGraphics,
final int mouseX,
final int mouseY,
final float partialTick
) {
super.render(guiGraphics, mouseX, mouseY, partialTick);

guiGraphics.drawCenteredString(
this.font,
Component.translatable("civchesttracker.picker.header"),
this.width / 2,
20,
PICKER_COLOUR_RBG
);
}

@Override
Expand Down

This file was deleted.

0 comments on commit a16d63d

Please sign in to comment.