mirror of
https://github.com/TeamMidnightDust/MidnightLib.git
synced 2025-12-15 17:05:09 +01:00
stonecutter: support MC 1.21.1
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,11 @@ public class MidnightConfigListWidget extends ContainerObjectSelectionList<Butto
|
||||
}
|
||||
|
||||
@Override
|
||||
//? if >= 1.21.4 {
|
||||
public int scrollBarX() {
|
||||
//?} else {
|
||||
/*public int getScrollbarPosition() {
|
||||
*///?}
|
||||
return this.width - 7;
|
||||
}
|
||||
|
||||
@@ -33,11 +37,11 @@ public class MidnightConfigListWidget extends ContainerObjectSelectionList<Butto
|
||||
else
|
||||
context.blit(
|
||||
//? if >= 1.21.6 {
|
||||
RenderPipelines.GUI_TEXTURED
|
||||
//?} else {
|
||||
/*RenderType::guiTextured
|
||||
*///?}
|
||||
, this.minecraft.level == null ? Screen.FOOTER_SEPARATOR : Screen.INWORLD_FOOTER_SEPARATOR, this.getX(), this.getBottom(), 0, 0, this.getWidth(), 2, 32, 2);
|
||||
RenderPipelines.GUI_TEXTURED,
|
||||
//?} else if >= 1.21.4 {
|
||||
//RenderType::guiTextured,
|
||||
//?}
|
||||
this.minecraft.level == null ? Screen.FOOTER_SEPARATOR : Screen.INWORLD_FOOTER_SEPARATOR, this.getX(), this.getBottom(), 0, 0, this.getWidth(), 2, 32, 2);
|
||||
}
|
||||
|
||||
public void addButton(List<AbstractWidget> buttons, Component text, EntryInfo info) {
|
||||
|
||||
@@ -78,7 +78,11 @@ public class MidnightConfigScreen extends Screen {
|
||||
updateList();
|
||||
list.setScrollAmount(0);
|
||||
}
|
||||
//? >= 1.21.4 {
|
||||
scrollProgress = list.scrollAmount();
|
||||
//?} else {
|
||||
/*scrollProgress = list.getScrollAmount();
|
||||
*///?}
|
||||
for (EntryInfo info : MidnightConfig.entries.values())
|
||||
if (Objects.equals(modid, info.modid)) info.updateFieldValue();
|
||||
updateButtons();
|
||||
|
||||
Reference in New Issue
Block a user