mirror of
https://github.com/TeamMidnightDust/MidnightLib.git
synced 2025-12-16 01:15:08 +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) {
|
if (info.entry != null && !this.buttons.isEmpty() && this.buttons.getFirst() instanceof AbstractWidget widget) {
|
||||||
int idMode = this.info.entry.idMode();
|
int idMode = this.info.entry.idMode();
|
||||||
if (idMode != -1) context.renderItem(idMode == 0 ?
|
if (idMode != -1) context.renderItem(idMode == 0 ?
|
||||||
|
//? if >= 1.21.4 {
|
||||||
BuiltInRegistries.ITEM.getValue(ResourceLocation.tryParse(this.info.tempValue)).getDefaultInstance()
|
BuiltInRegistries.ITEM.getValue(ResourceLocation.tryParse(this.info.tempValue)).getDefaultInstance()
|
||||||
: BuiltInRegistries.BLOCK.getValue(ResourceLocation.tryParse(this.info.tempValue)).asItem().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);
|
widget.getX() + widget.getWidth() - 18, y + 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,11 @@ public class MidnightConfigListWidget extends ContainerObjectSelectionList<Butto
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
//? if >= 1.21.4 {
|
||||||
public int scrollBarX() {
|
public int scrollBarX() {
|
||||||
|
//?} else {
|
||||||
|
/*public int getScrollbarPosition() {
|
||||||
|
*///?}
|
||||||
return this.width - 7;
|
return this.width - 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -33,11 +37,11 @@ public class MidnightConfigListWidget extends ContainerObjectSelectionList<Butto
|
|||||||
else
|
else
|
||||||
context.blit(
|
context.blit(
|
||||||
//? if >= 1.21.6 {
|
//? if >= 1.21.6 {
|
||||||
RenderPipelines.GUI_TEXTURED
|
RenderPipelines.GUI_TEXTURED,
|
||||||
//?} else {
|
//?} else if >= 1.21.4 {
|
||||||
/*RenderType::guiTextured
|
//RenderType::guiTextured,
|
||||||
*///?}
|
//?}
|
||||||
, this.minecraft.level == null ? Screen.FOOTER_SEPARATOR : Screen.INWORLD_FOOTER_SEPARATOR, this.getX(), this.getBottom(), 0, 0, this.getWidth(), 2, 32, 2);
|
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) {
|
public void addButton(List<AbstractWidget> buttons, Component text, EntryInfo info) {
|
||||||
|
|||||||
@@ -78,7 +78,11 @@ public class MidnightConfigScreen extends Screen {
|
|||||||
updateList();
|
updateList();
|
||||||
list.setScrollAmount(0);
|
list.setScrollAmount(0);
|
||||||
}
|
}
|
||||||
|
//? >= 1.21.4 {
|
||||||
scrollProgress = list.scrollAmount();
|
scrollProgress = list.scrollAmount();
|
||||||
|
//?} else {
|
||||||
|
/*scrollProgress = list.getScrollAmount();
|
||||||
|
*///?}
|
||||||
for (EntryInfo info : MidnightConfig.entries.values())
|
for (EntryInfo info : MidnightConfig.entries.values())
|
||||||
if (Objects.equals(modid, info.modid)) info.updateFieldValue();
|
if (Objects.equals(modid, info.modid)) info.updateFieldValue();
|
||||||
updateButtons();
|
updateButtons();
|
||||||
|
|||||||
Reference in New Issue
Block a user