Skip to content

Commit

Permalink
WIP: Improve Instrument and MusicVenueTool overlays.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aeronica committed Mar 10, 2024
1 parent e763a79 commit a65d608
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,11 @@ public void playSound(SoundHandler pHandler) {
}
}

enum Position { LEFT, CENTER, RIGHT }
enum Position {
LEFT, CENTER, RIGHT;
private static final Position[] values = values();
public static Position getPosition(int ordinal) {
return ordinal >= 0 && ordinal < values.length ? values[ordinal] : LEFT;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.player.ClientPlayerEntity;
import net.minecraft.client.gui.AbstractGui;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Util;
import net.minecraft.util.math.MathHelper;

import javax.annotation.Nullable;
import java.util.Arrays;
import java.util.Objects;


public class OverlayItemGui extends AbstractGui {
Expand Down Expand Up @@ -67,10 +69,14 @@ public void clear() {
Arrays.fill(this.visible, null);
}

public Minecraft getMinecraft() {
private Minecraft getMinecraft() {
return this.minecraft;
}

private ClientPlayerEntity getPlayer() {
return Objects.requireNonNull(getMinecraft().player);
}

class OverlayInstance<T extends IOverlayItem> {
private final T overlayItem;
private long animationTime = -1L;
Expand Down

0 comments on commit a65d608

Please sign in to comment.