Skip to content

Commit

Permalink
Use built-in Fabric screen accessor
Browse files Browse the repository at this point in the history
  • Loading branch information
StavWasPlayZ committed Apr 24, 2024
1 parent 8858110 commit ea031ab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import com.cstav.genshinstrument.client.gui.widget.IconToggleButton;
import com.cstav.genshinstrument.client.keyMaps.InstrumentKeyMappings;
import com.cstav.genshinstrument.client.midi.InstrumentMidiReceiver;
import com.cstav.genshinstrument.mixin.required.ScreenAccessor;
import com.cstav.genshinstrument.networking.GIPacketHandler;
import com.cstav.genshinstrument.networking.buttonidentifier.NoteButtonIdentifier;
import com.cstav.genshinstrument.networking.packet.instrument.CloseInstrumentPacket;
import com.cstav.genshinstrument.sound.NoteSound;
Expand All @@ -19,6 +19,7 @@
import com.mojang.logging.LogUtils;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.client.screen.v1.Screens;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.components.AbstractWidget;
Expand Down Expand Up @@ -385,7 +386,7 @@ public void render(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPa
}
public void renderInstrument(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick) {
// To omit background
for (Renderable renderable : ((ScreenAccessor)this).getRenderables())
for (Renderable renderable : Screens.getButtons(this))
renderable.render(pGuiGraphics, pMouseX, pMouseY, pPartialTick);
}

Expand Down

This file was deleted.

0 comments on commit ea031ab

Please sign in to comment.