- [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:
@@ -0,0 +1,20 @@
|
||||
--- a/Forge/src/main/java/com/hypherionmc/craterlib/common/ForgeServerEvents.java
|
||||
+++ b/Forge/src/main/java/com/hypherionmc/craterlib/common/ForgeServerEvents.java
|
||||
@@ -3,7 +3,6 @@
|
||||
import com.hypherionmc.craterlib.api.events.server.CraterRegisterCommandEvent;
|
||||
import com.hypherionmc.craterlib.api.events.server.CraterServerLifecycleEvent;
|
||||
import com.hypherionmc.craterlib.core.event.CraterEventBus;
|
||||
-import com.hypherionmc.craterlib.nojang.commands.CommandsRegistry;
|
||||
import com.hypherionmc.craterlib.nojang.server.BridgedMinecraftServer;
|
||||
import net.minecraftforge.event.RegisterCommandsEvent;
|
||||
import net.minecraftforge.event.server.ServerStartedEvent;
|
||||
@@ -36,8 +35,7 @@
|
||||
|
||||
@SubscribeEvent
|
||||
public void onCommandRegister(RegisterCommandsEvent event) {
|
||||
- CraterEventBus.INSTANCE.postEvent(new CraterRegisterCommandEvent());
|
||||
- CommandsRegistry.INSTANCE.registerCommands(event.getDispatcher());
|
||||
+ CraterEventBus.INSTANCE.postEvent(new CraterRegisterCommandEvent(event.getDispatcher()));
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,22 @@
|
||||
--- 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 @@
|
||||
package com.hypherionmc.craterlib.mixin;
|
||||
|
||||
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.NoConfigScreen;
|
||||
@@ -28,9 +29,9 @@
|
||||
*/
|
||||
@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))
|
@@ -0,0 +1,11 @@
|
||||
--- a/Forge/src/main/java/com/hypherionmc/craterlib/mixin/ServerStatusPacketListenerMixin.java
|
||||
+++ b/Forge/src/main/java/com/hypherionmc/craterlib/mixin/ServerStatusPacketListenerMixin.java
|
||||
@@ -44,7 +44,7 @@
|
||||
status.version(),
|
||||
status.favicon(),
|
||||
status.enforcesSecureChat(),
|
||||
- status.isModded()
|
||||
+ status.forgeData()
|
||||
)
|
||||
));
|
||||
}
|
Reference in New Issue
Block a user