stonecutter: support MC 1.21.1

This commit is contained in:
Martin Prokoph
2025-11-04 23:25:26 +01:00
parent cb2989488c
commit 60a34c63a3
3 changed files with 18 additions and 5 deletions

View File

@@ -61,8 +61,13 @@ public class ButtonEntry extends ContainerObjectSelectionList.Entry<ButtonEntry>
if (info.entry != null && !this.buttons.isEmpty() && this.buttons.getFirst() instanceof AbstractWidget widget) {
int idMode = this.info.entry.idMode();
if (idMode != -1) context.renderItem(idMode == 0 ?
//? if >= 1.21.4 {
BuiltInRegistries.ITEM.getValue(ResourceLocation.tryParse(this.info.tempValue)).getDefaultInstance()
: BuiltInRegistries.BLOCK.getValue(ResourceLocation.tryParse(this.info.tempValue)).asItem().getDefaultInstance(),
//?} else {
/*BuiltInRegistries.ITEM.get(ResourceLocation.tryParse(this.info.tempValue)).getDefaultInstance()
: BuiltInRegistries.BLOCK.get(ResourceLocation.tryParse(this.info.tempValue)).asItem().getDefaultInstance(),
*///?}
widget.getX() + widget.getWidth() - 18, y + 2);
}
}