[DEV] New Cloth Config GUIs, new nojang apis, and bug fixes
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
-def JDK = "21";
|
||||
-def majorMc = "1.21.2";
|
||||
-def modLoaders = "neoforge|fabric|quilt|paper";
|
||||
-def supportedMc = "1.21.3";
|
||||
-def supportedMc = "1.21.3|1.21.4";
|
||||
-def reltype = "port";
|
||||
+def JDK = "17";
|
||||
+def majorMc = "1.18.2";
|
||||
|
@@ -1,11 +1,13 @@
|
||||
--- a/Common/build.gradle
|
||||
+++ b/Common/build.gradle
|
||||
@@ -1,8 +1,8 @@
|
||||
@@ -1,10 +1,10 @@
|
||||
archivesBaseName = "${mod_name.replace(" ", "")}-Common-${minecraft_version}"
|
||||
|
||||
dependencies {
|
||||
- stupidRemapArch("dev.ftb.mods:ftb-essentials:${ftb_essentials}")
|
||||
stupidRemapArch("dev.ftb.mods:ftb-ranks:${ftb_ranks}")
|
||||
|
||||
stupidRemapArch("me.shedaniel.cloth:cloth-config:${cloth_config}")
|
||||
+
|
||||
}
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
--- a/Common/src/main/java/com/hypherionmc/craterlib/api/commands/CraterCommand.java
|
||||
+++ b/Common/src/main/java/com/hypherionmc/craterlib/api/commands/CraterCommand.java
|
||||
@@ -14,6 +14,7 @@
|
||||
@@ -15,6 +15,7 @@
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.commands.Commands;
|
||||
import net.minecraft.commands.arguments.GameProfileArgument;
|
||||
@@ -8,7 +8,7 @@
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
|
||||
@@ -53,7 +54,7 @@
|
||||
@@ -54,7 +55,7 @@
|
||||
public CraterCommand withGameProfilesArgument(String key, CommandExecutorWithArgs<List<BridgedGameProfile>> executor) {
|
||||
this.mojangCommand.then(Commands.argument(key, GameProfileArgument.gameProfile())
|
||||
.executes(context -> executor.run(
|
||||
@@ -17,7 +17,7 @@
|
||||
GameProfileArgument.getGameProfiles(context, key).stream().map(BridgedGameProfile::of).toList(),
|
||||
BridgedCommandSourceStack.of(context.getSource()))
|
||||
));
|
||||
@@ -63,7 +64,7 @@
|
||||
@@ -64,7 +65,7 @@
|
||||
public CraterCommand withBoolArgument(String key, CommandExecutorWithArgs<Boolean> executor) {
|
||||
this.mojangCommand.then(Commands.argument(key, BoolArgumentType.bool())
|
||||
.executes(context -> executor.run(
|
||||
@@ -26,7 +26,7 @@
|
||||
BoolArgumentType.getBool(context, key),
|
||||
BridgedCommandSourceStack.of(context.getSource())
|
||||
)));
|
||||
@@ -73,7 +74,7 @@
|
||||
@@ -74,7 +75,7 @@
|
||||
public CraterCommand withWordArgument(String key, CommandExecutorWithArgs<String> executor) {
|
||||
this.mojangCommand.then(Commands.argument(key, StringArgumentType.word())
|
||||
.executes(context -> executor.run(
|
||||
@@ -35,7 +35,7 @@
|
||||
StringArgumentType.getString(context, key),
|
||||
BridgedCommandSourceStack.of(context.getSource())
|
||||
)));
|
||||
@@ -83,7 +84,7 @@
|
||||
@@ -84,7 +85,7 @@
|
||||
public CraterCommand withStringArgument(String key, CommandExecutorWithArgs<String> executor) {
|
||||
this.mojangCommand.then(Commands.argument(key, StringArgumentType.string())
|
||||
.executes(context -> executor.run(
|
||||
@@ -44,7 +44,7 @@
|
||||
StringArgumentType.getString(context, key),
|
||||
BridgedCommandSourceStack.of(context.getSource())
|
||||
)));
|
||||
@@ -93,7 +94,7 @@
|
||||
@@ -94,7 +95,7 @@
|
||||
public CraterCommand withPhraseArgument(String key, CommandExecutorWithArgs<String> executor) {
|
||||
this.mojangCommand.then(Commands.argument(key, StringArgumentType.greedyString())
|
||||
.executes(context -> executor.run(
|
||||
@@ -53,7 +53,7 @@
|
||||
StringArgumentType.getString(context, key),
|
||||
BridgedCommandSourceStack.of(context.getSource())
|
||||
)));
|
||||
@@ -103,7 +104,7 @@
|
||||
@@ -104,7 +105,7 @@
|
||||
public CraterCommand withIntegerArgument(String key, CommandExecutorWithArgs<Integer> executor) {
|
||||
this.mojangCommand.then(Commands.argument(key, IntegerArgumentType.integer())
|
||||
.executes(context -> executor.run(
|
||||
@@ -62,15 +62,19 @@
|
||||
IntegerArgumentType.getInteger(context, key),
|
||||
BridgedCommandSourceStack.of(context.getSource())
|
||||
)));
|
||||
@@ -137,10 +138,10 @@
|
||||
}
|
||||
@@ -139,14 +140,14 @@
|
||||
|
||||
private boolean checkPermission(CommandSourceStack stack) {
|
||||
- if (!ModloaderEnvironment.INSTANCE.isModLoaded("luckperms") || !stack.isPlayer() || luckPermNode.isEmpty())
|
||||
try {
|
||||
- if (!ModloaderEnvironment.INSTANCE.isModLoaded("luckperms") || !stack.isPlayer() || luckPermNode.isEmpty())
|
||||
+ if (!ModloaderEnvironment.INSTANCE.isModLoaded("luckperms") || !(stack.getEntity() instanceof Player) || luckPermNode.isEmpty())
|
||||
return stack.hasPermission(this.permLevel);
|
||||
return stack.hasPermission(this.permLevel);
|
||||
|
||||
- return LuckPermsCompat.INSTANCE.hasPermission(stack.getPlayer(), this.luckPermNode) || stack.hasPermission(this.permLevel);
|
||||
- return LuckPermsCompat.INSTANCE.hasPermission(stack.getPlayer(), this.luckPermNode) || stack.hasPermission(this.permLevel);
|
||||
} catch (Exception e) {
|
||||
CraterConstants.LOG.error("Failed to check luckperms permissions", e);
|
||||
return stack.hasPermission(this.permLevel);
|
||||
}
|
||||
+ return LuckPermsCompat.INSTANCE.hasPermission((ServerPlayer) stack.getEntity(), this.luckPermNode) || stack.hasPermission(this.permLevel);
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,120 @@
|
||||
--- a/Common/src/main/java/com/hypherionmc/craterlib/client/gui/config/ClothConfigScreenBuilder.java
|
||||
+++ b/Common/src/main/java/com/hypherionmc/craterlib/client/gui/config/ClothConfigScreenBuilder.java
|
||||
@@ -14,6 +14,8 @@
|
||||
import net.minecraft.client.gui.components.toasts.SystemToast;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.network.chat.Component;
|
||||
+import net.minecraft.network.chat.TextComponent;
|
||||
+import net.minecraft.network.chat.TranslatableComponent;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -89,7 +91,7 @@
|
||||
.setParentScreen(parent)
|
||||
.setTitle(getTranslationKey(config, invoker, field.getName()));
|
||||
|
||||
- ConfigCategory category = builder.getOrCreateCategory(Component.literal("Entries"));
|
||||
+ ConfigCategory category = builder.getOrCreateCategory(new TextComponent("Entries"));
|
||||
|
||||
// Handle Existing items in the list
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
@@ -99,8 +101,8 @@
|
||||
// Add a button to open the edit screen, as well as a delete button
|
||||
category.addEntry(
|
||||
new ClothConfigButtonEntry(
|
||||
- Component.translatable("cl.buttons.entry", (i + 1)),
|
||||
- Component.translatable("cl.buttons.edit"),
|
||||
+ new TranslatableComponent("cl.buttons.entry", (i + 1)),
|
||||
+ new TranslatableComponent("cl.buttons.edit"),
|
||||
button -> Minecraft.getInstance().setScreen(
|
||||
buildSubScreen(config, item, builder.build())
|
||||
),
|
||||
@@ -121,8 +123,8 @@
|
||||
|
||||
category.addEntry(
|
||||
new ClothConfigButtonEntry(
|
||||
- Component.literal(""),
|
||||
- Component.translatable("cl.buttons.add_entry"),
|
||||
+ new TextComponent(""),
|
||||
+ new TranslatableComponent("cl.buttons.add_entry"),
|
||||
button -> {
|
||||
try {
|
||||
Object newItem = elementType.getDeclaredConstructor().newInstance();
|
||||
@@ -150,7 +152,7 @@
|
||||
*/
|
||||
private static void readConfigFields(AbstractConfig baseConfig, Object config, ConfigBuilder builder) {
|
||||
ConfigEntryBuilder entryBuilder = builder.entryBuilder();
|
||||
- ConfigCategory configCategory = builder.getOrCreateCategory(Component.literal("General"));
|
||||
+ ConfigCategory configCategory = builder.getOrCreateCategory(new TextComponent("General"));
|
||||
|
||||
for (Field field : config.getClass().getDeclaredFields()) {
|
||||
try {
|
||||
@@ -168,8 +170,8 @@
|
||||
if (val != null) {
|
||||
configCategory.addEntry(
|
||||
new ClothConfigButtonEntry(
|
||||
- Component.translatable("cl.config." + baseConfig.getClass().getSimpleName().toLowerCase() + "." + field.getName().toLowerCase()),
|
||||
- Component.translatable("cl.buttons.edit"),
|
||||
+ new TranslatableComponent("cl.config." + baseConfig.getClass().getSimpleName().toLowerCase() + "." + field.getName().toLowerCase()),
|
||||
+ new TranslatableComponent("cl.buttons.edit"),
|
||||
button -> Minecraft.getInstance().setScreen(
|
||||
buildSubScreen(baseConfig, val, builder.build())
|
||||
)
|
||||
@@ -285,7 +287,7 @@
|
||||
configCategory.addEntry(
|
||||
new ClothConfigButtonEntry(
|
||||
getTranslationKey(baseConfig, config, field.getName()),
|
||||
- Component.translatable("cl.buttons.edit"),
|
||||
+ new TranslatableComponent("cl.buttons.edit"),
|
||||
button -> Minecraft.getInstance().setScreen(
|
||||
buildListScreen(baseConfig, list, field, config, builder.build(), false)
|
||||
)
|
||||
@@ -310,19 +312,19 @@
|
||||
* @return A {@link Component} that can be used for the tooltip
|
||||
*/
|
||||
private static Component getToolTip(Field field) {
|
||||
- Component component = Component.empty();
|
||||
+ Component component = new TextComponent("");
|
||||
|
||||
if (field.isAnnotationPresent(SpecComment.class)) {
|
||||
SpecComment comment = field.getAnnotation(SpecComment.class);
|
||||
- component = Component.literal(comment.value());
|
||||
+ component = new TextComponent(comment.value());
|
||||
}
|
||||
|
||||
if (field.isAnnotationPresent(Tooltip.class)) {
|
||||
Tooltip tooltip = field.getAnnotation(Tooltip.class);
|
||||
- Component c = Component.empty();
|
||||
+ Component c = new TextComponent("");
|
||||
|
||||
for (String comment : tooltip.value()) {
|
||||
- c.getSiblings().add(Component.literal(comment));
|
||||
+ c.getSiblings().add(new TextComponent(comment));
|
||||
}
|
||||
|
||||
component = c;
|
||||
@@ -350,7 +352,7 @@
|
||||
baseKey += "." + fieldName.toLowerCase();
|
||||
}
|
||||
|
||||
- return Component.translatable(baseKey);
|
||||
+ return new TranslatableComponent(baseKey);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -390,11 +392,11 @@
|
||||
config.saveConfig(config);
|
||||
Files.deleteIfExists(backupPath);
|
||||
} catch (Exception e) {
|
||||
- Minecraft.getInstance().getToastManager().addToast(
|
||||
+ Minecraft.getInstance().getToasts().addToast(
|
||||
new SystemToast(
|
||||
- SystemToast.SystemToastId.PACK_LOAD_FAILURE,
|
||||
- Component.literal("Failed To Save Config"),
|
||||
- Component.literal("Restoring Backup Copy. Check log for details"))
|
||||
+ SystemToast.SystemToastIds.PACK_LOAD_FAILURE,
|
||||
+ new TextComponent("Failed To Save Config"),
|
||||
+ new TextComponent("Restoring Backup Copy. Check log for details"))
|
||||
);
|
||||
CraterConstants.LOG.error("Failed to save config, restoring backup", e);
|
||||
try {
|
@@ -23,7 +23,7 @@
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Modifier;
|
||||
@@ -49,7 +50,7 @@
|
||||
@@ -50,7 +51,7 @@
|
||||
private boolean dragging;
|
||||
|
||||
public CraterConfigScreen(AbstractConfig config, Screen parent, Object subConfig) {
|
||||
@@ -32,7 +32,7 @@
|
||||
this.parent = parent;
|
||||
this.config = config;
|
||||
if (subConfig != null) {
|
||||
@@ -64,11 +65,11 @@
|
||||
@@ -65,11 +66,11 @@
|
||||
}
|
||||
|
||||
private static Component toText(Enum<?> val) {
|
||||
@@ -46,7 +46,7 @@
|
||||
}
|
||||
|
||||
private void setupScreenFromConfig(Object object, Class<?> clazz) {
|
||||
@@ -94,7 +95,7 @@
|
||||
@@ -95,7 +96,7 @@
|
||||
tooltipLang = field.getAnnotation(Tooltip.class).value();
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
val,
|
||||
() -> val,
|
||||
(ret) -> {
|
||||
@@ -158,7 +159,7 @@
|
||||
@@ -159,7 +160,7 @@
|
||||
return new TextConfigOption<>(Objects::toString, BigDecimal::new);
|
||||
}
|
||||
if (value instanceof ResourceLocation) {
|
||||
@@ -64,7 +64,7 @@
|
||||
}
|
||||
if (isSubConfig) {
|
||||
return new SubConfigWidget<>(config, this, value);
|
||||
@@ -172,24 +173,24 @@
|
||||
@@ -173,24 +174,24 @@
|
||||
((List) children()).addAll(options);
|
||||
|
||||
int buttonWidths = Math.min(200, (width - 50 - 12) / 3);
|
||||
@@ -101,7 +101,7 @@
|
||||
|
||||
int y = (int) (TOP + 4 - Math.round(scrollerAmount));
|
||||
for (Option<?> option : options) {
|
||||
@@ -216,23 +217,24 @@
|
||||
@@ -217,23 +218,24 @@
|
||||
int maxY = this.height - BOTTOM;
|
||||
//RenderSystem.disableTexture();
|
||||
Tesselator tesselator = Tesselator.getInstance();
|
||||
@@ -143,7 +143,7 @@
|
||||
RenderSystem.disableBlend();
|
||||
//RenderSystem.enableTexture();
|
||||
}
|
||||
@@ -240,21 +242,22 @@
|
||||
@@ -241,21 +243,22 @@
|
||||
|
||||
private void renderShadow(PoseStack matrices) {
|
||||
Tesselator tesselator = Tesselator.getInstance();
|
||||
@@ -177,7 +177,7 @@
|
||||
//RenderSystem.enableTexture();
|
||||
RenderSystem.disableBlend();
|
||||
}
|
||||
@@ -265,15 +268,16 @@
|
||||
@@ -266,15 +269,16 @@
|
||||
|
||||
protected void overlayBackground(Matrix4f matrix, int minX, int minY, int maxX, int maxY, int red, int green, int blue, int startAlpha, int endAlpha) {
|
||||
Tesselator tesselator = Tesselator.getInstance();
|
||||
@@ -202,7 +202,7 @@
|
||||
}
|
||||
|
||||
public int scrollHeight() {
|
||||
@@ -321,22 +325,22 @@
|
||||
@@ -322,22 +326,22 @@
|
||||
@Override
|
||||
public void onClose() {
|
||||
if (isEdited()) {
|
||||
@@ -231,7 +231,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -375,15 +379,15 @@
|
||||
@@ -376,15 +380,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -10,7 +10,7 @@
|
||||
import net.minecraft.client.gui.components.AbstractWidget;
|
||||
import net.minecraft.client.gui.components.EditBox;
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
@@ -18,11 +18,11 @@
|
||||
public W widget;
|
||||
|
||||
@Override
|
||||
|
@@ -16,7 +16,7 @@
|
||||
|
||||
/**
|
||||
* Copied from Cloth Config Lite
|
||||
@@ -16,7 +16,7 @@
|
||||
@@ -17,7 +17,7 @@
|
||||
public class BaseWidget<T> extends Option<T> {
|
||||
|
||||
public static final int resetButtonOffset = 48;
|
||||
@@ -25,7 +25,7 @@
|
||||
private boolean hideReset = false;
|
||||
|
||||
private boolean isSubConfig = false;
|
||||
@@ -39,8 +39,8 @@
|
||||
@@ -40,8 +40,8 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -36,7 +36,7 @@
|
||||
boolean edited = isEdited() || hasErrors;
|
||||
if (edited) {
|
||||
text.withStyle(ChatFormatting.ITALIC);
|
||||
@@ -50,9 +50,9 @@
|
||||
@@ -51,9 +51,9 @@
|
||||
} else {
|
||||
text.withStyle(ChatFormatting.GRAY);
|
||||
}
|
||||
|
@@ -0,0 +1,67 @@
|
||||
--- a/Common/src/main/java/com/hypherionmc/craterlib/client/gui/config/widgets/ClothConfigButtonEntry.java
|
||||
+++ b/Common/src/main/java/com/hypherionmc/craterlib/client/gui/config/widgets/ClothConfigButtonEntry.java
|
||||
@@ -1,13 +1,14 @@
|
||||
package com.hypherionmc.craterlib.client.gui.config.widgets;
|
||||
|
||||
import com.mojang.blaze3d.platform.Window;
|
||||
+import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import me.shedaniel.clothconfig2.api.AbstractConfigListEntry;
|
||||
import net.minecraft.client.Minecraft;
|
||||
-import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.client.gui.components.Button;
|
||||
import net.minecraft.client.gui.components.events.GuiEventListener;
|
||||
import net.minecraft.client.gui.narration.NarratableEntry;
|
||||
import net.minecraft.network.chat.Component;
|
||||
+import net.minecraft.network.chat.TextComponent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -53,36 +54,36 @@
|
||||
this.wasEdited = wasEdited;
|
||||
|
||||
int mainButtonWidth = hasDeleteButton ? 75 : 100;
|
||||
- this.button = Button.builder(fieldName, onPress).size(mainButtonWidth, 20).pos(0, 0).build();
|
||||
- this.deleteButton = deletePress != null ? Button.builder(Component.literal("X"), deletePress).size(20, 20).pos(0, 0).build() : null;
|
||||
+ this.button = new Button(0, 0, mainButtonWidth, 20, fieldName, onPress);
|
||||
+ this.deleteButton = deletePress != null ? new Button(0, 0, 20, 20, new TextComponent("X"), deletePress) : null;
|
||||
this.displayName = displayName;
|
||||
}
|
||||
|
||||
@Override
|
||||
- public void render(GuiGraphics matrices, int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean isHovered, float delta) {
|
||||
+ public void render(PoseStack matrices, int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean isHovered, float delta) {
|
||||
Window window = Minecraft.getInstance().getWindow();
|
||||
Component displayedFieldName = displayName;
|
||||
if (Minecraft.getInstance().font.isBidirectional()) {
|
||||
- matrices.drawString(Minecraft.getInstance().font, displayedFieldName.getVisualOrderText(), window.getGuiScaledWidth() - x - Minecraft.getInstance().font.width(displayedFieldName), y + 6, 16777215);
|
||||
- this.button.setX(x);
|
||||
+ drawString(matrices, Minecraft.getInstance().font, displayedFieldName.getVisualOrderText(), window.getGuiScaledWidth() - x - Minecraft.getInstance().font.width(displayedFieldName), y + 6, 16777215);
|
||||
+ this.button.x = x;
|
||||
if (hasDeleteButton) {
|
||||
- this.deleteButton.setX(x + this.button.getWidth() + 4);
|
||||
+ this.deleteButton.x = x + this.button.getWidth() + 4;
|
||||
}
|
||||
} else {
|
||||
- matrices.drawString(Minecraft.getInstance().font, displayedFieldName.getVisualOrderText(), x, y + 6, this.getPreferredTextColor());
|
||||
+ drawString(matrices, Minecraft.getInstance().font, displayedFieldName.getVisualOrderText(), x, y + 6, this.getPreferredTextColor());
|
||||
if (hasDeleteButton) {
|
||||
- this.button.setX(x + entryWidth - this.button.getWidth() - 24);
|
||||
- this.deleteButton.setX(x + entryWidth - 20);
|
||||
+ this.button.x = x + entryWidth - this.button.getWidth() - 24;
|
||||
+ this.deleteButton.x = x + entryWidth - 20;
|
||||
} else {
|
||||
- this.button.setX(x + entryWidth - this.button.getWidth());
|
||||
+ this.button.x = x + entryWidth - this.button.getWidth();
|
||||
}
|
||||
}
|
||||
|
||||
- button.setY(y + (entryHeight - 20) / 2);
|
||||
+ button.y = y + (entryHeight - 20) / 2;
|
||||
button.render(matrices, mouseX, mouseY, delta);
|
||||
|
||||
if (hasDeleteButton) {
|
||||
- deleteButton.setY(y + (entryHeight - 20) / 2);
|
||||
+ deleteButton.y = y + (entryHeight - 20) / 2;
|
||||
deleteButton.render(matrices, mouseX, mouseY, delta);
|
||||
}
|
||||
}
|
@@ -15,7 +15,7 @@
|
||||
|
||||
/**
|
||||
* @author HypherionSA
|
||||
@@ -22,19 +24,19 @@
|
||||
@@ -23,19 +25,19 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -12,7 +12,7 @@
|
||||
import net.minecraft.client.gui.components.events.AbstractContainerEventHandler;
|
||||
import net.minecraft.client.gui.components.events.GuiEventListener;
|
||||
import net.minecraft.network.chat.Component;
|
||||
@@ -34,7 +34,7 @@
|
||||
@@ -35,7 +35,7 @@
|
||||
@Getter
|
||||
private List<String> langKeys = new ArrayList<>();
|
||||
|
||||
|
@@ -15,7 +15,7 @@
|
||||
|
||||
/**
|
||||
* @author HypherionSA
|
||||
@@ -23,12 +23,12 @@
|
||||
@@ -24,12 +24,12 @@
|
||||
this.subConfig = subConfig;
|
||||
this.screen = screen;
|
||||
|
||||
|
@@ -10,7 +10,7 @@
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
@@ -30,7 +30,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -8,7 +8,7 @@
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
@@ -18,7 +19,7 @@
|
||||
@@ -19,7 +20,7 @@
|
||||
public ToggleButton(List<T> options, Function<T, Component> toComponent) {
|
||||
this.options = options;
|
||||
this.toComponent = toComponent;
|
||||
|
@@ -7,15 +7,15 @@
|
||||
- stupidRemapArch("dev.ftb.mods:ftb-essentials:${ftb_essentials}")
|
||||
- stupidRemapArch("dev.ftb.mods:ftb-ranks:${ftb_ranks}")
|
||||
-
|
||||
modImplementation("me.shedaniel.cloth:cloth-config-fabric:${cloth_config}")
|
||||
modImplementation "maven.modrinth:fabrictailor:${fabrictailor}"
|
||||
modImplementation "maven.modrinth:vanish:${vanish}"
|
||||
|
||||
@@ -116,8 +113,8 @@
|
||||
@@ -117,8 +114,8 @@
|
||||
setVersionType("release")
|
||||
setChangelog(rootProject.file("changelog.md"))
|
||||
setProjectVersion("${minecraft_version}-${project.version}")
|
||||
- setDisplayName("[FABRIC/QUILT 1.21.3] CraterLib - ${project.version}")
|
||||
- setGameVersions("1.21.3")
|
||||
- setDisplayName("[FABRIC/QUILT 1.21.3/4] CraterLib - ${project.version}")
|
||||
- setGameVersions("1.21.3", "1.21.4")
|
||||
+ setDisplayName("[FABRIC/QUILT 1.18.2] CraterLib - ${project.version}")
|
||||
+ setGameVersions("1.18.2")
|
||||
setLoaders("fabric", "quilt")
|
||||
|
@@ -7,9 +7,9 @@
|
||||
- // NOT AVAILABLE ON FORGE modImplementation("maven.modrinth:vanishmod:${vanishmod}")
|
||||
+ modImplementation("maven.modrinth:vanishmod:${vanishmod}")
|
||||
|
||||
// Do not edit or remove
|
||||
implementation project(":Common")
|
||||
@@ -107,8 +107,8 @@
|
||||
modImplementation("me.shedaniel.cloth:cloth-config-forge:${cloth_config}")
|
||||
|
||||
@@ -109,8 +109,8 @@
|
||||
setVersionType("release")
|
||||
setChangelog(rootProject.file("changelog.md"))
|
||||
setProjectVersion("${minecraft_version}-${project.version}")
|
||||
|
@@ -1,13 +1,16 @@
|
||||
--- a/Forge/src/main/java/com/hypherionmc/craterlib/mixin/ConfigScreenHandlerMixin.java
|
||||
+++ b/Forge/src/main/java/com/hypherionmc/craterlib/mixin/ConfigScreenHandlerMixin.java
|
||||
@@ -1,12 +1,12 @@
|
||||
@@ -1,12 +1,15 @@
|
||||
package com.hypherionmc.craterlib.mixin;
|
||||
|
||||
+import com.hypherionmc.craterlib.client.gui.config.ClothConfigScreenBuilder;
|
||||
import com.hypherionmc.craterlib.client.gui.config.CraterConfigScreen;
|
||||
+import com.hypherionmc.craterlib.core.config.AbstractConfig;
|
||||
import com.hypherionmc.craterlib.core.config.ConfigController;
|
||||
-import com.hypherionmc.craterlib.core.config.ModuleConfig;
|
||||
+import com.hypherionmc.craterlib.core.config.annotations.ClothScreen;
|
||||
import com.hypherionmc.craterlib.core.config.annotations.NoConfigScreen;
|
||||
+import com.hypherionmc.craterlib.core.platform.ModloaderEnvironment;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
-import net.minecraftforge.client.ConfigScreenHandler;
|
||||
@@ -15,7 +18,7 @@
|
||||
import net.minecraftforge.forgespi.language.IModInfo;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
@@ -19,18 +19,18 @@
|
||||
@@ -19,24 +22,30 @@
|
||||
/**
|
||||
* @author HypherionSA
|
||||
*/
|
||||
@@ -32,9 +35,24 @@
|
||||
private static void injectConfigScreen(IModInfo selectedMod, CallbackInfoReturnable<Optional<BiFunction<Minecraft, Screen, Screen>>> cir) {
|
||||
- ConfigController.getMonitoredConfigs().forEach((conf, watcher) -> {
|
||||
+ ConfigController.getWatchedConfigs().forEach((conf, watcher) -> {
|
||||
if (!conf.getClass().isAnnotationPresent(NoConfigScreen.class)) {
|
||||
- ModuleConfig config = (ModuleConfig) conf;
|
||||
+ AbstractConfig config = watcher.getLeft();
|
||||
if (config.getModId().equals(selectedMod.getModId())) {
|
||||
cir.setReturnValue(
|
||||
Optional.of((minecraft, screen) -> new CraterConfigScreen(config, screen))
|
||||
AbstractConfig config = watcher.getLeft();
|
||||
if (config.getClass().isAnnotationPresent(NoConfigScreen.class))
|
||||
return;
|
||||
|
||||
- if (watcher.getLeft().getClass().isAnnotationPresent(ClothScreen.class) && (ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config") || ModloaderEnvironment.INSTANCE.isModLoaded("cloth-config") || ModloaderEnvironment.INSTANCE.isModLoaded("clothconfig"))) {
|
||||
- ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> ClothConfigScreenBuilder.buildConfigScreen(config, screen))));
|
||||
- } else {
|
||||
- //ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> new CraterConfigScreen(config, screen))));
|
||||
+ if (config.getModId().equals(selectedMod.getModId())) {
|
||||
+ if (watcher.getLeft().getClass().isAnnotationPresent(ClothScreen.class) && ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config")) {
|
||||
+ cir.setReturnValue(
|
||||
+ Optional.of((minecraft, screen) -> ClothConfigScreenBuilder.buildConfigScreen(config, screen))
|
||||
+ );
|
||||
+ } else {
|
||||
+ cir.setReturnValue(
|
||||
+ Optional.of((minecraft, screen) -> new CraterConfigScreen(config, screen))
|
||||
+ );
|
||||
+ }
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
--- a/NeoForge/build.gradle
|
||||
+++ /dev/null
|
||||
@@ -1,123 +1,0 @@
|
||||
@@ -1,133 +1,0 @@
|
||||
-archivesBaseName = "${mod_name.replace(" ", "")}-NeoForge-${minecraft_version}"
|
||||
-
|
||||
-dependencies {
|
||||
@@ -10,6 +10,8 @@
|
||||
- stupidRemapArch("dev.ftb.mods:ftb-essentials-neoforge:${ftb_essentials}")
|
||||
- stupidRemapArch("dev.ftb.mods:ftb-ranks-neoforge:${ftb_ranks}")
|
||||
-
|
||||
- modImplementation("me.shedaniel.cloth:cloth-config-neoforge:${cloth_config}")
|
||||
-
|
||||
- // Do not edit or remove
|
||||
- implementation project(":Common")
|
||||
-}
|
||||
@@ -117,10 +119,18 @@
|
||||
- setVersionType("release")
|
||||
- setChangelog(rootProject.file("changelog.md"))
|
||||
- setProjectVersion("${minecraft_version}-${project.version}")
|
||||
- setDisplayName("[NeoForge 1.21.3] CraterLib - ${project.version}")
|
||||
- setGameVersions("1.21.3")
|
||||
- setDisplayName("[NeoForge 1.21.3/1.21.4] CraterLib - ${project.version}")
|
||||
- setGameVersions("1.21.3", "1.21.4")
|
||||
- setLoaders("neoforge")
|
||||
- setArtifact(remapJar)
|
||||
- setCurseEnvironment("both")
|
||||
- setIsManualRelease(true)
|
||||
-
|
||||
- curseDepends {
|
||||
- optional("cloth-config")
|
||||
- }
|
||||
-
|
||||
- modrinthDepends {
|
||||
- optional("cloth-config")
|
||||
- }
|
||||
-}
|
||||
|
@@ -1,15 +1,18 @@
|
||||
--- a/NeoForge/src/main/java/com/hypherionmc/craterlib/client/NeoForgeClientHelper.java
|
||||
+++ /dev/null
|
||||
@@ -1,61 +1,0 @@
|
||||
@@ -1,69 +1,0 @@
|
||||
-package com.hypherionmc.craterlib.client;
|
||||
-
|
||||
-import com.hypherionmc.craterlib.api.events.client.LateInitEvent;
|
||||
-import com.hypherionmc.craterlib.client.gui.config.ClothConfigScreenBuilder;
|
||||
-import com.hypherionmc.craterlib.client.gui.config.CraterConfigScreen;
|
||||
-import com.hypherionmc.craterlib.core.config.AbstractConfig;
|
||||
-import com.hypherionmc.craterlib.core.config.ConfigController;
|
||||
-import com.hypherionmc.craterlib.core.config.annotations.ClothScreen;
|
||||
-import com.hypherionmc.craterlib.core.config.annotations.NoConfigScreen;
|
||||
-import com.hypherionmc.craterlib.core.event.CraterEventBus;
|
||||
-import com.hypherionmc.craterlib.core.platform.ClientPlatform;
|
||||
-import com.hypherionmc.craterlib.core.platform.ModloaderEnvironment;
|
||||
-import com.hypherionmc.craterlib.nojang.client.BridgedMinecraft;
|
||||
-import com.hypherionmc.craterlib.nojang.client.BridgedOptions;
|
||||
-import com.hypherionmc.craterlib.nojang.client.multiplayer.BridgedClientLevel;
|
||||
@@ -55,9 +58,14 @@
|
||||
- CraterEventBus.INSTANCE.postEvent(event);
|
||||
-
|
||||
- ConfigController.getWatchedConfigs().forEach((conf, watcher) -> {
|
||||
- if (!conf.getClass().isAnnotationPresent(NoConfigScreen.class)) {
|
||||
- AbstractConfig config = watcher.getLeft();
|
||||
- ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> new CraterConfigScreen(config, screen))));
|
||||
- AbstractConfig config = watcher.getLeft();
|
||||
- if (config.getClass().isAnnotationPresent(NoConfigScreen.class))
|
||||
- return;
|
||||
-
|
||||
- if (watcher.getLeft().getClass().isAnnotationPresent(ClothScreen.class) && (ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config") || ModloaderEnvironment.INSTANCE.isModLoaded("cloth-config") || ModloaderEnvironment.INSTANCE.isModLoaded("clothconfig"))) {
|
||||
- ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> ClothConfigScreenBuilder.buildConfigScreen(config, screen))));
|
||||
- } else {
|
||||
- //ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> new CraterConfigScreen(config, screen))));
|
||||
- }
|
||||
- });
|
||||
- }
|
||||
|
@@ -23,8 +23,12 @@
|
||||
|
||||
# Dependencies
|
||||
moon_config=1.0.10
|
||||
@@ -31,18 +28,17 @@
|
||||
@@ -29,21 +26,20 @@
|
||||
adventure=4.17.0
|
||||
rpc_sdk=1.0
|
||||
discord_formatter=2.0.0
|
||||
-cloth_config=17.0.144
|
||||
+cloth_config=6.5.102
|
||||
|
||||
# Mod Dependencies
|
||||
-fabrictailor=2.3.1
|
||||
|
@@ -6,7 +6,7 @@
|
||||
-def JDK = "21";
|
||||
-def majorMc = "1.21.2";
|
||||
-def modLoaders = "neoforge|fabric|quilt|paper";
|
||||
-def supportedMc = "1.21.3";
|
||||
-def supportedMc = "1.21.3|1.21.4";
|
||||
-def reltype = "port";
|
||||
+def JDK = "17";
|
||||
+def majorMc = "1.19.2";
|
||||
|
@@ -0,0 +1,14 @@
|
||||
--- a/Common/src/main/java/com/hypherionmc/craterlib/client/gui/config/ClothConfigScreenBuilder.java
|
||||
+++ b/Common/src/main/java/com/hypherionmc/craterlib/client/gui/config/ClothConfigScreenBuilder.java
|
||||
@@ -390,9 +390,9 @@
|
||||
config.saveConfig(config);
|
||||
Files.deleteIfExists(backupPath);
|
||||
} catch (Exception e) {
|
||||
- Minecraft.getInstance().getToastManager().addToast(
|
||||
+ Minecraft.getInstance().getToasts().addToast(
|
||||
new SystemToast(
|
||||
- SystemToast.SystemToastId.PACK_LOAD_FAILURE,
|
||||
+ SystemToast.SystemToastIds.PACK_LOAD_FAILURE,
|
||||
Component.literal("Failed To Save Config"),
|
||||
Component.literal("Restoring Backup Copy. Check log for details"))
|
||||
);
|
@@ -20,7 +20,7 @@
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Modifier;
|
||||
@@ -158,7 +157,7 @@
|
||||
@@ -159,7 +158,7 @@
|
||||
return new TextConfigOption<>(Objects::toString, BigDecimal::new);
|
||||
}
|
||||
if (value instanceof ResourceLocation) {
|
||||
@@ -29,7 +29,7 @@
|
||||
}
|
||||
if (isSubConfig) {
|
||||
return new SubConfigWidget<>(config, this, value);
|
||||
@@ -177,19 +176,19 @@
|
||||
@@ -178,19 +177,19 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -59,7 +59,7 @@
|
||||
|
||||
int y = (int) (TOP + 4 - Math.round(scrollerAmount));
|
||||
for (Option<?> option : options) {
|
||||
@@ -216,23 +215,24 @@
|
||||
@@ -217,23 +216,24 @@
|
||||
int maxY = this.height - BOTTOM;
|
||||
//RenderSystem.disableTexture();
|
||||
Tesselator tesselator = Tesselator.getInstance();
|
||||
@@ -101,7 +101,7 @@
|
||||
RenderSystem.disableBlend();
|
||||
//RenderSystem.enableTexture();
|
||||
}
|
||||
@@ -240,21 +240,22 @@
|
||||
@@ -241,21 +241,22 @@
|
||||
|
||||
private void renderShadow(PoseStack matrices) {
|
||||
Tesselator tesselator = Tesselator.getInstance();
|
||||
@@ -135,7 +135,7 @@
|
||||
//RenderSystem.enableTexture();
|
||||
RenderSystem.disableBlend();
|
||||
}
|
||||
@@ -265,15 +266,16 @@
|
||||
@@ -266,15 +267,16 @@
|
||||
|
||||
protected void overlayBackground(Matrix4f matrix, int minX, int minY, int maxX, int maxY, int red, int green, int blue, int startAlpha, int endAlpha) {
|
||||
Tesselator tesselator = Tesselator.getInstance();
|
||||
@@ -160,7 +160,7 @@
|
||||
}
|
||||
|
||||
public int scrollHeight() {
|
||||
@@ -331,12 +333,12 @@
|
||||
@@ -332,12 +334,12 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -175,7 +175,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -375,7 +377,7 @@
|
||||
@@ -376,7 +378,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@
|
||||
if (mouseX > startX && mouseX < startX + sizeX) {
|
||||
if (mouseY > startY && mouseY < startY + sizeY) {
|
||||
List<Component> list = new ArrayList<>();
|
||||
@@ -383,7 +385,7 @@
|
||||
@@ -384,7 +386,7 @@
|
||||
for (String desc : description) {
|
||||
list.add(Component.translatable(desc));
|
||||
}
|
||||
|
@@ -10,7 +10,7 @@
|
||||
import net.minecraft.client.gui.components.AbstractWidget;
|
||||
import net.minecraft.client.gui.components.EditBox;
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
@@ -18,11 +18,11 @@
|
||||
public W widget;
|
||||
|
||||
@Override
|
||||
|
@@ -11,7 +11,7 @@
|
||||
import net.minecraft.client.gui.components.Button;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.MutableComponent;
|
||||
@@ -16,7 +16,7 @@
|
||||
@@ -17,7 +17,7 @@
|
||||
public class BaseWidget<T> extends Option<T> {
|
||||
|
||||
public static final int resetButtonOffset = 48;
|
||||
@@ -20,7 +20,7 @@
|
||||
private boolean hideReset = false;
|
||||
|
||||
private boolean isSubConfig = false;
|
||||
@@ -39,7 +39,7 @@
|
||||
@@ -40,7 +40,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -29,7 +29,7 @@
|
||||
MutableComponent text = Component.literal(this.text.getString());
|
||||
boolean edited = isEdited() || hasErrors;
|
||||
if (edited) {
|
||||
@@ -50,9 +50,9 @@
|
||||
@@ -51,9 +51,9 @@
|
||||
} else {
|
||||
text.withStyle(ChatFormatting.GRAY);
|
||||
}
|
||||
|
@@ -0,0 +1,62 @@
|
||||
--- a/Common/src/main/java/com/hypherionmc/craterlib/client/gui/config/widgets/ClothConfigButtonEntry.java
|
||||
+++ b/Common/src/main/java/com/hypherionmc/craterlib/client/gui/config/widgets/ClothConfigButtonEntry.java
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.hypherionmc.craterlib.client.gui.config.widgets;
|
||||
|
||||
import com.mojang.blaze3d.platform.Window;
|
||||
+import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import me.shedaniel.clothconfig2.api.AbstractConfigListEntry;
|
||||
import net.minecraft.client.Minecraft;
|
||||
-import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.client.gui.components.Button;
|
||||
import net.minecraft.client.gui.components.events.GuiEventListener;
|
||||
import net.minecraft.client.gui.narration.NarratableEntry;
|
||||
@@ -53,36 +53,36 @@
|
||||
this.wasEdited = wasEdited;
|
||||
|
||||
int mainButtonWidth = hasDeleteButton ? 75 : 100;
|
||||
- this.button = Button.builder(fieldName, onPress).size(mainButtonWidth, 20).pos(0, 0).build();
|
||||
- this.deleteButton = deletePress != null ? Button.builder(Component.literal("X"), deletePress).size(20, 20).pos(0, 0).build() : null;
|
||||
+ this.button = new Button(0, 0, mainButtonWidth, 20, fieldName, onPress);
|
||||
+ this.deleteButton = deletePress != null ? new Button(0, 0, 20, 20, Component.literal("X"), deletePress) : null;
|
||||
this.displayName = displayName;
|
||||
}
|
||||
|
||||
@Override
|
||||
- public void render(GuiGraphics matrices, int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean isHovered, float delta) {
|
||||
+ public void render(PoseStack matrices, int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean isHovered, float delta) {
|
||||
Window window = Minecraft.getInstance().getWindow();
|
||||
Component displayedFieldName = displayName;
|
||||
if (Minecraft.getInstance().font.isBidirectional()) {
|
||||
- matrices.drawString(Minecraft.getInstance().font, displayedFieldName.getVisualOrderText(), window.getGuiScaledWidth() - x - Minecraft.getInstance().font.width(displayedFieldName), y + 6, 16777215);
|
||||
- this.button.setX(x);
|
||||
+ drawString(matrices, Minecraft.getInstance().font, displayedFieldName.getVisualOrderText(), window.getGuiScaledWidth() - x - Minecraft.getInstance().font.width(displayedFieldName), y + 6, 16777215);
|
||||
+ this.button.x = x;
|
||||
if (hasDeleteButton) {
|
||||
- this.deleteButton.setX(x + this.button.getWidth() + 4);
|
||||
+ this.deleteButton.x = x + this.button.getWidth() + 4;
|
||||
}
|
||||
} else {
|
||||
- matrices.drawString(Minecraft.getInstance().font, displayedFieldName.getVisualOrderText(), x, y + 6, this.getPreferredTextColor());
|
||||
+ drawString(matrices, Minecraft.getInstance().font, displayedFieldName.getVisualOrderText(), x, y + 6, this.getPreferredTextColor());
|
||||
if (hasDeleteButton) {
|
||||
- this.button.setX(x + entryWidth - this.button.getWidth() - 24);
|
||||
- this.deleteButton.setX(x + entryWidth - 20);
|
||||
+ this.button.x = x + entryWidth - this.button.getWidth() - 24;
|
||||
+ this.deleteButton.x = x + entryWidth - 20;
|
||||
} else {
|
||||
- this.button.setX(x + entryWidth - this.button.getWidth());
|
||||
+ this.button.x = x + entryWidth - this.button.getWidth();
|
||||
}
|
||||
}
|
||||
|
||||
- button.setY(y + (entryHeight - 20) / 2);
|
||||
+ button.y = y + (entryHeight - 20) / 2;
|
||||
button.render(matrices, mouseX, mouseY, delta);
|
||||
|
||||
if (hasDeleteButton) {
|
||||
- deleteButton.setY(y + (entryHeight - 20) / 2);
|
||||
+ deleteButton.y = y + (entryHeight - 20) / 2;
|
||||
deleteButton.render(matrices, mouseX, mouseY, delta);
|
||||
}
|
||||
}
|
@@ -14,7 +14,7 @@
|
||||
|
||||
/**
|
||||
* @author HypherionSA
|
||||
@@ -22,7 +23,7 @@
|
||||
@@ -23,7 +24,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -23,7 +23,7 @@
|
||||
if (cancel) {
|
||||
setMessage(Component.translatable(screen.isEdited() ? "t.clc.cancel_discard" : "gui.cancel"));
|
||||
} else {
|
||||
@@ -30,11 +31,11 @@
|
||||
@@ -31,11 +32,11 @@
|
||||
active = screen.isEdited() && !hasErrors;
|
||||
setMessage(Component.translatable(hasErrors ? "t.clc.error" : "t.clc.save"));
|
||||
}
|
||||
|
@@ -12,7 +12,7 @@
|
||||
import net.minecraft.client.gui.components.events.AbstractContainerEventHandler;
|
||||
import net.minecraft.client.gui.components.events.GuiEventListener;
|
||||
import net.minecraft.network.chat.Component;
|
||||
@@ -34,7 +34,7 @@
|
||||
@@ -35,7 +35,7 @@
|
||||
@Getter
|
||||
private List<String> langKeys = new ArrayList<>();
|
||||
|
||||
|
@@ -11,7 +11,7 @@
|
||||
import net.minecraft.client.gui.components.Button;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.network.chat.Component;
|
||||
@@ -23,11 +23,11 @@
|
||||
@@ -24,11 +24,11 @@
|
||||
this.subConfig = subConfig;
|
||||
this.screen = screen;
|
||||
|
||||
|
@@ -10,7 +10,7 @@
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
@@ -30,7 +30,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -1,6 +1,6 @@
|
||||
--- a/Common/src/main/java/com/hypherionmc/craterlib/client/gui/config/widgets/ToggleButton.java
|
||||
+++ b/Common/src/main/java/com/hypherionmc/craterlib/client/gui/config/widgets/ToggleButton.java
|
||||
@@ -18,7 +18,7 @@
|
||||
@@ -19,7 +19,7 @@
|
||||
public ToggleButton(List<T> options, Function<T, Component> toComponent) {
|
||||
this.options = options;
|
||||
this.toComponent = toComponent;
|
||||
|
@@ -5,15 +5,15 @@
|
||||
stupidRemapArch("dev.ftb.mods:ftb-essentials:${ftb_essentials}")
|
||||
stupidRemapArch("dev.ftb.mods:ftb-ranks:${ftb_ranks}")
|
||||
-
|
||||
modImplementation("me.shedaniel.cloth:cloth-config-fabric:${cloth_config}")
|
||||
modImplementation "maven.modrinth:fabrictailor:${fabrictailor}"
|
||||
modImplementation "maven.modrinth:vanish:${vanish}"
|
||||
|
||||
@@ -116,8 +115,8 @@
|
||||
@@ -117,8 +116,8 @@
|
||||
setVersionType("release")
|
||||
setChangelog(rootProject.file("changelog.md"))
|
||||
setProjectVersion("${minecraft_version}-${project.version}")
|
||||
- setDisplayName("[FABRIC/QUILT 1.21.3] CraterLib - ${project.version}")
|
||||
- setGameVersions("1.21.3")
|
||||
- setDisplayName("[FABRIC/QUILT 1.21.3/4] CraterLib - ${project.version}")
|
||||
- setGameVersions("1.21.3", "1.21.4")
|
||||
+ setDisplayName("[FABRIC/QUILT 1.19.2] CraterLib - ${project.version}")
|
||||
+ setGameVersions("1.19.2")
|
||||
setLoaders("fabric", "quilt")
|
||||
|
@@ -10,9 +10,9 @@
|
||||
+ stupidRemapArch("dev.ftb.mods:ftb-essentials-forge:${ftb_essentials}")
|
||||
+ stupidRemapArch("dev.ftb.mods:ftb-ranks-forge:${ftb_ranks}")
|
||||
|
||||
// Do not edit or remove
|
||||
implementation project(":Common")
|
||||
@@ -107,8 +110,8 @@
|
||||
modImplementation("me.shedaniel.cloth:cloth-config-forge:${cloth_config}")
|
||||
|
||||
@@ -109,8 +112,8 @@
|
||||
setVersionType("release")
|
||||
setChangelog(rootProject.file("changelog.md"))
|
||||
setProjectVersion("${minecraft_version}-${project.version}")
|
||||
|
@@ -1,24 +1,43 @@
|
||||
--- a/Forge/src/main/java/com/hypherionmc/craterlib/mixin/ConfigScreenHandlerMixin.java
|
||||
+++ b/Forge/src/main/java/com/hypherionmc/craterlib/mixin/ConfigScreenHandlerMixin.java
|
||||
@@ -1,8 +1,8 @@
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.hypherionmc.craterlib.mixin;
|
||||
|
||||
+import com.hypherionmc.craterlib.client.gui.config.ClothConfigScreenBuilder;
|
||||
import com.hypherionmc.craterlib.client.gui.config.CraterConfigScreen;
|
||||
+import com.hypherionmc.craterlib.core.config.AbstractConfig;
|
||||
import com.hypherionmc.craterlib.core.config.ConfigController;
|
||||
-import com.hypherionmc.craterlib.core.config.ModuleConfig;
|
||||
+import com.hypherionmc.craterlib.core.config.annotations.ClothScreen;
|
||||
import com.hypherionmc.craterlib.core.config.annotations.NoConfigScreen;
|
||||
+import com.hypherionmc.craterlib.core.platform.ModloaderEnvironment;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
@@ -28,9 +28,9 @@
|
||||
import net.minecraftforge.client.ConfigScreenHandler;
|
||||
@@ -28,15 +31,21 @@
|
||||
*/
|
||||
@Inject(at = @At("RETURN"), method = "getScreenFactoryFor", cancellable = true, remap = false)
|
||||
private static void injectConfigScreen(IModInfo selectedMod, CallbackInfoReturnable<Optional<BiFunction<Minecraft, Screen, Screen>>> cir) {
|
||||
- ConfigController.getMonitoredConfigs().forEach((conf, watcher) -> {
|
||||
+ ConfigController.getWatchedConfigs().forEach((conf, watcher) -> {
|
||||
if (!conf.getClass().isAnnotationPresent(NoConfigScreen.class)) {
|
||||
- ModuleConfig config = (ModuleConfig) conf;
|
||||
+ AbstractConfig config = watcher.getLeft();
|
||||
if (config.getModId().equals(selectedMod.getModId())) {
|
||||
cir.setReturnValue(
|
||||
Optional.of((minecraft, screen) -> new CraterConfigScreen(config, screen))
|
||||
AbstractConfig config = watcher.getLeft();
|
||||
if (config.getClass().isAnnotationPresent(NoConfigScreen.class))
|
||||
return;
|
||||
|
||||
- if (watcher.getLeft().getClass().isAnnotationPresent(ClothScreen.class) && (ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config") || ModloaderEnvironment.INSTANCE.isModLoaded("cloth-config") || ModloaderEnvironment.INSTANCE.isModLoaded("clothconfig"))) {
|
||||
- ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> ClothConfigScreenBuilder.buildConfigScreen(config, screen))));
|
||||
- } else {
|
||||
- //ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> new CraterConfigScreen(config, screen))));
|
||||
+ if (config.getModId().equals(selectedMod.getModId())) {
|
||||
+ if (watcher.getLeft().getClass().isAnnotationPresent(ClothScreen.class) && ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config")) {
|
||||
+ cir.setReturnValue(
|
||||
+ Optional.of((minecraft, screen) -> ClothConfigScreenBuilder.buildConfigScreen(config, screen))
|
||||
+ );
|
||||
+ } else {
|
||||
+ cir.setReturnValue(
|
||||
+ Optional.of((minecraft, screen) -> new CraterConfigScreen(config, screen))
|
||||
+ );
|
||||
+ }
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
--- a/NeoForge/build.gradle
|
||||
+++ /dev/null
|
||||
@@ -1,123 +1,0 @@
|
||||
@@ -1,133 +1,0 @@
|
||||
-archivesBaseName = "${mod_name.replace(" ", "")}-NeoForge-${minecraft_version}"
|
||||
-
|
||||
-dependencies {
|
||||
@@ -10,6 +10,8 @@
|
||||
- stupidRemapArch("dev.ftb.mods:ftb-essentials-neoforge:${ftb_essentials}")
|
||||
- stupidRemapArch("dev.ftb.mods:ftb-ranks-neoforge:${ftb_ranks}")
|
||||
-
|
||||
- modImplementation("me.shedaniel.cloth:cloth-config-neoforge:${cloth_config}")
|
||||
-
|
||||
- // Do not edit or remove
|
||||
- implementation project(":Common")
|
||||
-}
|
||||
@@ -117,10 +119,18 @@
|
||||
- setVersionType("release")
|
||||
- setChangelog(rootProject.file("changelog.md"))
|
||||
- setProjectVersion("${minecraft_version}-${project.version}")
|
||||
- setDisplayName("[NeoForge 1.21.3] CraterLib - ${project.version}")
|
||||
- setGameVersions("1.21.3")
|
||||
- setDisplayName("[NeoForge 1.21.3/1.21.4] CraterLib - ${project.version}")
|
||||
- setGameVersions("1.21.3", "1.21.4")
|
||||
- setLoaders("neoforge")
|
||||
- setArtifact(remapJar)
|
||||
- setCurseEnvironment("both")
|
||||
- setIsManualRelease(true)
|
||||
-
|
||||
- curseDepends {
|
||||
- optional("cloth-config")
|
||||
- }
|
||||
-
|
||||
- modrinthDepends {
|
||||
- optional("cloth-config")
|
||||
- }
|
||||
-}
|
||||
|
@@ -1,15 +1,18 @@
|
||||
--- a/NeoForge/src/main/java/com/hypherionmc/craterlib/client/NeoForgeClientHelper.java
|
||||
+++ /dev/null
|
||||
@@ -1,61 +1,0 @@
|
||||
@@ -1,69 +1,0 @@
|
||||
-package com.hypherionmc.craterlib.client;
|
||||
-
|
||||
-import com.hypherionmc.craterlib.api.events.client.LateInitEvent;
|
||||
-import com.hypherionmc.craterlib.client.gui.config.ClothConfigScreenBuilder;
|
||||
-import com.hypherionmc.craterlib.client.gui.config.CraterConfigScreen;
|
||||
-import com.hypherionmc.craterlib.core.config.AbstractConfig;
|
||||
-import com.hypherionmc.craterlib.core.config.ConfigController;
|
||||
-import com.hypherionmc.craterlib.core.config.annotations.ClothScreen;
|
||||
-import com.hypherionmc.craterlib.core.config.annotations.NoConfigScreen;
|
||||
-import com.hypherionmc.craterlib.core.event.CraterEventBus;
|
||||
-import com.hypherionmc.craterlib.core.platform.ClientPlatform;
|
||||
-import com.hypherionmc.craterlib.core.platform.ModloaderEnvironment;
|
||||
-import com.hypherionmc.craterlib.nojang.client.BridgedMinecraft;
|
||||
-import com.hypherionmc.craterlib.nojang.client.BridgedOptions;
|
||||
-import com.hypherionmc.craterlib.nojang.client.multiplayer.BridgedClientLevel;
|
||||
@@ -55,9 +58,14 @@
|
||||
- CraterEventBus.INSTANCE.postEvent(event);
|
||||
-
|
||||
- ConfigController.getWatchedConfigs().forEach((conf, watcher) -> {
|
||||
- if (!conf.getClass().isAnnotationPresent(NoConfigScreen.class)) {
|
||||
- AbstractConfig config = watcher.getLeft();
|
||||
- ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> new CraterConfigScreen(config, screen))));
|
||||
- AbstractConfig config = watcher.getLeft();
|
||||
- if (config.getClass().isAnnotationPresent(NoConfigScreen.class))
|
||||
- return;
|
||||
-
|
||||
- if (watcher.getLeft().getClass().isAnnotationPresent(ClothScreen.class) && (ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config") || ModloaderEnvironment.INSTANCE.isModLoaded("cloth-config") || ModloaderEnvironment.INSTANCE.isModLoaded("clothconfig"))) {
|
||||
- ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> ClothConfigScreenBuilder.buildConfigScreen(config, screen))));
|
||||
- } else {
|
||||
- //ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> new CraterConfigScreen(config, screen))));
|
||||
- }
|
||||
- });
|
||||
- }
|
||||
|
@@ -23,8 +23,12 @@
|
||||
|
||||
# Dependencies
|
||||
moon_config=1.0.10
|
||||
@@ -31,18 +28,17 @@
|
||||
@@ -29,21 +26,20 @@
|
||||
adventure=4.17.0
|
||||
rpc_sdk=1.0
|
||||
discord_formatter=2.0.0
|
||||
-cloth_config=17.0.144
|
||||
+cloth_config=8.3.134
|
||||
|
||||
# Mod Dependencies
|
||||
-fabrictailor=2.3.1
|
||||
|
@@ -6,7 +6,7 @@
|
||||
-def JDK = "21";
|
||||
-def majorMc = "1.21.2";
|
||||
-def modLoaders = "neoforge|fabric|quilt|paper";
|
||||
-def supportedMc = "1.21.3";
|
||||
-def supportedMc = "1.21.3|1.21.4";
|
||||
-def reltype = "port";
|
||||
+def JDK = "17";
|
||||
+def majorMc = "1.19.3";
|
||||
|
@@ -0,0 +1,14 @@
|
||||
--- a/Common/src/main/java/com/hypherionmc/craterlib/client/gui/config/ClothConfigScreenBuilder.java
|
||||
+++ b/Common/src/main/java/com/hypherionmc/craterlib/client/gui/config/ClothConfigScreenBuilder.java
|
||||
@@ -390,9 +390,9 @@
|
||||
config.saveConfig(config);
|
||||
Files.deleteIfExists(backupPath);
|
||||
} catch (Exception e) {
|
||||
- Minecraft.getInstance().getToastManager().addToast(
|
||||
+ Minecraft.getInstance().getToasts().addToast(
|
||||
new SystemToast(
|
||||
- SystemToast.SystemToastId.PACK_LOAD_FAILURE,
|
||||
+ SystemToast.SystemToastIds.PACK_LOAD_FAILURE,
|
||||
Component.literal("Failed To Save Config"),
|
||||
Component.literal("Restoring Backup Copy. Check log for details"))
|
||||
);
|
@@ -8,7 +8,7 @@
|
||||
import net.minecraft.client.gui.screens.ConfirmScreen;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.client.renderer.GameRenderer;
|
||||
@@ -158,7 +157,7 @@
|
||||
@@ -159,7 +158,7 @@
|
||||
return new TextConfigOption<>(Objects::toString, BigDecimal::new);
|
||||
}
|
||||
if (value instanceof ResourceLocation) {
|
||||
@@ -17,7 +17,7 @@
|
||||
}
|
||||
if (isSubConfig) {
|
||||
return new SubConfigWidget<>(config, this, value);
|
||||
@@ -177,19 +176,19 @@
|
||||
@@ -178,19 +177,19 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -47,7 +47,7 @@
|
||||
|
||||
int y = (int) (TOP + 4 - Math.round(scrollerAmount));
|
||||
for (Option<?> option : options) {
|
||||
@@ -216,23 +215,24 @@
|
||||
@@ -217,23 +216,24 @@
|
||||
int maxY = this.height - BOTTOM;
|
||||
//RenderSystem.disableTexture();
|
||||
Tesselator tesselator = Tesselator.getInstance();
|
||||
@@ -89,7 +89,7 @@
|
||||
RenderSystem.disableBlend();
|
||||
//RenderSystem.enableTexture();
|
||||
}
|
||||
@@ -240,21 +240,22 @@
|
||||
@@ -241,21 +241,22 @@
|
||||
|
||||
private void renderShadow(PoseStack matrices) {
|
||||
Tesselator tesselator = Tesselator.getInstance();
|
||||
@@ -123,7 +123,7 @@
|
||||
//RenderSystem.enableTexture();
|
||||
RenderSystem.disableBlend();
|
||||
}
|
||||
@@ -265,15 +266,16 @@
|
||||
@@ -266,15 +267,16 @@
|
||||
|
||||
protected void overlayBackground(Matrix4f matrix, int minX, int minY, int maxX, int maxY, int red, int green, int blue, int startAlpha, int endAlpha) {
|
||||
Tesselator tesselator = Tesselator.getInstance();
|
||||
@@ -148,7 +148,7 @@
|
||||
}
|
||||
|
||||
public int scrollHeight() {
|
||||
@@ -331,12 +333,12 @@
|
||||
@@ -332,12 +334,12 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -163,7 +163,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -375,7 +377,7 @@
|
||||
@@ -376,7 +378,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,7 +172,7 @@
|
||||
if (mouseX > startX && mouseX < startX + sizeX) {
|
||||
if (mouseY > startY && mouseY < startY + sizeY) {
|
||||
List<Component> list = new ArrayList<>();
|
||||
@@ -383,7 +385,7 @@
|
||||
@@ -384,7 +386,7 @@
|
||||
for (String desc : description) {
|
||||
list.add(Component.translatable(desc));
|
||||
}
|
||||
|
@@ -10,7 +10,7 @@
|
||||
import net.minecraft.client.gui.components.AbstractWidget;
|
||||
import net.minecraft.client.gui.components.EditBox;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
@@ -18,7 +18,7 @@
|
||||
public W widget;
|
||||
|
||||
@Override
|
||||
|
@@ -11,7 +11,7 @@
|
||||
import net.minecraft.client.gui.components.Button;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.MutableComponent;
|
||||
@@ -39,7 +39,7 @@
|
||||
@@ -40,7 +40,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -20,7 +20,7 @@
|
||||
MutableComponent text = Component.literal(this.text.getString());
|
||||
boolean edited = isEdited() || hasErrors;
|
||||
if (edited) {
|
||||
@@ -50,7 +50,7 @@
|
||||
@@ -51,7 +51,7 @@
|
||||
} else {
|
||||
text.withStyle(ChatFormatting.GRAY);
|
||||
}
|
||||
|
@@ -0,0 +1,34 @@
|
||||
--- a/Common/src/main/java/com/hypherionmc/craterlib/client/gui/config/widgets/ClothConfigButtonEntry.java
|
||||
+++ b/Common/src/main/java/com/hypherionmc/craterlib/client/gui/config/widgets/ClothConfigButtonEntry.java
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.hypherionmc.craterlib.client.gui.config.widgets;
|
||||
|
||||
import com.mojang.blaze3d.platform.Window;
|
||||
+import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import me.shedaniel.clothconfig2.api.AbstractConfigListEntry;
|
||||
import net.minecraft.client.Minecraft;
|
||||
-import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.client.gui.components.Button;
|
||||
import net.minecraft.client.gui.components.events.GuiEventListener;
|
||||
import net.minecraft.client.gui.narration.NarratableEntry;
|
||||
@@ -59,17 +59,17 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
- public void render(GuiGraphics matrices, int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean isHovered, float delta) {
|
||||
+ public void render(PoseStack matrices, int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean isHovered, float delta) {
|
||||
Window window = Minecraft.getInstance().getWindow();
|
||||
Component displayedFieldName = displayName;
|
||||
if (Minecraft.getInstance().font.isBidirectional()) {
|
||||
- matrices.drawString(Minecraft.getInstance().font, displayedFieldName.getVisualOrderText(), window.getGuiScaledWidth() - x - Minecraft.getInstance().font.width(displayedFieldName), y + 6, 16777215);
|
||||
+ drawString(matrices, Minecraft.getInstance().font, displayedFieldName.getVisualOrderText(), window.getGuiScaledWidth() - x - Minecraft.getInstance().font.width(displayedFieldName), y + 6, 16777215);
|
||||
this.button.setX(x);
|
||||
if (hasDeleteButton) {
|
||||
this.deleteButton.setX(x + this.button.getWidth() + 4);
|
||||
}
|
||||
} else {
|
||||
- matrices.drawString(Minecraft.getInstance().font, displayedFieldName.getVisualOrderText(), x, y + 6, this.getPreferredTextColor());
|
||||
+ drawString(matrices, Minecraft.getInstance().font, displayedFieldName.getVisualOrderText(), x, y + 6, this.getPreferredTextColor());
|
||||
if (hasDeleteButton) {
|
||||
this.button.setX(x + entryWidth - this.button.getWidth() - 24);
|
||||
this.deleteButton.setX(x + entryWidth - 20);
|
@@ -14,7 +14,7 @@
|
||||
|
||||
/**
|
||||
* @author HypherionSA
|
||||
@@ -22,7 +23,7 @@
|
||||
@@ -23,7 +24,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -23,7 +23,7 @@
|
||||
if (cancel) {
|
||||
setMessage(Component.translatable(screen.isEdited() ? "t.clc.cancel_discard" : "gui.cancel"));
|
||||
} else {
|
||||
@@ -30,7 +31,7 @@
|
||||
@@ -31,7 +32,7 @@
|
||||
active = screen.isEdited() && !hasErrors;
|
||||
setMessage(Component.translatable(hasErrors ? "t.clc.error" : "t.clc.save"));
|
||||
}
|
||||
|
@@ -12,7 +12,7 @@
|
||||
import net.minecraft.client.gui.components.events.AbstractContainerEventHandler;
|
||||
import net.minecraft.client.gui.components.events.GuiEventListener;
|
||||
import net.minecraft.network.chat.Component;
|
||||
@@ -34,7 +34,7 @@
|
||||
@@ -35,7 +35,7 @@
|
||||
@Getter
|
||||
private List<String> langKeys = new ArrayList<>();
|
||||
|
||||
|
@@ -11,7 +11,7 @@
|
||||
import net.minecraft.client.gui.components.Button;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.network.chat.Component;
|
||||
@@ -27,7 +27,7 @@
|
||||
@@ -28,7 +28,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -10,7 +10,7 @@
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
@@ -30,7 +30,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -5,15 +5,15 @@
|
||||
stupidRemapArch("dev.ftb.mods:ftb-essentials:${ftb_essentials}")
|
||||
stupidRemapArch("dev.ftb.mods:ftb-ranks:${ftb_ranks}")
|
||||
-
|
||||
modImplementation("me.shedaniel.cloth:cloth-config-fabric:${cloth_config}")
|
||||
modImplementation "maven.modrinth:fabrictailor:${fabrictailor}"
|
||||
modImplementation "maven.modrinth:vanish:${vanish}"
|
||||
|
||||
@@ -116,8 +115,8 @@
|
||||
@@ -117,8 +116,8 @@
|
||||
setVersionType("release")
|
||||
setChangelog(rootProject.file("changelog.md"))
|
||||
setProjectVersion("${minecraft_version}-${project.version}")
|
||||
- setDisplayName("[FABRIC/QUILT 1.21.3] CraterLib - ${project.version}")
|
||||
- setGameVersions("1.21.3")
|
||||
- setDisplayName("[FABRIC/QUILT 1.21.3/4] CraterLib - ${project.version}")
|
||||
- setGameVersions("1.21.3", "1.21.4")
|
||||
+ setDisplayName("[FABRIC/QUILT 1.19.4] CraterLib - ${project.version}")
|
||||
+ setGameVersions("1.19.4")
|
||||
setLoaders("fabric", "quilt")
|
||||
|
@@ -10,9 +10,9 @@
|
||||
+ stupidRemapArch("dev.ftb.mods:ftb-essentials-forge:${ftb_essentials}")
|
||||
+ stupidRemapArch("dev.ftb.mods:ftb-ranks-forge:${ftb_ranks}")
|
||||
|
||||
// Do not edit or remove
|
||||
implementation project(":Common")
|
||||
@@ -107,8 +110,8 @@
|
||||
modImplementation("me.shedaniel.cloth:cloth-config-forge:${cloth_config}")
|
||||
|
||||
@@ -109,8 +112,8 @@
|
||||
setVersionType("release")
|
||||
setChangelog(rootProject.file("changelog.md"))
|
||||
setProjectVersion("${minecraft_version}-${project.version}")
|
||||
|
@@ -1,22 +1,45 @@
|
||||
--- a/Forge/src/main/java/com/hypherionmc/craterlib/mixin/ConfigScreenHandlerMixin.java
|
||||
+++ b/Forge/src/main/java/com/hypherionmc/craterlib/mixin/ConfigScreenHandlerMixin.java
|
||||
@@ -1,6 +1,7 @@
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.hypherionmc.craterlib.mixin;
|
||||
|
||||
+import com.hypherionmc.craterlib.client.gui.config.ClothConfigScreenBuilder;
|
||||
import com.hypherionmc.craterlib.client.gui.config.CraterConfigScreen;
|
||||
+import com.hypherionmc.craterlib.core.config.AbstractConfig;
|
||||
import com.hypherionmc.craterlib.core.config.ConfigController;
|
||||
import com.hypherionmc.craterlib.core.config.ModuleConfig;
|
||||
-import com.hypherionmc.craterlib.core.config.ModuleConfig;
|
||||
+import com.hypherionmc.craterlib.core.config.annotations.ClothScreen;
|
||||
import com.hypherionmc.craterlib.core.config.annotations.NoConfigScreen;
|
||||
@@ -28,9 +29,9 @@
|
||||
+import com.hypherionmc.craterlib.core.platform.ModloaderEnvironment;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraftforge.client.ConfigScreenHandler;
|
||||
@@ -28,17 +31,22 @@
|
||||
*/
|
||||
@Inject(at = @At("RETURN"), method = "getScreenFactoryFor", cancellable = true, remap = false)
|
||||
private static void injectConfigScreen(IModInfo selectedMod, CallbackInfoReturnable<Optional<BiFunction<Minecraft, Screen, Screen>>> cir) {
|
||||
- ConfigController.getMonitoredConfigs().forEach((conf, watcher) -> {
|
||||
+ ConfigController.getWatchedConfigs().forEach((conf, watcher) -> {
|
||||
if (!conf.getClass().isAnnotationPresent(NoConfigScreen.class)) {
|
||||
- ModuleConfig config = (ModuleConfig) conf;
|
||||
+ AbstractConfig config = watcher.getLeft();
|
||||
if (config.getModId().equals(selectedMod.getModId())) {
|
||||
cir.setReturnValue(
|
||||
Optional.of((minecraft, screen) -> new CraterConfigScreen(config, screen))
|
||||
AbstractConfig config = watcher.getLeft();
|
||||
if (config.getClass().isAnnotationPresent(NoConfigScreen.class))
|
||||
return;
|
||||
|
||||
- if (watcher.getLeft().getClass().isAnnotationPresent(ClothScreen.class) && (ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config") || ModloaderEnvironment.INSTANCE.isModLoaded("cloth-config") || ModloaderEnvironment.INSTANCE.isModLoaded("clothconfig"))) {
|
||||
- ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> ClothConfigScreenBuilder.buildConfigScreen(config, screen))));
|
||||
- } else {
|
||||
- //ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> new CraterConfigScreen(config, screen))));
|
||||
+ if (config.getModId().equals(selectedMod.getModId())) {
|
||||
+ if (watcher.getLeft().getClass().isAnnotationPresent(ClothScreen.class) && ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config")) {
|
||||
+ cir.setReturnValue(
|
||||
+ Optional.of((minecraft, screen) -> ClothConfigScreenBuilder.buildConfigScreen(config, screen))
|
||||
+ );
|
||||
+ } else {
|
||||
+ cir.setReturnValue(
|
||||
+ Optional.of((minecraft, screen) -> new CraterConfigScreen(config, screen))
|
||||
+ );
|
||||
+ }
|
||||
}
|
||||
});
|
||||
}
|
||||
-
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
--- a/NeoForge/build.gradle
|
||||
+++ /dev/null
|
||||
@@ -1,123 +1,0 @@
|
||||
@@ -1,133 +1,0 @@
|
||||
-archivesBaseName = "${mod_name.replace(" ", "")}-NeoForge-${minecraft_version}"
|
||||
-
|
||||
-dependencies {
|
||||
@@ -10,6 +10,8 @@
|
||||
- stupidRemapArch("dev.ftb.mods:ftb-essentials-neoforge:${ftb_essentials}")
|
||||
- stupidRemapArch("dev.ftb.mods:ftb-ranks-neoforge:${ftb_ranks}")
|
||||
-
|
||||
- modImplementation("me.shedaniel.cloth:cloth-config-neoforge:${cloth_config}")
|
||||
-
|
||||
- // Do not edit or remove
|
||||
- implementation project(":Common")
|
||||
-}
|
||||
@@ -117,10 +119,18 @@
|
||||
- setVersionType("release")
|
||||
- setChangelog(rootProject.file("changelog.md"))
|
||||
- setProjectVersion("${minecraft_version}-${project.version}")
|
||||
- setDisplayName("[NeoForge 1.21.3] CraterLib - ${project.version}")
|
||||
- setGameVersions("1.21.3")
|
||||
- setDisplayName("[NeoForge 1.21.3/1.21.4] CraterLib - ${project.version}")
|
||||
- setGameVersions("1.21.3", "1.21.4")
|
||||
- setLoaders("neoforge")
|
||||
- setArtifact(remapJar)
|
||||
- setCurseEnvironment("both")
|
||||
- setIsManualRelease(true)
|
||||
-
|
||||
- curseDepends {
|
||||
- optional("cloth-config")
|
||||
- }
|
||||
-
|
||||
- modrinthDepends {
|
||||
- optional("cloth-config")
|
||||
- }
|
||||
-}
|
||||
|
@@ -1,15 +1,18 @@
|
||||
--- a/NeoForge/src/main/java/com/hypherionmc/craterlib/client/NeoForgeClientHelper.java
|
||||
+++ /dev/null
|
||||
@@ -1,61 +1,0 @@
|
||||
@@ -1,69 +1,0 @@
|
||||
-package com.hypherionmc.craterlib.client;
|
||||
-
|
||||
-import com.hypherionmc.craterlib.api.events.client.LateInitEvent;
|
||||
-import com.hypherionmc.craterlib.client.gui.config.ClothConfigScreenBuilder;
|
||||
-import com.hypherionmc.craterlib.client.gui.config.CraterConfigScreen;
|
||||
-import com.hypherionmc.craterlib.core.config.AbstractConfig;
|
||||
-import com.hypherionmc.craterlib.core.config.ConfigController;
|
||||
-import com.hypherionmc.craterlib.core.config.annotations.ClothScreen;
|
||||
-import com.hypherionmc.craterlib.core.config.annotations.NoConfigScreen;
|
||||
-import com.hypherionmc.craterlib.core.event.CraterEventBus;
|
||||
-import com.hypherionmc.craterlib.core.platform.ClientPlatform;
|
||||
-import com.hypherionmc.craterlib.core.platform.ModloaderEnvironment;
|
||||
-import com.hypherionmc.craterlib.nojang.client.BridgedMinecraft;
|
||||
-import com.hypherionmc.craterlib.nojang.client.BridgedOptions;
|
||||
-import com.hypherionmc.craterlib.nojang.client.multiplayer.BridgedClientLevel;
|
||||
@@ -55,9 +58,14 @@
|
||||
- CraterEventBus.INSTANCE.postEvent(event);
|
||||
-
|
||||
- ConfigController.getWatchedConfigs().forEach((conf, watcher) -> {
|
||||
- if (!conf.getClass().isAnnotationPresent(NoConfigScreen.class)) {
|
||||
- AbstractConfig config = watcher.getLeft();
|
||||
- ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> new CraterConfigScreen(config, screen))));
|
||||
- AbstractConfig config = watcher.getLeft();
|
||||
- if (config.getClass().isAnnotationPresent(NoConfigScreen.class))
|
||||
- return;
|
||||
-
|
||||
- if (watcher.getLeft().getClass().isAnnotationPresent(ClothScreen.class) && (ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config") || ModloaderEnvironment.INSTANCE.isModLoaded("cloth-config") || ModloaderEnvironment.INSTANCE.isModLoaded("clothconfig"))) {
|
||||
- ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> ClothConfigScreenBuilder.buildConfigScreen(config, screen))));
|
||||
- } else {
|
||||
- //ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> new CraterConfigScreen(config, screen))));
|
||||
- }
|
||||
- });
|
||||
- }
|
||||
|
@@ -23,8 +23,12 @@
|
||||
|
||||
# Dependencies
|
||||
moon_config=1.0.10
|
||||
@@ -31,18 +28,17 @@
|
||||
@@ -29,21 +26,20 @@
|
||||
adventure=4.17.0
|
||||
rpc_sdk=1.0
|
||||
discord_formatter=2.0.0
|
||||
-cloth_config=17.0.144
|
||||
+cloth_config=9.1.104
|
||||
|
||||
# Mod Dependencies
|
||||
-fabrictailor=2.3.1
|
||||
|
@@ -6,7 +6,7 @@
|
||||
-def JDK = "21";
|
||||
-def majorMc = "1.21.2";
|
||||
-def modLoaders = "neoforge|fabric|quilt|paper";
|
||||
-def supportedMc = "1.21.3";
|
||||
-def supportedMc = "1.21.3|1.21.4";
|
||||
-def reltype = "port";
|
||||
+def JDK = "17";
|
||||
+def majorMc = "1.20.2";
|
||||
|
@@ -0,0 +1,14 @@
|
||||
--- a/Common/src/main/java/com/hypherionmc/craterlib/client/gui/config/ClothConfigScreenBuilder.java
|
||||
+++ b/Common/src/main/java/com/hypherionmc/craterlib/client/gui/config/ClothConfigScreenBuilder.java
|
||||
@@ -390,9 +390,9 @@
|
||||
config.saveConfig(config);
|
||||
Files.deleteIfExists(backupPath);
|
||||
} catch (Exception e) {
|
||||
- Minecraft.getInstance().getToastManager().addToast(
|
||||
+ Minecraft.getInstance().getToasts().addToast(
|
||||
new SystemToast(
|
||||
- SystemToast.SystemToastId.PACK_LOAD_FAILURE,
|
||||
+ SystemToast.SystemToastIds.PACK_LOAD_FAILURE,
|
||||
Component.literal("Failed To Save Config"),
|
||||
Component.literal("Restoring Backup Copy. Check log for details"))
|
||||
);
|
@@ -1,6 +1,6 @@
|
||||
--- a/Common/src/main/java/com/hypherionmc/craterlib/client/gui/config/CraterConfigScreen.java
|
||||
+++ b/Common/src/main/java/com/hypherionmc/craterlib/client/gui/config/CraterConfigScreen.java
|
||||
@@ -158,7 +158,7 @@
|
||||
@@ -159,7 +159,7 @@
|
||||
return new TextConfigOption<>(Objects::toString, BigDecimal::new);
|
||||
}
|
||||
if (value instanceof ResourceLocation) {
|
||||
@@ -9,7 +9,7 @@
|
||||
}
|
||||
if (isSubConfig) {
|
||||
return new SubConfigWidget<>(config, this, value);
|
||||
@@ -216,23 +216,24 @@
|
||||
@@ -217,23 +217,24 @@
|
||||
int maxY = this.height - BOTTOM;
|
||||
//RenderSystem.disableTexture();
|
||||
Tesselator tesselator = Tesselator.getInstance();
|
||||
@@ -51,7 +51,7 @@
|
||||
RenderSystem.disableBlend();
|
||||
//RenderSystem.enableTexture();
|
||||
}
|
||||
@@ -240,21 +241,22 @@
|
||||
@@ -241,21 +242,22 @@
|
||||
|
||||
private void renderShadow(PoseStack matrices) {
|
||||
Tesselator tesselator = Tesselator.getInstance();
|
||||
@@ -85,7 +85,7 @@
|
||||
//RenderSystem.enableTexture();
|
||||
RenderSystem.disableBlend();
|
||||
}
|
||||
@@ -265,15 +267,16 @@
|
||||
@@ -266,15 +268,16 @@
|
||||
|
||||
protected void overlayBackground(Matrix4f matrix, int minX, int minY, int maxX, int maxY, int red, int green, int blue, int startAlpha, int endAlpha) {
|
||||
Tesselator tesselator = Tesselator.getInstance();
|
||||
|
@@ -5,15 +5,15 @@
|
||||
stupidRemapArch("dev.ftb.mods:ftb-essentials:${ftb_essentials}")
|
||||
stupidRemapArch("dev.ftb.mods:ftb-ranks:${ftb_ranks}")
|
||||
-
|
||||
modImplementation("me.shedaniel.cloth:cloth-config-fabric:${cloth_config}")
|
||||
modImplementation "maven.modrinth:fabrictailor:${fabrictailor}"
|
||||
modImplementation "maven.modrinth:vanish:${vanish}"
|
||||
|
||||
@@ -116,8 +115,8 @@
|
||||
@@ -117,8 +116,8 @@
|
||||
setVersionType("release")
|
||||
setChangelog(rootProject.file("changelog.md"))
|
||||
setProjectVersion("${minecraft_version}-${project.version}")
|
||||
- setDisplayName("[FABRIC/QUILT 1.21.3] CraterLib - ${project.version}")
|
||||
- setGameVersions("1.21.3")
|
||||
- setDisplayName("[FABRIC/QUILT 1.21.3/4] CraterLib - ${project.version}")
|
||||
- setGameVersions("1.21.3", "1.21.4")
|
||||
+ setDisplayName("[FABRIC/QUILT 1.20.2] CraterLib - ${project.version}")
|
||||
+ setGameVersions("1.20.2")
|
||||
setLoaders("fabric", "quilt")
|
||||
|
@@ -10,9 +10,9 @@
|
||||
+ stupidRemapArch("dev.ftb.mods:ftb-essentials-forge:${ftb_essentials}")
|
||||
+ stupidRemapArch("dev.ftb.mods:ftb-ranks-forge:${ftb_ranks}")
|
||||
|
||||
// Do not edit or remove
|
||||
implementation project(":Common")
|
||||
@@ -107,8 +110,8 @@
|
||||
modImplementation("me.shedaniel.cloth:cloth-config-forge:${cloth_config}")
|
||||
|
||||
@@ -109,8 +112,8 @@
|
||||
setVersionType("release")
|
||||
setChangelog(rootProject.file("changelog.md"))
|
||||
setProjectVersion("${minecraft_version}-${project.version}")
|
||||
|
@@ -1,22 +1,45 @@
|
||||
--- a/Forge/src/main/java/com/hypherionmc/craterlib/mixin/ConfigScreenHandlerMixin.java
|
||||
+++ b/Forge/src/main/java/com/hypherionmc/craterlib/mixin/ConfigScreenHandlerMixin.java
|
||||
@@ -1,6 +1,7 @@
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.hypherionmc.craterlib.mixin;
|
||||
|
||||
+import com.hypherionmc.craterlib.client.gui.config.ClothConfigScreenBuilder;
|
||||
import com.hypherionmc.craterlib.client.gui.config.CraterConfigScreen;
|
||||
+import com.hypherionmc.craterlib.core.config.AbstractConfig;
|
||||
import com.hypherionmc.craterlib.core.config.ConfigController;
|
||||
import com.hypherionmc.craterlib.core.config.ModuleConfig;
|
||||
-import com.hypherionmc.craterlib.core.config.ModuleConfig;
|
||||
+import com.hypherionmc.craterlib.core.config.annotations.ClothScreen;
|
||||
import com.hypherionmc.craterlib.core.config.annotations.NoConfigScreen;
|
||||
@@ -28,9 +29,9 @@
|
||||
+import com.hypherionmc.craterlib.core.platform.ModloaderEnvironment;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraftforge.client.ConfigScreenHandler;
|
||||
@@ -28,17 +31,22 @@
|
||||
*/
|
||||
@Inject(at = @At("RETURN"), method = "getScreenFactoryFor", cancellable = true, remap = false)
|
||||
private static void injectConfigScreen(IModInfo selectedMod, CallbackInfoReturnable<Optional<BiFunction<Minecraft, Screen, Screen>>> cir) {
|
||||
- ConfigController.getMonitoredConfigs().forEach((conf, watcher) -> {
|
||||
+ ConfigController.getWatchedConfigs().forEach((conf, watcher) -> {
|
||||
if (!conf.getClass().isAnnotationPresent(NoConfigScreen.class)) {
|
||||
- ModuleConfig config = (ModuleConfig) conf;
|
||||
+ AbstractConfig config = watcher.getLeft();
|
||||
if (config.getModId().equals(selectedMod.getModId())) {
|
||||
cir.setReturnValue(
|
||||
Optional.of((minecraft, screen) -> new CraterConfigScreen(config, screen))
|
||||
AbstractConfig config = watcher.getLeft();
|
||||
if (config.getClass().isAnnotationPresent(NoConfigScreen.class))
|
||||
return;
|
||||
|
||||
- if (watcher.getLeft().getClass().isAnnotationPresent(ClothScreen.class) && (ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config") || ModloaderEnvironment.INSTANCE.isModLoaded("cloth-config") || ModloaderEnvironment.INSTANCE.isModLoaded("clothconfig"))) {
|
||||
- ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> ClothConfigScreenBuilder.buildConfigScreen(config, screen))));
|
||||
- } else {
|
||||
- //ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> new CraterConfigScreen(config, screen))));
|
||||
+ if (config.getModId().equals(selectedMod.getModId())) {
|
||||
+ if (watcher.getLeft().getClass().isAnnotationPresent(ClothScreen.class) && ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config")) {
|
||||
+ cir.setReturnValue(
|
||||
+ Optional.of((minecraft, screen) -> ClothConfigScreenBuilder.buildConfigScreen(config, screen))
|
||||
+ );
|
||||
+ } else {
|
||||
+ cir.setReturnValue(
|
||||
+ Optional.of((minecraft, screen) -> new CraterConfigScreen(config, screen))
|
||||
+ );
|
||||
+ }
|
||||
}
|
||||
});
|
||||
}
|
||||
-
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
--- a/NeoForge/build.gradle
|
||||
+++ /dev/null
|
||||
@@ -1,123 +1,0 @@
|
||||
@@ -1,133 +1,0 @@
|
||||
-archivesBaseName = "${mod_name.replace(" ", "")}-NeoForge-${minecraft_version}"
|
||||
-
|
||||
-dependencies {
|
||||
@@ -10,6 +10,8 @@
|
||||
- stupidRemapArch("dev.ftb.mods:ftb-essentials-neoforge:${ftb_essentials}")
|
||||
- stupidRemapArch("dev.ftb.mods:ftb-ranks-neoforge:${ftb_ranks}")
|
||||
-
|
||||
- modImplementation("me.shedaniel.cloth:cloth-config-neoforge:${cloth_config}")
|
||||
-
|
||||
- // Do not edit or remove
|
||||
- implementation project(":Common")
|
||||
-}
|
||||
@@ -117,10 +119,18 @@
|
||||
- setVersionType("release")
|
||||
- setChangelog(rootProject.file("changelog.md"))
|
||||
- setProjectVersion("${minecraft_version}-${project.version}")
|
||||
- setDisplayName("[NeoForge 1.21.3] CraterLib - ${project.version}")
|
||||
- setGameVersions("1.21.3")
|
||||
- setDisplayName("[NeoForge 1.21.3/1.21.4] CraterLib - ${project.version}")
|
||||
- setGameVersions("1.21.3", "1.21.4")
|
||||
- setLoaders("neoforge")
|
||||
- setArtifact(remapJar)
|
||||
- setCurseEnvironment("both")
|
||||
- setIsManualRelease(true)
|
||||
-
|
||||
- curseDepends {
|
||||
- optional("cloth-config")
|
||||
- }
|
||||
-
|
||||
- modrinthDepends {
|
||||
- optional("cloth-config")
|
||||
- }
|
||||
-}
|
||||
|
@@ -1,15 +1,18 @@
|
||||
--- a/NeoForge/src/main/java/com/hypherionmc/craterlib/client/NeoForgeClientHelper.java
|
||||
+++ /dev/null
|
||||
@@ -1,61 +1,0 @@
|
||||
@@ -1,69 +1,0 @@
|
||||
-package com.hypherionmc.craterlib.client;
|
||||
-
|
||||
-import com.hypherionmc.craterlib.api.events.client.LateInitEvent;
|
||||
-import com.hypherionmc.craterlib.client.gui.config.ClothConfigScreenBuilder;
|
||||
-import com.hypherionmc.craterlib.client.gui.config.CraterConfigScreen;
|
||||
-import com.hypherionmc.craterlib.core.config.AbstractConfig;
|
||||
-import com.hypherionmc.craterlib.core.config.ConfigController;
|
||||
-import com.hypherionmc.craterlib.core.config.annotations.ClothScreen;
|
||||
-import com.hypherionmc.craterlib.core.config.annotations.NoConfigScreen;
|
||||
-import com.hypherionmc.craterlib.core.event.CraterEventBus;
|
||||
-import com.hypherionmc.craterlib.core.platform.ClientPlatform;
|
||||
-import com.hypherionmc.craterlib.core.platform.ModloaderEnvironment;
|
||||
-import com.hypherionmc.craterlib.nojang.client.BridgedMinecraft;
|
||||
-import com.hypherionmc.craterlib.nojang.client.BridgedOptions;
|
||||
-import com.hypherionmc.craterlib.nojang.client.multiplayer.BridgedClientLevel;
|
||||
@@ -55,9 +58,14 @@
|
||||
- CraterEventBus.INSTANCE.postEvent(event);
|
||||
-
|
||||
- ConfigController.getWatchedConfigs().forEach((conf, watcher) -> {
|
||||
- if (!conf.getClass().isAnnotationPresent(NoConfigScreen.class)) {
|
||||
- AbstractConfig config = watcher.getLeft();
|
||||
- ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> new CraterConfigScreen(config, screen))));
|
||||
- AbstractConfig config = watcher.getLeft();
|
||||
- if (config.getClass().isAnnotationPresent(NoConfigScreen.class))
|
||||
- return;
|
||||
-
|
||||
- if (watcher.getLeft().getClass().isAnnotationPresent(ClothScreen.class) && (ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config") || ModloaderEnvironment.INSTANCE.isModLoaded("cloth-config") || ModloaderEnvironment.INSTANCE.isModLoaded("clothconfig"))) {
|
||||
- ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> ClothConfigScreenBuilder.buildConfigScreen(config, screen))));
|
||||
- } else {
|
||||
- //ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> new CraterConfigScreen(config, screen))));
|
||||
- }
|
||||
- });
|
||||
- }
|
||||
|
@@ -23,8 +23,12 @@
|
||||
|
||||
# Dependencies
|
||||
moon_config=1.0.10
|
||||
@@ -31,18 +28,17 @@
|
||||
@@ -29,21 +26,20 @@
|
||||
adventure=4.17.0
|
||||
rpc_sdk=1.0
|
||||
discord_formatter=2.0.0
|
||||
-cloth_config=17.0.144
|
||||
+cloth_config=12.0.137
|
||||
|
||||
# Mod Dependencies
|
||||
-fabrictailor=2.3.1
|
||||
|
@@ -6,7 +6,7 @@
|
||||
-def JDK = "21";
|
||||
-def majorMc = "1.21.2";
|
||||
-def modLoaders = "neoforge|fabric|quilt|paper";
|
||||
-def supportedMc = "1.21.3";
|
||||
-def supportedMc = "1.21.3|1.21.4";
|
||||
-def reltype = "port";
|
||||
+def JDK = "17";
|
||||
+def majorMc = "1.20.4";
|
||||
|
@@ -0,0 +1,11 @@
|
||||
--- a/Common/src/main/java/com/hypherionmc/craterlib/client/gui/config/ClothConfigScreenBuilder.java
|
||||
+++ b/Common/src/main/java/com/hypherionmc/craterlib/client/gui/config/ClothConfigScreenBuilder.java
|
||||
@@ -390,7 +390,7 @@
|
||||
config.saveConfig(config);
|
||||
Files.deleteIfExists(backupPath);
|
||||
} catch (Exception e) {
|
||||
- Minecraft.getInstance().getToastManager().addToast(
|
||||
+ Minecraft.getInstance().getToasts().addToast(
|
||||
new SystemToast(
|
||||
SystemToast.SystemToastId.PACK_LOAD_FAILURE,
|
||||
Component.literal("Failed To Save Config"),
|
@@ -1,6 +1,6 @@
|
||||
--- a/Common/src/main/java/com/hypherionmc/craterlib/client/gui/config/CraterConfigScreen.java
|
||||
+++ b/Common/src/main/java/com/hypherionmc/craterlib/client/gui/config/CraterConfigScreen.java
|
||||
@@ -158,7 +158,7 @@
|
||||
@@ -159,7 +159,7 @@
|
||||
return new TextConfigOption<>(Objects::toString, BigDecimal::new);
|
||||
}
|
||||
if (value instanceof ResourceLocation) {
|
||||
@@ -9,7 +9,7 @@
|
||||
}
|
||||
if (isSubConfig) {
|
||||
return new SubConfigWidget<>(config, this, value);
|
||||
@@ -216,23 +216,24 @@
|
||||
@@ -217,23 +217,24 @@
|
||||
int maxY = this.height - BOTTOM;
|
||||
//RenderSystem.disableTexture();
|
||||
Tesselator tesselator = Tesselator.getInstance();
|
||||
@@ -51,7 +51,7 @@
|
||||
RenderSystem.disableBlend();
|
||||
//RenderSystem.enableTexture();
|
||||
}
|
||||
@@ -240,21 +241,22 @@
|
||||
@@ -241,21 +242,22 @@
|
||||
|
||||
private void renderShadow(PoseStack matrices) {
|
||||
Tesselator tesselator = Tesselator.getInstance();
|
||||
@@ -85,7 +85,7 @@
|
||||
//RenderSystem.enableTexture();
|
||||
RenderSystem.disableBlend();
|
||||
}
|
||||
@@ -265,15 +267,16 @@
|
||||
@@ -266,15 +268,16 @@
|
||||
|
||||
protected void overlayBackground(Matrix4f matrix, int minX, int minY, int maxX, int maxY, int red, int green, int blue, int startAlpha, int endAlpha) {
|
||||
Tesselator tesselator = Tesselator.getInstance();
|
||||
|
@@ -1,11 +1,11 @@
|
||||
--- a/Fabric/build.gradle
|
||||
+++ b/Fabric/build.gradle
|
||||
@@ -116,8 +116,8 @@
|
||||
@@ -117,8 +117,8 @@
|
||||
setVersionType("release")
|
||||
setChangelog(rootProject.file("changelog.md"))
|
||||
setProjectVersion("${minecraft_version}-${project.version}")
|
||||
- setDisplayName("[FABRIC/QUILT 1.21.3] CraterLib - ${project.version}")
|
||||
- setGameVersions("1.21.3")
|
||||
- setDisplayName("[FABRIC/QUILT 1.21.3/4] CraterLib - ${project.version}")
|
||||
- setGameVersions("1.21.3", "1.21.4")
|
||||
+ setDisplayName("[FABRIC/QUILT 1.20.4] CraterLib - ${project.version}")
|
||||
+ setGameVersions("1.20.4")
|
||||
setLoaders("fabric", "quilt")
|
||||
|
@@ -10,9 +10,9 @@
|
||||
+ stupidRemapArch("dev.ftb.mods:ftb-essentials-forge:${ftb_essentials}")
|
||||
+ stupidRemapArch("dev.ftb.mods:ftb-ranks-forge:${ftb_ranks}")
|
||||
|
||||
// Do not edit or remove
|
||||
implementation project(":Common")
|
||||
@@ -107,8 +110,8 @@
|
||||
modImplementation("me.shedaniel.cloth:cloth-config-forge:${cloth_config}")
|
||||
|
||||
@@ -109,8 +112,8 @@
|
||||
setVersionType("release")
|
||||
setChangelog(rootProject.file("changelog.md"))
|
||||
setProjectVersion("${minecraft_version}-${project.version}")
|
||||
|
@@ -1,24 +1,45 @@
|
||||
--- a/Forge/src/main/java/com/hypherionmc/craterlib/mixin/ConfigScreenHandlerMixin.java
|
||||
+++ b/Forge/src/main/java/com/hypherionmc/craterlib/mixin/ConfigScreenHandlerMixin.java
|
||||
@@ -1,8 +1,8 @@
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.hypherionmc.craterlib.mixin;
|
||||
|
||||
+import com.hypherionmc.craterlib.client.gui.config.ClothConfigScreenBuilder;
|
||||
import com.hypherionmc.craterlib.client.gui.config.CraterConfigScreen;
|
||||
+import com.hypherionmc.craterlib.core.config.AbstractConfig;
|
||||
import com.hypherionmc.craterlib.core.config.ConfigController;
|
||||
-import com.hypherionmc.craterlib.core.config.ModuleConfig;
|
||||
+import com.hypherionmc.craterlib.core.config.annotations.ClothScreen;
|
||||
import com.hypherionmc.craterlib.core.config.annotations.NoConfigScreen;
|
||||
+import com.hypherionmc.craterlib.core.platform.ModloaderEnvironment;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
@@ -28,9 +28,9 @@
|
||||
import net.minecraftforge.client.ConfigScreenHandler;
|
||||
@@ -28,17 +31,22 @@
|
||||
*/
|
||||
@Inject(at = @At("RETURN"), method = "getScreenFactoryFor", cancellable = true, remap = false)
|
||||
private static void injectConfigScreen(IModInfo selectedMod, CallbackInfoReturnable<Optional<BiFunction<Minecraft, Screen, Screen>>> cir) {
|
||||
- ConfigController.getMonitoredConfigs().forEach((conf, watcher) -> {
|
||||
+ ConfigController.getWatchedConfigs().forEach((conf, watcher) -> {
|
||||
if (!conf.getClass().isAnnotationPresent(NoConfigScreen.class)) {
|
||||
- ModuleConfig config = (ModuleConfig) conf;
|
||||
+ AbstractConfig config = watcher.getLeft();
|
||||
if (config.getModId().equals(selectedMod.getModId())) {
|
||||
cir.setReturnValue(
|
||||
Optional.of((minecraft, screen) -> new CraterConfigScreen(config, screen))
|
||||
AbstractConfig config = watcher.getLeft();
|
||||
if (config.getClass().isAnnotationPresent(NoConfigScreen.class))
|
||||
return;
|
||||
|
||||
- if (watcher.getLeft().getClass().isAnnotationPresent(ClothScreen.class) && (ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config") || ModloaderEnvironment.INSTANCE.isModLoaded("cloth-config") || ModloaderEnvironment.INSTANCE.isModLoaded("clothconfig"))) {
|
||||
- ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> ClothConfigScreenBuilder.buildConfigScreen(config, screen))));
|
||||
- } else {
|
||||
- //ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> new CraterConfigScreen(config, screen))));
|
||||
+ if (config.getModId().equals(selectedMod.getModId())) {
|
||||
+ if (watcher.getLeft().getClass().isAnnotationPresent(ClothScreen.class) && ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config")) {
|
||||
+ cir.setReturnValue(
|
||||
+ Optional.of((minecraft, screen) -> ClothConfigScreenBuilder.buildConfigScreen(config, screen))
|
||||
+ );
|
||||
+ } else {
|
||||
+ cir.setReturnValue(
|
||||
+ Optional.of((minecraft, screen) -> new CraterConfigScreen(config, screen))
|
||||
+ );
|
||||
+ }
|
||||
}
|
||||
});
|
||||
}
|
||||
-
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
--- a/NeoForge/build.gradle
|
||||
+++ b/NeoForge/build.gradle
|
||||
@@ -35,12 +35,7 @@
|
||||
@@ -37,12 +37,7 @@
|
||||
|
||||
unimined.minecraft {
|
||||
neoForged {
|
||||
@@ -14,7 +14,7 @@
|
||||
mixinConfig("${mod_id}.mixins.json", "${mod_id}.neoforge.mixins.json")
|
||||
}
|
||||
}
|
||||
@@ -59,7 +54,7 @@
|
||||
@@ -61,7 +56,7 @@
|
||||
from project(":Common").sourceSets.main.resources
|
||||
def buildProps = project.properties.clone()
|
||||
|
||||
@@ -23,12 +23,12 @@
|
||||
expand buildProps
|
||||
}
|
||||
}
|
||||
@@ -114,8 +109,8 @@
|
||||
@@ -116,8 +111,8 @@
|
||||
setVersionType("release")
|
||||
setChangelog(rootProject.file("changelog.md"))
|
||||
setProjectVersion("${minecraft_version}-${project.version}")
|
||||
- setDisplayName("[NeoForge 1.21.3] CraterLib - ${project.version}")
|
||||
- setGameVersions("1.21.3")
|
||||
- setDisplayName("[NeoForge 1.21.3/1.21.4] CraterLib - ${project.version}")
|
||||
- setGameVersions("1.21.3", "1.21.4")
|
||||
+ setDisplayName("[NeoForge 1.20.4] CraterLib - ${project.version}")
|
||||
+ setGameVersions("1.20.4")
|
||||
setLoaders("neoforge")
|
||||
|
@@ -1,15 +1,18 @@
|
||||
--- a/NeoForge/src/main/java/com/hypherionmc/craterlib/client/NeoForgeClientHelper.java
|
||||
+++ b/NeoForge/src/main/java/com/hypherionmc/craterlib/client/NeoForgeClientHelper.java
|
||||
@@ -1,20 +1,11 @@
|
||||
@@ -1,23 +1,12 @@
|
||||
package com.hypherionmc.craterlib.client;
|
||||
|
||||
-import com.hypherionmc.craterlib.api.events.client.LateInitEvent;
|
||||
-import com.hypherionmc.craterlib.client.gui.config.ClothConfigScreenBuilder;
|
||||
-import com.hypherionmc.craterlib.client.gui.config.CraterConfigScreen;
|
||||
-import com.hypherionmc.craterlib.core.config.AbstractConfig;
|
||||
-import com.hypherionmc.craterlib.core.config.ConfigController;
|
||||
-import com.hypherionmc.craterlib.core.config.annotations.ClothScreen;
|
||||
-import com.hypherionmc.craterlib.core.config.annotations.NoConfigScreen;
|
||||
-import com.hypherionmc.craterlib.core.event.CraterEventBus;
|
||||
import com.hypherionmc.craterlib.core.platform.ClientPlatform;
|
||||
import com.hypherionmc.craterlib.core.platform.ModloaderEnvironment;
|
||||
import com.hypherionmc.craterlib.nojang.client.BridgedMinecraft;
|
||||
-import com.hypherionmc.craterlib.nojang.client.BridgedOptions;
|
||||
import com.hypherionmc.craterlib.nojang.client.multiplayer.BridgedClientLevel;
|
||||
@@ -21,7 +24,7 @@
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -45,17 +36,5 @@
|
||||
@@ -48,22 +37,5 @@
|
||||
public Connection getClientConnection() {
|
||||
Objects.requireNonNull(Minecraft.getInstance().getConnection(), "Cannot send packets when not in game!");
|
||||
return Minecraft.getInstance().getConnection().getConnection();
|
||||
@@ -32,9 +35,14 @@
|
||||
- CraterEventBus.INSTANCE.postEvent(event);
|
||||
-
|
||||
- ConfigController.getWatchedConfigs().forEach((conf, watcher) -> {
|
||||
- if (!conf.getClass().isAnnotationPresent(NoConfigScreen.class)) {
|
||||
- AbstractConfig config = watcher.getLeft();
|
||||
- ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> new CraterConfigScreen(config, screen))));
|
||||
- AbstractConfig config = watcher.getLeft();
|
||||
- if (config.getClass().isAnnotationPresent(NoConfigScreen.class))
|
||||
- return;
|
||||
-
|
||||
- if (watcher.getLeft().getClass().isAnnotationPresent(ClothScreen.class) && (ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config") || ModloaderEnvironment.INSTANCE.isModLoaded("cloth-config") || ModloaderEnvironment.INSTANCE.isModLoaded("clothconfig"))) {
|
||||
- ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> ClothConfigScreenBuilder.buildConfigScreen(config, screen))));
|
||||
- } else {
|
||||
- //ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> new CraterConfigScreen(config, screen))));
|
||||
- }
|
||||
- });
|
||||
}
|
||||
|
@@ -24,7 +24,12 @@
|
||||
|
||||
# Dependencies
|
||||
moon_config=1.0.10
|
||||
@@ -32,17 +32,17 @@
|
||||
@@ -29,21 +29,21 @@
|
||||
adventure=4.17.0
|
||||
rpc_sdk=1.0
|
||||
discord_formatter=2.0.0
|
||||
-cloth_config=17.0.144
|
||||
+cloth_config=13.0.138
|
||||
|
||||
# Mod Dependencies
|
||||
fabrictailor=2.3.1
|
||||
|
@@ -6,7 +6,7 @@
|
||||
-def JDK = "21";
|
||||
-def majorMc = "1.21.2";
|
||||
-def modLoaders = "neoforge|fabric|quilt|paper";
|
||||
-def supportedMc = "1.21.3";
|
||||
-def supportedMc = "1.21.3|1.21.4";
|
||||
-def reltype = "port";
|
||||
+def JDK = "17";
|
||||
+def majorMc = "1.20";
|
||||
|
@@ -0,0 +1,14 @@
|
||||
--- a/Common/src/main/java/com/hypherionmc/craterlib/client/gui/config/ClothConfigScreenBuilder.java
|
||||
+++ b/Common/src/main/java/com/hypherionmc/craterlib/client/gui/config/ClothConfigScreenBuilder.java
|
||||
@@ -390,9 +390,9 @@
|
||||
config.saveConfig(config);
|
||||
Files.deleteIfExists(backupPath);
|
||||
} catch (Exception e) {
|
||||
- Minecraft.getInstance().getToastManager().addToast(
|
||||
+ Minecraft.getInstance().getToasts().addToast(
|
||||
new SystemToast(
|
||||
- SystemToast.SystemToastId.PACK_LOAD_FAILURE,
|
||||
+ SystemToast.SystemToastIds.PACK_LOAD_FAILURE,
|
||||
Component.literal("Failed To Save Config"),
|
||||
Component.literal("Restoring Backup Copy. Check log for details"))
|
||||
);
|
@@ -1,6 +1,6 @@
|
||||
--- a/Common/src/main/java/com/hypherionmc/craterlib/client/gui/config/CraterConfigScreen.java
|
||||
+++ b/Common/src/main/java/com/hypherionmc/craterlib/client/gui/config/CraterConfigScreen.java
|
||||
@@ -158,7 +158,7 @@
|
||||
@@ -159,7 +159,7 @@
|
||||
return new TextConfigOption<>(Objects::toString, BigDecimal::new);
|
||||
}
|
||||
if (value instanceof ResourceLocation) {
|
||||
@@ -9,7 +9,7 @@
|
||||
}
|
||||
if (isSubConfig) {
|
||||
return new SubConfigWidget<>(config, this, value);
|
||||
@@ -179,6 +179,7 @@
|
||||
@@ -180,6 +180,7 @@
|
||||
@Override
|
||||
public void render(@NotNull GuiGraphics matrices, int mouseX, int mouseY, float delta) {
|
||||
overlayBackground(matrices.pose(), TOP, height - BOTTOM, 32);
|
||||
@@ -17,7 +17,7 @@
|
||||
renderScrollBar();
|
||||
|
||||
matrices.pose().pushPose();
|
||||
@@ -187,9 +188,8 @@
|
||||
@@ -188,9 +189,8 @@
|
||||
overlayBackground(matrices.pose(), height - BOTTOM, height, 64);
|
||||
renderShadow(matrices.pose());
|
||||
matrices.drawCenteredString(font, getTitle(), width / 2, 9, 0xFFFFFF);
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
int y = (int) (TOP + 4 - Math.round(scrollerAmount));
|
||||
for (Option<?> option : options) {
|
||||
@@ -216,23 +216,24 @@
|
||||
@@ -217,23 +217,24 @@
|
||||
int maxY = this.height - BOTTOM;
|
||||
//RenderSystem.disableTexture();
|
||||
Tesselator tesselator = Tesselator.getInstance();
|
||||
@@ -70,7 +70,7 @@
|
||||
RenderSystem.disableBlend();
|
||||
//RenderSystem.enableTexture();
|
||||
}
|
||||
@@ -240,21 +241,22 @@
|
||||
@@ -241,21 +242,22 @@
|
||||
|
||||
private void renderShadow(PoseStack matrices) {
|
||||
Tesselator tesselator = Tesselator.getInstance();
|
||||
@@ -104,7 +104,7 @@
|
||||
//RenderSystem.enableTexture();
|
||||
RenderSystem.disableBlend();
|
||||
}
|
||||
@@ -265,15 +267,16 @@
|
||||
@@ -266,15 +268,16 @@
|
||||
|
||||
protected void overlayBackground(Matrix4f matrix, int minX, int minY, int maxX, int maxY, int red, int green, int blue, int startAlpha, int endAlpha) {
|
||||
Tesselator tesselator = Tesselator.getInstance();
|
||||
@@ -129,7 +129,7 @@
|
||||
}
|
||||
|
||||
public int scrollHeight() {
|
||||
@@ -331,12 +334,12 @@
|
||||
@@ -332,12 +335,12 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -8,7 +8,7 @@
|
||||
|
||||
/**
|
||||
* @author HypherionSA
|
||||
@@ -22,7 +23,7 @@
|
||||
@@ -23,7 +24,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -17,7 +17,7 @@
|
||||
if (cancel) {
|
||||
setMessage(Component.translatable(screen.isEdited() ? "t.clc.cancel_discard" : "gui.cancel"));
|
||||
} else {
|
||||
@@ -30,7 +31,7 @@
|
||||
@@ -31,7 +32,7 @@
|
||||
active = screen.isEdited() && !hasErrors;
|
||||
setMessage(Component.translatable(hasErrors ? "t.clc.error" : "t.clc.save"));
|
||||
}
|
||||
|
@@ -5,15 +5,15 @@
|
||||
stupidRemapArch("dev.ftb.mods:ftb-essentials:${ftb_essentials}")
|
||||
stupidRemapArch("dev.ftb.mods:ftb-ranks:${ftb_ranks}")
|
||||
-
|
||||
modImplementation("me.shedaniel.cloth:cloth-config-fabric:${cloth_config}")
|
||||
modImplementation "maven.modrinth:fabrictailor:${fabrictailor}"
|
||||
modImplementation "maven.modrinth:vanish:${vanish}"
|
||||
|
||||
@@ -116,8 +115,8 @@
|
||||
@@ -117,8 +116,8 @@
|
||||
setVersionType("release")
|
||||
setChangelog(rootProject.file("changelog.md"))
|
||||
setProjectVersion("${minecraft_version}-${project.version}")
|
||||
- setDisplayName("[FABRIC/QUILT 1.21.3] CraterLib - ${project.version}")
|
||||
- setGameVersions("1.21.3")
|
||||
- setDisplayName("[FABRIC/QUILT 1.21.3/4] CraterLib - ${project.version}")
|
||||
- setGameVersions("1.21.3", "1.21.4")
|
||||
+ setDisplayName("[FABRIC/QUILT 1.20/1.20.1] CraterLib - ${project.version}")
|
||||
+ setGameVersions("1.20", "1.20.1")
|
||||
setLoaders("fabric", "quilt")
|
||||
|
@@ -10,9 +10,9 @@
|
||||
+ stupidRemapArch("dev.ftb.mods:ftb-essentials-forge:${ftb_essentials}")
|
||||
+ stupidRemapArch("dev.ftb.mods:ftb-ranks-forge:${ftb_ranks}")
|
||||
|
||||
// Do not edit or remove
|
||||
implementation project(":Common")
|
||||
@@ -107,8 +110,8 @@
|
||||
modImplementation("me.shedaniel.cloth:cloth-config-forge:${cloth_config}")
|
||||
|
||||
@@ -109,8 +112,8 @@
|
||||
setVersionType("release")
|
||||
setChangelog(rootProject.file("changelog.md"))
|
||||
setProjectVersion("${minecraft_version}-${project.version}")
|
||||
|
@@ -1,24 +1,45 @@
|
||||
--- a/Forge/src/main/java/com/hypherionmc/craterlib/mixin/ConfigScreenHandlerMixin.java
|
||||
+++ b/Forge/src/main/java/com/hypherionmc/craterlib/mixin/ConfigScreenHandlerMixin.java
|
||||
@@ -1,8 +1,8 @@
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.hypherionmc.craterlib.mixin;
|
||||
|
||||
+import com.hypherionmc.craterlib.client.gui.config.ClothConfigScreenBuilder;
|
||||
import com.hypherionmc.craterlib.client.gui.config.CraterConfigScreen;
|
||||
+import com.hypherionmc.craterlib.core.config.AbstractConfig;
|
||||
import com.hypherionmc.craterlib.core.config.ConfigController;
|
||||
-import com.hypherionmc.craterlib.core.config.ModuleConfig;
|
||||
+import com.hypherionmc.craterlib.core.config.annotations.ClothScreen;
|
||||
import com.hypherionmc.craterlib.core.config.annotations.NoConfigScreen;
|
||||
+import com.hypherionmc.craterlib.core.platform.ModloaderEnvironment;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
@@ -28,9 +28,9 @@
|
||||
import net.minecraftforge.client.ConfigScreenHandler;
|
||||
@@ -28,17 +31,22 @@
|
||||
*/
|
||||
@Inject(at = @At("RETURN"), method = "getScreenFactoryFor", cancellable = true, remap = false)
|
||||
private static void injectConfigScreen(IModInfo selectedMod, CallbackInfoReturnable<Optional<BiFunction<Minecraft, Screen, Screen>>> cir) {
|
||||
- ConfigController.getMonitoredConfigs().forEach((conf, watcher) -> {
|
||||
+ ConfigController.getWatchedConfigs().forEach((conf, watcher) -> {
|
||||
if (!conf.getClass().isAnnotationPresent(NoConfigScreen.class)) {
|
||||
- ModuleConfig config = (ModuleConfig) conf;
|
||||
+ AbstractConfig config = watcher.getLeft();
|
||||
if (config.getModId().equals(selectedMod.getModId())) {
|
||||
cir.setReturnValue(
|
||||
Optional.of((minecraft, screen) -> new CraterConfigScreen(config, screen))
|
||||
AbstractConfig config = watcher.getLeft();
|
||||
if (config.getClass().isAnnotationPresent(NoConfigScreen.class))
|
||||
return;
|
||||
|
||||
- if (watcher.getLeft().getClass().isAnnotationPresent(ClothScreen.class) && (ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config") || ModloaderEnvironment.INSTANCE.isModLoaded("cloth-config") || ModloaderEnvironment.INSTANCE.isModLoaded("clothconfig"))) {
|
||||
- ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> ClothConfigScreenBuilder.buildConfigScreen(config, screen))));
|
||||
- } else {
|
||||
- //ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> new CraterConfigScreen(config, screen))));
|
||||
+ if (config.getModId().equals(selectedMod.getModId())) {
|
||||
+ if (watcher.getLeft().getClass().isAnnotationPresent(ClothScreen.class) && ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config")) {
|
||||
+ cir.setReturnValue(
|
||||
+ Optional.of((minecraft, screen) -> ClothConfigScreenBuilder.buildConfigScreen(config, screen))
|
||||
+ );
|
||||
+ } else {
|
||||
+ cir.setReturnValue(
|
||||
+ Optional.of((minecraft, screen) -> new CraterConfigScreen(config, screen))
|
||||
+ );
|
||||
+ }
|
||||
}
|
||||
});
|
||||
}
|
||||
-
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
--- a/NeoForge/build.gradle
|
||||
+++ /dev/null
|
||||
@@ -1,123 +1,0 @@
|
||||
@@ -1,133 +1,0 @@
|
||||
-archivesBaseName = "${mod_name.replace(" ", "")}-NeoForge-${minecraft_version}"
|
||||
-
|
||||
-dependencies {
|
||||
@@ -10,6 +10,8 @@
|
||||
- stupidRemapArch("dev.ftb.mods:ftb-essentials-neoforge:${ftb_essentials}")
|
||||
- stupidRemapArch("dev.ftb.mods:ftb-ranks-neoforge:${ftb_ranks}")
|
||||
-
|
||||
- modImplementation("me.shedaniel.cloth:cloth-config-neoforge:${cloth_config}")
|
||||
-
|
||||
- // Do not edit or remove
|
||||
- implementation project(":Common")
|
||||
-}
|
||||
@@ -117,10 +119,18 @@
|
||||
- setVersionType("release")
|
||||
- setChangelog(rootProject.file("changelog.md"))
|
||||
- setProjectVersion("${minecraft_version}-${project.version}")
|
||||
- setDisplayName("[NeoForge 1.21.3] CraterLib - ${project.version}")
|
||||
- setGameVersions("1.21.3")
|
||||
- setDisplayName("[NeoForge 1.21.3/1.21.4] CraterLib - ${project.version}")
|
||||
- setGameVersions("1.21.3", "1.21.4")
|
||||
- setLoaders("neoforge")
|
||||
- setArtifact(remapJar)
|
||||
- setCurseEnvironment("both")
|
||||
- setIsManualRelease(true)
|
||||
-
|
||||
- curseDepends {
|
||||
- optional("cloth-config")
|
||||
- }
|
||||
-
|
||||
- modrinthDepends {
|
||||
- optional("cloth-config")
|
||||
- }
|
||||
-}
|
||||
|
@@ -1,15 +1,18 @@
|
||||
--- a/NeoForge/src/main/java/com/hypherionmc/craterlib/client/NeoForgeClientHelper.java
|
||||
+++ /dev/null
|
||||
@@ -1,61 +1,0 @@
|
||||
@@ -1,69 +1,0 @@
|
||||
-package com.hypherionmc.craterlib.client;
|
||||
-
|
||||
-import com.hypherionmc.craterlib.api.events.client.LateInitEvent;
|
||||
-import com.hypherionmc.craterlib.client.gui.config.ClothConfigScreenBuilder;
|
||||
-import com.hypherionmc.craterlib.client.gui.config.CraterConfigScreen;
|
||||
-import com.hypherionmc.craterlib.core.config.AbstractConfig;
|
||||
-import com.hypherionmc.craterlib.core.config.ConfigController;
|
||||
-import com.hypherionmc.craterlib.core.config.annotations.ClothScreen;
|
||||
-import com.hypherionmc.craterlib.core.config.annotations.NoConfigScreen;
|
||||
-import com.hypherionmc.craterlib.core.event.CraterEventBus;
|
||||
-import com.hypherionmc.craterlib.core.platform.ClientPlatform;
|
||||
-import com.hypherionmc.craterlib.core.platform.ModloaderEnvironment;
|
||||
-import com.hypherionmc.craterlib.nojang.client.BridgedMinecraft;
|
||||
-import com.hypherionmc.craterlib.nojang.client.BridgedOptions;
|
||||
-import com.hypherionmc.craterlib.nojang.client.multiplayer.BridgedClientLevel;
|
||||
@@ -55,9 +58,14 @@
|
||||
- CraterEventBus.INSTANCE.postEvent(event);
|
||||
-
|
||||
- ConfigController.getWatchedConfigs().forEach((conf, watcher) -> {
|
||||
- if (!conf.getClass().isAnnotationPresent(NoConfigScreen.class)) {
|
||||
- AbstractConfig config = watcher.getLeft();
|
||||
- ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> new CraterConfigScreen(config, screen))));
|
||||
- AbstractConfig config = watcher.getLeft();
|
||||
- if (config.getClass().isAnnotationPresent(NoConfigScreen.class))
|
||||
- return;
|
||||
-
|
||||
- if (watcher.getLeft().getClass().isAnnotationPresent(ClothScreen.class) && (ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config") || ModloaderEnvironment.INSTANCE.isModLoaded("cloth-config") || ModloaderEnvironment.INSTANCE.isModLoaded("clothconfig"))) {
|
||||
- ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> ClothConfigScreenBuilder.buildConfigScreen(config, screen))));
|
||||
- } else {
|
||||
- //ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> new CraterConfigScreen(config, screen))));
|
||||
- }
|
||||
- });
|
||||
- }
|
||||
|
@@ -23,8 +23,12 @@
|
||||
|
||||
# Dependencies
|
||||
moon_config=1.0.10
|
||||
@@ -31,18 +28,17 @@
|
||||
@@ -29,21 +26,20 @@
|
||||
adventure=4.17.0
|
||||
rpc_sdk=1.0
|
||||
discord_formatter=2.0.0
|
||||
-cloth_config=17.0.144
|
||||
+cloth_config=11.1.136
|
||||
|
||||
# Mod Dependencies
|
||||
-fabrictailor=2.3.1
|
||||
|
@@ -3,7 +3,7 @@
|
||||
@@ -4,7 +4,7 @@
|
||||
def majorMc = "1.21.2";
|
||||
def modLoaders = "neoforge|fabric|quilt|paper";
|
||||
def supportedMc = "1.21.3";
|
||||
def supportedMc = "1.21.3|1.21.4";
|
||||
-def reltype = "port";
|
||||
+def reltype = "snapshot";
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
--- a/Forge/build.gradle
|
||||
+++ /dev/null
|
||||
@@ -1,116 +1,0 @@
|
||||
@@ -1,126 +1,0 @@
|
||||
-// Adjust the output jar name here
|
||||
-archivesBaseName = "${mod_name.replace(" ", "")}-Forge-${minecraft_version}"
|
||||
-
|
||||
@@ -8,6 +8,8 @@
|
||||
- // Compat
|
||||
- // NOT AVAILABLE ON FORGE modImplementation("maven.modrinth:vanishmod:${vanishmod}")
|
||||
-
|
||||
- modImplementation("me.shedaniel.cloth:cloth-config-forge:${cloth_config}")
|
||||
-
|
||||
- // Do not edit or remove
|
||||
- implementation project(":Common")
|
||||
-}
|
||||
@@ -116,4 +118,12 @@
|
||||
- setArtifact(remapJar)
|
||||
- setCurseEnvironment("both")
|
||||
- setIsManualRelease(true)
|
||||
-
|
||||
- curseDepends {
|
||||
- optional("cloth-config")
|
||||
- }
|
||||
-
|
||||
- modrinthDepends {
|
||||
- optional("cloth-config")
|
||||
- }
|
||||
-}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
--- a/Forge/src/main/java/com/hypherionmc/craterlib/mixin/ConfigScreenHandlerMixin.java
|
||||
+++ /dev/null
|
||||
@@ -1,43 +1,0 @@
|
||||
@@ -1,44 +1,0 @@
|
||||
-package com.hypherionmc.craterlib.mixin;
|
||||
-
|
||||
-import com.hypherionmc.craterlib.client.gui.config.CraterConfigScreen;
|
||||
@@ -32,13 +32,14 @@
|
||||
- @Inject(at = @At("RETURN"), method = "getScreenFactoryFor", cancellable = true, remap = false)
|
||||
- private static void injectConfigScreen(IModInfo selectedMod, CallbackInfoReturnable<Optional<BiFunction<Minecraft, Screen, Screen>>> cir) {
|
||||
- ConfigController.getMonitoredConfigs().forEach((conf, watcher) -> {
|
||||
- if (!conf.getClass().isAnnotationPresent(NoConfigScreen.class)) {
|
||||
- ModuleConfig config = (ModuleConfig) conf;
|
||||
- if (config.getModId().equals(selectedMod.getModId())) {
|
||||
- cir.setReturnValue(
|
||||
- Optional.of((minecraft, screen) -> new CraterConfigScreen(config, screen))
|
||||
- );
|
||||
- }
|
||||
- AbstractConfig config = watcher.getLeft();
|
||||
- if (config.getClass().isAnnotationPresent(NoConfigScreen.class))
|
||||
- return;
|
||||
-
|
||||
- if (watcher.getLeft().getClass().isAnnotationPresent(ClothScreen.class) && (ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config") || ModloaderEnvironment.INSTANCE.isModLoaded("cloth-config") || ModloaderEnvironment.INSTANCE.isModLoaded("clothconfig"))) {
|
||||
- ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> ClothConfigScreenBuilder.buildConfigScreen(config, screen))));
|
||||
- } else {
|
||||
- //ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> new CraterConfigScreen(config, screen))));
|
||||
- }
|
||||
- });
|
||||
- }
|
||||
|
@@ -1,6 +1,6 @@
|
||||
--- a/NeoForge/build.gradle
|
||||
+++ b/NeoForge/build.gradle
|
||||
@@ -35,12 +35,7 @@
|
||||
@@ -37,12 +37,7 @@
|
||||
|
||||
unimined.minecraft {
|
||||
neoForged {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
--- a/gradle.properties
|
||||
+++ b/gradle.properties
|
||||
@@ -42,7 +42,7 @@
|
||||
@@ -43,7 +43,7 @@
|
||||
# Publishing
|
||||
curse_id=867099
|
||||
modrinth_id=Nn8Wasaq
|
||||
|
@@ -7,7 +7,7 @@
|
||||
-def majorMc = "1.21.2";
|
||||
+def majorMc = "1.21";
|
||||
def modLoaders = "neoforge|fabric|quilt|paper";
|
||||
-def supportedMc = "1.21.3";
|
||||
-def supportedMc = "1.21.3|1.21.4";
|
||||
-def reltype = "port";
|
||||
+def supportedMc = "1.21|1.21.1";
|
||||
+def reltype = "snapshot";
|
||||
|
@@ -0,0 +1,11 @@
|
||||
--- a/Common/src/main/java/com/hypherionmc/craterlib/client/gui/config/ClothConfigScreenBuilder.java
|
||||
+++ b/Common/src/main/java/com/hypherionmc/craterlib/client/gui/config/ClothConfigScreenBuilder.java
|
||||
@@ -390,7 +390,7 @@
|
||||
config.saveConfig(config);
|
||||
Files.deleteIfExists(backupPath);
|
||||
} catch (Exception e) {
|
||||
- Minecraft.getInstance().getToastManager().addToast(
|
||||
+ Minecraft.getInstance().getToasts().addToast(
|
||||
new SystemToast(
|
||||
SystemToast.SystemToastId.PACK_LOAD_FAILURE,
|
||||
Component.literal("Failed To Save Config"),
|
@@ -1,6 +1,6 @@
|
||||
--- a/Common/src/main/java/com/hypherionmc/craterlib/client/gui/config/CraterConfigScreen.java
|
||||
+++ b/Common/src/main/java/com/hypherionmc/craterlib/client/gui/config/CraterConfigScreen.java
|
||||
@@ -217,7 +217,7 @@
|
||||
@@ -218,7 +218,7 @@
|
||||
//RenderSystem.disableTexture();
|
||||
Tesselator tesselator = Tesselator.getInstance();
|
||||
BufferBuilder buffer = tesselator.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_COLOR);
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
buffer.addVertex(scrollbarPositionMinX, maxY, 0.0f).setColor(0, 0, 0, 255);
|
||||
buffer.addVertex(scrollbarPositionMaxX, maxY, 0.0f).setColor(0, 0, 0, 255);
|
||||
@@ -244,7 +244,7 @@
|
||||
@@ -245,7 +245,7 @@
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.blendFuncSeparate(770, 771, 0, 1);
|
||||
//RenderSystem.disableTexture();
|
||||
@@ -18,7 +18,7 @@
|
||||
Matrix4f matrix = matrices.last().pose();
|
||||
buffer.addVertex(matrix, 0, TOP + 4, 0.0F).setUv(0, 1).setColor(0, 0, 0, 0);
|
||||
buffer.addVertex(matrix, width, TOP + 4, 0.0F).setUv(1, 1).setColor(0, 0, 0, 0);
|
||||
@@ -266,7 +266,7 @@
|
||||
@@ -267,7 +267,7 @@
|
||||
protected void overlayBackground(Matrix4f matrix, int minX, int minY, int maxX, int maxY, int red, int green, int blue, int startAlpha, int endAlpha) {
|
||||
Tesselator tesselator = Tesselator.getInstance();
|
||||
BufferBuilder buffer = tesselator.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_TEX_COLOR);
|
||||
|
@@ -1,11 +1,11 @@
|
||||
--- a/Fabric/build.gradle
|
||||
+++ b/Fabric/build.gradle
|
||||
@@ -116,8 +116,8 @@
|
||||
@@ -117,8 +117,8 @@
|
||||
setVersionType("release")
|
||||
setChangelog(rootProject.file("changelog.md"))
|
||||
setProjectVersion("${minecraft_version}-${project.version}")
|
||||
- setDisplayName("[FABRIC/QUILT 1.21.3] CraterLib - ${project.version}")
|
||||
- setGameVersions("1.21.3")
|
||||
- setDisplayName("[FABRIC/QUILT 1.21.3/4] CraterLib - ${project.version}")
|
||||
- setGameVersions("1.21.3", "1.21.4")
|
||||
+ setDisplayName("[FABRIC/QUILT 1.21.x] CraterLib - ${project.version}")
|
||||
+ setGameVersions("1.21", "1.21.1")
|
||||
setLoaders("fabric", "quilt")
|
||||
|
@@ -1,6 +1,6 @@
|
||||
--- a/Forge/build.gradle
|
||||
+++ /dev/null
|
||||
@@ -1,116 +1,0 @@
|
||||
@@ -1,126 +1,0 @@
|
||||
-// Adjust the output jar name here
|
||||
-archivesBaseName = "${mod_name.replace(" ", "")}-Forge-${minecraft_version}"
|
||||
-
|
||||
@@ -8,6 +8,8 @@
|
||||
- // Compat
|
||||
- // NOT AVAILABLE ON FORGE modImplementation("maven.modrinth:vanishmod:${vanishmod}")
|
||||
-
|
||||
- modImplementation("me.shedaniel.cloth:cloth-config-forge:${cloth_config}")
|
||||
-
|
||||
- // Do not edit or remove
|
||||
- implementation project(":Common")
|
||||
-}
|
||||
@@ -116,4 +118,12 @@
|
||||
- setArtifact(remapJar)
|
||||
- setCurseEnvironment("both")
|
||||
- setIsManualRelease(true)
|
||||
-
|
||||
- curseDepends {
|
||||
- optional("cloth-config")
|
||||
- }
|
||||
-
|
||||
- modrinthDepends {
|
||||
- optional("cloth-config")
|
||||
- }
|
||||
-}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
--- a/Forge/src/main/java/com/hypherionmc/craterlib/mixin/ConfigScreenHandlerMixin.java
|
||||
+++ /dev/null
|
||||
@@ -1,43 +1,0 @@
|
||||
@@ -1,44 +1,0 @@
|
||||
-package com.hypherionmc.craterlib.mixin;
|
||||
-
|
||||
-import com.hypherionmc.craterlib.client.gui.config.CraterConfigScreen;
|
||||
@@ -32,13 +32,14 @@
|
||||
- @Inject(at = @At("RETURN"), method = "getScreenFactoryFor", cancellable = true, remap = false)
|
||||
- private static void injectConfigScreen(IModInfo selectedMod, CallbackInfoReturnable<Optional<BiFunction<Minecraft, Screen, Screen>>> cir) {
|
||||
- ConfigController.getMonitoredConfigs().forEach((conf, watcher) -> {
|
||||
- if (!conf.getClass().isAnnotationPresent(NoConfigScreen.class)) {
|
||||
- ModuleConfig config = (ModuleConfig) conf;
|
||||
- if (config.getModId().equals(selectedMod.getModId())) {
|
||||
- cir.setReturnValue(
|
||||
- Optional.of((minecraft, screen) -> new CraterConfigScreen(config, screen))
|
||||
- );
|
||||
- }
|
||||
- AbstractConfig config = watcher.getLeft();
|
||||
- if (config.getClass().isAnnotationPresent(NoConfigScreen.class))
|
||||
- return;
|
||||
-
|
||||
- if (watcher.getLeft().getClass().isAnnotationPresent(ClothScreen.class) && (ModloaderEnvironment.INSTANCE.isModLoaded("cloth_config") || ModloaderEnvironment.INSTANCE.isModLoaded("cloth-config") || ModloaderEnvironment.INSTANCE.isModLoaded("clothconfig"))) {
|
||||
- ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> ClothConfigScreenBuilder.buildConfigScreen(config, screen))));
|
||||
- } else {
|
||||
- //ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> new CraterConfigScreen(config, screen))));
|
||||
- }
|
||||
- });
|
||||
- }
|
||||
|
@@ -1,6 +1,6 @@
|
||||
--- a/NeoForge/build.gradle
|
||||
+++ b/NeoForge/build.gradle
|
||||
@@ -35,12 +35,7 @@
|
||||
@@ -37,12 +37,7 @@
|
||||
|
||||
unimined.minecraft {
|
||||
neoForged {
|
||||
@@ -14,12 +14,12 @@
|
||||
mixinConfig("${mod_id}.mixins.json", "${mod_id}.neoforge.mixins.json")
|
||||
}
|
||||
}
|
||||
@@ -114,8 +109,8 @@
|
||||
@@ -116,8 +111,8 @@
|
||||
setVersionType("release")
|
||||
setChangelog(rootProject.file("changelog.md"))
|
||||
setProjectVersion("${minecraft_version}-${project.version}")
|
||||
- setDisplayName("[NeoForge 1.21.3] CraterLib - ${project.version}")
|
||||
- setGameVersions("1.21.3")
|
||||
- setDisplayName("[NeoForge 1.21.3/1.21.4] CraterLib - ${project.version}")
|
||||
- setGameVersions("1.21.3", "1.21.4")
|
||||
+ setDisplayName("[NeoForge 1.21.x] CraterLib - ${project.version}")
|
||||
+ setGameVersions("1.21", "1.21.1")
|
||||
setLoaders("neoforge")
|
||||
|
@@ -16,7 +16,16 @@
|
||||
|
||||
# Forge
|
||||
forge_version=50.0.6
|
||||
@@ -42,7 +42,7 @@
|
||||
@@ -29,7 +29,7 @@
|
||||
adventure=4.17.0
|
||||
rpc_sdk=1.0
|
||||
discord_formatter=2.0.0
|
||||
-cloth_config=17.0.144
|
||||
+cloth_config=15.0.140
|
||||
|
||||
# Mod Dependencies
|
||||
fabrictailor=2.3.1
|
||||
@@ -43,7 +43,7 @@
|
||||
# Publishing
|
||||
curse_id=867099
|
||||
modrinth_id=Nn8Wasaq
|
||||
|
Reference in New Issue
Block a user