Skip to content
This repository has been archived by the owner on Jan 4, 2024. It is now read-only.

Commit

Permalink
Fix helium flamingo gui icons
Browse files Browse the repository at this point in the history
  • Loading branch information
florensie committed Apr 9, 2022
1 parent 884f97e commit 74ca34c
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@
import artifacts.common.trinkets.TrinketsHelper;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.GuiComponent;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.FluidTags;
import net.minecraft.util.Mth;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
Expand All @@ -24,11 +22,10 @@
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(Gui.class)
public abstract class GuiMixin {
public abstract class GuiMixin extends GuiComponent {

@Unique private final ResourceLocation FLAMINGO_ICONS_TEXTURE = Artifacts.id("textures/gui/icons.png");

@Shadow @Final private Minecraft minecraft;
@Shadow private int screenHeight;
@Shadow private int screenWidth;

Expand Down Expand Up @@ -66,15 +63,15 @@ private void renderFlamingoAir(PoseStack matrices, CallbackInfo ci) {
int partial = Mth.ceil(progress * 10) - full;

for (int i = 0; i < full + partial; ++i) {
GuiComponent.blit(matrices, left - i * 8 - 9, top, -90, (i < full ? 0 : 9), 0, 9, 9, 16, 32);
// matrixStack, x, y, z, u, v, width, height, textureWidth, textureHeight
GuiComponent.blit(matrices, left - i * 8 - 9, top, 0, (i < full ? 0 : 9), 0, 9, 9, 32, 16);
}
matrices.popPose();
});
}

/**
* Calculate offset for our status bar height, taking rendering of other status bars into account
* This might take
*/
@Unique
private int getStatusBarHeightOffset(Player player) {
Expand Down

0 comments on commit 74ca34c

Please sign in to comment.