mirror of
https://github.com/PuzzleMC/Puzzle.git
synced 2025-12-15 19:35:10 +01:00
fix: compat with MidnightLib 1.7.0
This commit is contained in:
@@ -13,6 +13,7 @@ import net.minecraft.text.TranslatableTextContent;
|
|||||||
import net.minecraft.util.Formatting;
|
import net.minecraft.util.Formatting;
|
||||||
import net.puzzlemc.gui.screen.PuzzleOptionsScreen;
|
import net.puzzlemc.gui.screen.PuzzleOptionsScreen;
|
||||||
|
|
||||||
|
import java.lang.annotation.Annotation;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -33,7 +34,7 @@ public class PuzzleOptionListWidget extends MidnightConfig.MidnightConfigListWid
|
|||||||
for (PuzzleWidget button : buttons) {
|
for (PuzzleWidget button : buttons) {
|
||||||
try {
|
try {
|
||||||
if (button.buttonType == ButtonType.TEXT)
|
if (button.buttonType == ButtonType.TEXT)
|
||||||
this.addButton(List.of(), Text.literal(" ").append(button.descriptionText).formatted(Formatting.BOLD));
|
this.addButton(List.of(), Text.literal("").append(button.descriptionText).formatted(Formatting.BOLD));
|
||||||
else if (button.buttonType == ButtonType.BUTTON)
|
else if (button.buttonType == ButtonType.BUTTON)
|
||||||
this.addButton(List.of(new PuzzleButtonWidget(buttonX, 0, 150, 20, button.buttonTextAction, button.onPress)), button.descriptionText);
|
this.addButton(List.of(new PuzzleButtonWidget(buttonX, 0, 150, 20, button.buttonTextAction, button.onPress)), button.descriptionText);
|
||||||
else if (button.buttonType == ButtonType.SLIDER)
|
else if (button.buttonType == ButtonType.SLIDER)
|
||||||
@@ -50,8 +51,15 @@ public class PuzzleOptionListWidget extends MidnightConfig.MidnightConfigListWid
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void addButton(List<ClickableWidget> buttons, Text text) {
|
public void addButton(List<ClickableWidget> buttons, Text text) {
|
||||||
var entry = new MidnightConfig.ButtonEntry(buttons, text, new MidnightConfig.EntryInfo());
|
MidnightConfig.EntryInfo info = new MidnightConfig.EntryInfo(null, "puzzle");
|
||||||
entry.centered = buttons.isEmpty();
|
if (buttons.isEmpty()) info.comment = new MidnightConfig.Comment(){
|
||||||
|
public Class<? extends Annotation> annotationType() {return null;}
|
||||||
|
public boolean centered() {return true;}
|
||||||
|
public String category() {return "";}
|
||||||
|
public String name() {return "";}
|
||||||
|
public String requiredMod() {return "";}
|
||||||
|
};
|
||||||
|
var entry = new MidnightConfig.ButtonEntry(buttons, text, info);
|
||||||
this.addEntry(entry);
|
this.addEntry(entry);
|
||||||
}
|
}
|
||||||
public void renderWidget(DrawContext context, int mouseX, int mouseY, float delta) {
|
public void renderWidget(DrawContext context, int mouseX, int mouseY, float delta) {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ yarn_mappings=1.21.4+build.1
|
|||||||
enabled_platforms=fabric,neoforge
|
enabled_platforms=fabric,neoforge
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version = 2.0.4
|
mod_version = 2.0.5
|
||||||
maven_group = net.puzzlemc
|
maven_group = net.puzzlemc
|
||||||
archives_base_name = puzzle
|
archives_base_name = puzzle
|
||||||
release_type=release
|
release_type=release
|
||||||
@@ -22,7 +22,7 @@ neoforge_version=21.4.9-beta
|
|||||||
yarn_mappings_patch_neoforge_version = 1.21+build.4
|
yarn_mappings_patch_neoforge_version = 1.21+build.4
|
||||||
|
|
||||||
# Libraries
|
# Libraries
|
||||||
midnightlib_version = 1.6.6
|
midnightlib_version = 1.7.0+1.21.4
|
||||||
modmenu_version = 13.0.0-beta.1
|
modmenu_version = 13.0.0-beta.1
|
||||||
|
|
||||||
# Mod Integrations
|
# Mod Integrations
|
||||||
|
|||||||
Reference in New Issue
Block a user