- [FEAT] New APIs for Maintenance Mode and rewrite commands system

- [FEAT] Improved config system to fix old loading bugs and support JSON
- [FEAT] LuckPerms support for commands
This commit is contained in:
2024-08-10 15:17:10 +02:00
parent e14ac2a136
commit 614fb0bc49
352 changed files with 6045 additions and 1798 deletions

View File

@@ -2,7 +2,7 @@ package com.hypherionmc.craterlib.client.gui.config;
import com.hypherionmc.craterlib.CraterConstants;
import com.hypherionmc.craterlib.client.gui.config.widgets.*;
import com.hypherionmc.craterlib.core.config.ModuleConfig;
import com.hypherionmc.craterlib.core.config.AbstractConfig;
import com.hypherionmc.craterlib.core.config.annotations.HideFromScreen;
import com.hypherionmc.craterlib.core.config.annotations.SubConfig;
import com.hypherionmc.craterlib.core.config.annotations.Tooltip;
@@ -44,11 +44,11 @@ public class CraterConfigScreen extends Screen {
private static final int BOTTOM = 24;
private final Screen parent;
private final List<Option<?>> options = new ArrayList<>();
private final ModuleConfig config;
private final AbstractConfig config;
public double scrollerAmount;
private boolean dragging;
public CraterConfigScreen(ModuleConfig config, Screen parent, Object subConfig) {
public CraterConfigScreen(AbstractConfig config, Screen parent, Object subConfig) {
super(Component.translatable("cl." + config.getClass().getSimpleName().toLowerCase() + ".title"));
this.parent = parent;
this.config = config;
@@ -59,7 +59,7 @@ public class CraterConfigScreen extends Screen {
}
}
public CraterConfigScreen(ModuleConfig config, Screen parent) {
public CraterConfigScreen(AbstractConfig config, Screen parent) {
this(config, parent, null);
}

View File

@@ -1,7 +1,7 @@
package com.hypherionmc.craterlib.client.gui.config.widgets;
import com.hypherionmc.craterlib.client.gui.config.CraterConfigScreen;
import com.hypherionmc.craterlib.core.config.ModuleConfig;
import com.hypherionmc.craterlib.core.config.AbstractConfig;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Font;
import net.minecraft.client.gui.GuiGraphics;
@@ -15,10 +15,10 @@ import net.minecraft.network.chat.Component;
public class SubConfigWidget<T> extends AbstractConfigWidget<T, Button> {
private final Object subConfig;
private final ModuleConfig config;
private final AbstractConfig config;
private final Screen screen;
public SubConfigWidget(ModuleConfig config, Screen screen, Object subConfig) {
public SubConfigWidget(AbstractConfig config, Screen screen, Object subConfig) {
this.config = config;
this.subConfig = subConfig;
this.screen = screen;