Rename the Ref methods that share a name with vanilla methods
WindowRef.getWidth/getHeight and ItemStackRef.isEmpty/getMaxDamage match methods of the classes they're mixed into, so the mixins can't implement them explicitly. With Mojang's names, Window.getWidth is also the framebuffer's width rather than the window's. They're now getWindowWidth/getWindowHeight and isEmptyStack/getMaxItemDamage (with getItemDamage to match). Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -75,16 +75,16 @@ public class ArmorDisplayMod extends Mod implements HudMod {
|
||||
|
||||
int row = 0;
|
||||
|
||||
if (useMainHand.value && !mainHand.isEmpty()) {
|
||||
if (useMainHand.value && !mainHand.isEmptyStack()) {
|
||||
row = renderSlot(scope, mainHand, row);
|
||||
}
|
||||
if (!helmet.isEmpty())
|
||||
if (!helmet.isEmptyStack())
|
||||
row = renderSlot(scope, helmet, row);
|
||||
if (!chestplate.isEmpty())
|
||||
if (!chestplate.isEmptyStack())
|
||||
row = renderSlot(scope, chestplate, row);
|
||||
if (!leggings.isEmpty())
|
||||
if (!leggings.isEmptyStack())
|
||||
row = renderSlot(scope, leggings, row);
|
||||
if (!boots.isEmpty())
|
||||
if (!boots.isEmptyStack())
|
||||
row = renderSlot(scope, boots, row);
|
||||
}
|
||||
|
||||
@@ -94,8 +94,8 @@ public class ArmorDisplayMod extends Mod implements HudMod {
|
||||
private int renderSlot(RenderScope scope, ItemStackRef item, int row) {
|
||||
scope.drawItem(item, 0, 15 * row);
|
||||
|
||||
if (item.getMaxDamage() > 0) {
|
||||
int remaining = item.getMaxDamage() - item.getDamage();
|
||||
if (item.getMaxItemDamage() > 0) {
|
||||
int remaining = item.getMaxItemDamage() - item.getItemDamage();
|
||||
scope.drawText(0.5f, String.valueOf(remaining),
|
||||
17, (15 * row) + 3,
|
||||
layout.font.value, layout.fgColor.value);
|
||||
|
||||
Reference in New Issue
Block a user