- [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:
@@ -6,12 +6,12 @@
|
||||
-def JDK = "21";
|
||||
-def majorMc = "1.21";
|
||||
-def modLoaders = "neoforge|fabric|quilt";
|
||||
-def supportedMc = "1.21";
|
||||
-def supportedMc = "1.21|1.21.1";
|
||||
-def reltype = "port";
|
||||
+def JDK = "17";
|
||||
+def majorMc = "1.19.3";
|
||||
+def modLoaders = "forge|fabric|quilt";
|
||||
+def supportedMc = "1.19.3|1.19.4";
|
||||
+def supportedMc = "1.19.4";
|
||||
+def reltype = "snapshot";
|
||||
|
||||
pipeline {
|
||||
|
@@ -3,7 +3,7 @@
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
import com.hypherionmc.craterlib.client.gui.config.CraterConfigScreen;
|
||||
import com.hypherionmc.craterlib.core.config.ModuleConfig;
|
||||
import com.hypherionmc.craterlib.core.config.AbstractConfig;
|
||||
+import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.Font;
|
||||
|
@@ -8,4 +8,4 @@
|
||||
+ internal.sendSuccess(ChatUtils.adventureToMojang(supplier.get()), bl);
|
||||
}
|
||||
|
||||
public CommandSourceStack toMojang() {
|
||||
public void sendFailure(Component text) {
|
||||
|
@@ -4,10 +4,10 @@
|
||||
setVersionType("release")
|
||||
setChangelog("https://raw.githubusercontent.com/hypherionmc/changelogs/main/craterlib/changelog-fabric.md")
|
||||
setProjectVersion("${minecraft_version}-${project.version}")
|
||||
- setDisplayName("[FABRIC/QUILT 1.21.0] CraterLib - ${project.version}")
|
||||
- setGameVersions("1.21")
|
||||
+ setDisplayName("[FABRIC/QUILT 1.19.3/1.19.4] CraterLib - ${project.version}")
|
||||
+ setGameVersions("1.19.3", "1.19.4")
|
||||
- setDisplayName("[FABRIC/QUILT 1.21.x] CraterLib - ${project.version}")
|
||||
- setGameVersions("1.21", "1.21.1")
|
||||
+ setDisplayName("[FABRIC/QUILT 1.19.4] CraterLib - ${project.version}")
|
||||
+ setGameVersions("1.19.4")
|
||||
setLoaders("fabric", "quilt")
|
||||
setArtifact(remapJar)
|
||||
setCurseEnvironment("both")
|
||||
|
@@ -21,11 +21,12 @@
|
||||
cancellable = true
|
||||
)
|
||||
- private void injectChatEvent(PlayerChatMessage arg, Component arg2, FilteredText arg3, CallbackInfo ci) {
|
||||
- Component finalArg = arg2 == null ? arg.decoratedContent() : arg2;
|
||||
- Component finalcomp = arg2 == null ? arg.decoratedContent() : arg2;
|
||||
- CraterServerChatEvent event = new CraterServerChatEvent(BridgedPlayer.of(this.player), finalcomp.getString(), ChatUtils.mojangToAdventure(finalcomp));
|
||||
+ private void injectChatEvent(CompletableFuture<FilteredText> completableFuture, CompletableFuture<Component> completableFuture2, PlayerChatMessage arg, Executor executor, CallbackInfoReturnable<CompletableFuture> cir) {
|
||||
+ Component comp2 = completableFuture2.join();
|
||||
+ Component finalArg = comp2 == null ? arg.decoratedContent() : comp2;
|
||||
CraterServerChatEvent event = new CraterServerChatEvent(BridgedPlayer.of(this.player), finalArg.getString(), ChatUtils.mojangToAdventure(finalArg));
|
||||
+ CraterServerChatEvent event = new CraterServerChatEvent(BridgedPlayer.of(this.player), finalArg.getString(), ChatUtils.mojangToAdventure(finalArg));
|
||||
CraterEventBus.INSTANCE.postEvent(event);
|
||||
if (event.wasCancelled())
|
||||
- ci.cancel();
|
||||
|
@@ -6,7 +6,7 @@
|
||||
"fabric-api": "*",
|
||||
- "minecraft": ">=1.21",
|
||||
- "java": ">=21"
|
||||
+ "minecraft": ">=1.19.3",
|
||||
+ "minecraft": ">=1.19.4",
|
||||
+ "java": ">=17"
|
||||
}
|
||||
}
|
||||
|
@@ -15,8 +15,8 @@
|
||||
setProjectVersion("${minecraft_version}-${project.version}")
|
||||
- setDisplayName("[Forge 1.20.6] CraterLib - ${project.version}")
|
||||
- setGameVersions("1.20.6")
|
||||
+ setDisplayName("[Forge 1.19.3/1.19.4] CraterLib - ${project.version}")
|
||||
+ setGameVersions("1.19.3", "1.19.4")
|
||||
+ setDisplayName("[Forge 1.19.4] CraterLib - ${project.version}")
|
||||
+ setGameVersions("1.19.4")
|
||||
setLoaders("forge")
|
||||
setArtifact(remapJar)
|
||||
setCurseEnvironment("both")
|
||||
|
@@ -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))
|
@@ -9,7 +9,7 @@
|
||||
@Mixin(value = ServerGamePacketListenerImpl.class, priority = Integer.MIN_VALUE)
|
||||
public class ServerGamePacketListenerImplMixin {
|
||||
|
||||
@@ -22,12 +24,13 @@
|
||||
@@ -22,13 +24,14 @@
|
||||
public ServerPlayer player;
|
||||
|
||||
@Inject(
|
||||
@@ -19,10 +19,12 @@
|
||||
cancellable = true
|
||||
)
|
||||
- private void injectChatEvent(Component component, PlayerChatMessage arg, FilteredText p_296589_, CallbackInfo ci) {
|
||||
- Component finalArg = component == null ? arg.decoratedContent() : component;
|
||||
- Component finalcomp = component == null ? arg.decoratedContent() : component;
|
||||
- CraterServerChatEvent event = new CraterServerChatEvent(BridgedPlayer.of(this.player), finalcomp.getString(), ChatUtils.mojangToAdventure(finalcomp));
|
||||
+ private void injectChatEvent(CompletableFuture<Component> completablefuture1, PlayerChatMessage arg, CompletableFuture<FilteredText> completablefuture, Void p_248218_, CallbackInfo ci) {
|
||||
+ Component comp2 = completablefuture1.join();
|
||||
+ Component finalArg = comp2 == null ? arg.decoratedContent() : comp2;
|
||||
CraterServerChatEvent event = new CraterServerChatEvent(BridgedPlayer.of(this.player), finalArg.getString(), ChatUtils.mojangToAdventure(finalArg));
|
||||
+ CraterServerChatEvent event = new CraterServerChatEvent(BridgedPlayer.of(this.player), finalArg.getString(), ChatUtils.mojangToAdventure(finalArg));
|
||||
CraterEventBus.INSTANCE.postEvent(event);
|
||||
if (event.wasCancelled())
|
||||
ci.cancel();
|
||||
|
@@ -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()
|
||||
)
|
||||
));
|
||||
}
|
@@ -3,7 +3,7 @@
|
||||
@@ -1,5 +1,5 @@
|
||||
modLoader = "javafml"
|
||||
-loaderVersion = "[50,)"
|
||||
+loaderVersion = "[44,)"
|
||||
+loaderVersion = "[45,)"
|
||||
license = "MIT"
|
||||
issueTrackerURL = "https://github.com/firstdarkdev/craterLib/issues"
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
modId = "forge"
|
||||
mandatory = true
|
||||
- versionRange = "[50,)"
|
||||
+ versionRange = "[44,)"
|
||||
+ versionRange = "[45,)"
|
||||
ordering = "NONE"
|
||||
side = "BOTH"
|
||||
|
||||
@@ -20,6 +20,6 @@
|
||||
modId = "minecraft"
|
||||
mandatory = true
|
||||
- versionRange = "[1.20.6,1.21)"
|
||||
+ versionRange = "[1.19.3,1.20)"
|
||||
+ versionRange = "[1.19.4,1.20)"
|
||||
ordering = "NONE"
|
||||
side = "BOTH"
|
||||
|
@@ -109,8 +109,8 @@
|
||||
- setVersionType("release")
|
||||
- setChangelog("https://raw.githubusercontent.com/hypherionmc/changelogs/main/craterlib/changelog-forge.md")
|
||||
- setProjectVersion("${minecraft_version}-${project.version}")
|
||||
- setDisplayName("[NeoForge 1.21.0] CraterLib - ${project.version}")
|
||||
- setGameVersions("1.21")
|
||||
- setDisplayName("[NeoForge 1.21.x] CraterLib - ${project.version}")
|
||||
- setGameVersions("1.21", "1.21.1")
|
||||
- setLoaders("neoforge")
|
||||
- setArtifact(remapJar)
|
||||
- setCurseEnvironment("both")
|
||||
|
@@ -5,8 +5,8 @@
|
||||
-
|
||||
-import com.hypherionmc.craterlib.api.events.client.LateInitEvent;
|
||||
-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;
|
||||
-import com.hypherionmc.craterlib.core.event.CraterEventBus;
|
||||
-import com.hypherionmc.craterlib.core.platform.ClientPlatform;
|
||||
@@ -54,9 +54,9 @@
|
||||
- LateInitEvent event = new LateInitEvent(new BridgedMinecraft(), BridgedOptions.of(Minecraft.getInstance().options));
|
||||
- CraterEventBus.INSTANCE.postEvent(event);
|
||||
-
|
||||
- ConfigController.getMonitoredConfigs().forEach((conf, watcher) -> {
|
||||
- ConfigController.getWatchedConfigs().forEach((conf, watcher) -> {
|
||||
- if (!conf.getClass().isAnnotationPresent(NoConfigScreen.class)) {
|
||||
- ModuleConfig config = (ModuleConfig) conf;
|
||||
- AbstractConfig config = watcher.getLeft();
|
||||
- ModList.get().getModContainerById(config.getModId()).ifPresent(c -> c.registerExtensionPoint(IConfigScreenFactory.class, ((minecraft, screen) -> new CraterConfigScreen(config, screen))));
|
||||
- }
|
||||
- });
|
||||
|
@@ -1,12 +1,11 @@
|
||||
--- a/NeoForge/src/main/java/com/hypherionmc/craterlib/common/NeoForgeServerEvents.java
|
||||
+++ /dev/null
|
||||
@@ -1,43 +1,0 @@
|
||||
@@ -1,41 +1,0 @@
|
||||
-package com.hypherionmc.craterlib.common;
|
||||
-
|
||||
-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.neoforged.bus.api.SubscribeEvent;
|
||||
-import net.neoforged.neoforge.event.RegisterCommandsEvent;
|
||||
@@ -39,8 +38,7 @@
|
||||
-
|
||||
- @SubscribeEvent
|
||||
- public void onCommandRegister(RegisterCommandsEvent event) {
|
||||
- CraterEventBus.INSTANCE.postEvent(new CraterRegisterCommandEvent());
|
||||
- CommandsRegistry.INSTANCE.registerCommands(event.getDispatcher());
|
||||
- CraterEventBus.INSTANCE.postEvent(new CraterRegisterCommandEvent(event.getDispatcher()));
|
||||
- }
|
||||
-
|
||||
-}
|
||||
|
@@ -30,8 +30,8 @@
|
||||
- cancellable = true
|
||||
- )
|
||||
- private void injectChatEvent(Component component, PlayerChatMessage arg, FilteredText p_296589_, CallbackInfo ci) {
|
||||
- Component finalArg = component == null ? arg.decoratedContent() : component;
|
||||
- CraterServerChatEvent event = new CraterServerChatEvent(BridgedPlayer.of(this.player), finalArg.getString(), ChatUtils.mojangToAdventure(finalArg));
|
||||
- Component finalcomp = component == null ? arg.decoratedContent() : component;
|
||||
- CraterServerChatEvent event = new CraterServerChatEvent(BridgedPlayer.of(this.player), finalcomp.getString(), ChatUtils.mojangToAdventure(finalcomp));
|
||||
- CraterEventBus.INSTANCE.postEvent(event);
|
||||
- if (event.wasCancelled())
|
||||
- ci.cancel();
|
||||
|
@@ -0,0 +1,56 @@
|
||||
--- a/NeoForge/src/main/java/com/hypherionmc/craterlib/mixin/ServerStatusPacketListenerMixin.java
|
||||
+++ /dev/null
|
||||
@@ -1,53 +1,0 @@
|
||||
-package com.hypherionmc.craterlib.mixin;
|
||||
-
|
||||
-import com.hypherionmc.craterlib.api.events.server.ServerStatusEvent;
|
||||
-import com.hypherionmc.craterlib.core.event.CraterEventBus;
|
||||
-import com.hypherionmc.craterlib.utils.ChatUtils;
|
||||
-import net.minecraft.network.Connection;
|
||||
-import net.minecraft.network.protocol.status.ClientboundStatusResponsePacket;
|
||||
-import net.minecraft.network.protocol.status.ServerStatus;
|
||||
-import net.minecraft.network.protocol.status.ServerboundStatusRequestPacket;
|
||||
-import net.minecraft.server.network.ServerStatusPacketListenerImpl;
|
||||
-import org.spongepowered.asm.mixin.Final;
|
||||
-import org.spongepowered.asm.mixin.Mixin;
|
||||
-import org.spongepowered.asm.mixin.Shadow;
|
||||
-import org.spongepowered.asm.mixin.injection.At;
|
||||
-import org.spongepowered.asm.mixin.injection.Inject;
|
||||
-import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
-
|
||||
-@Mixin(ServerStatusPacketListenerImpl.class)
|
||||
-public class ServerStatusPacketListenerMixin {
|
||||
-
|
||||
- @Shadow
|
||||
- @Final
|
||||
- private ServerStatus status;
|
||||
-
|
||||
- @Shadow @Final private Connection connection;
|
||||
-
|
||||
- @Inject(method = "handleStatusRequest",
|
||||
- at = @At(
|
||||
- value = "INVOKE",
|
||||
- target = "Lnet/minecraft/network/Connection;send(Lnet/minecraft/network/protocol/Packet;)V",
|
||||
- shift = At.Shift.BEFORE),
|
||||
- cancellable = true
|
||||
- )
|
||||
- private void injectHandleStatusRequest(ServerboundStatusRequestPacket arg, CallbackInfo ci) {
|
||||
- ServerStatusEvent.StatusRequestEvent event = new ServerStatusEvent.StatusRequestEvent(ChatUtils.mojangToAdventure(status.description()));
|
||||
- CraterEventBus.INSTANCE.postEvent(event);
|
||||
-
|
||||
- if (event.getNewStatus() != null) {
|
||||
- ci.cancel();
|
||||
- this.connection.send(new ClientboundStatusResponsePacket(
|
||||
- new ServerStatus(ChatUtils.adventureToMojang(
|
||||
- event.getNewStatus()),
|
||||
- status.players(),
|
||||
- status.version(),
|
||||
- status.favicon(),
|
||||
- status.enforcesSecureChat(),
|
||||
- status.isModded()
|
||||
- )
|
||||
- ));
|
||||
- }
|
||||
- }
|
||||
-
|
||||
-}
|
@@ -1,6 +1,6 @@
|
||||
--- a/NeoForge/src/main/resources/craterlib.neoforge.mixins.json
|
||||
+++ /dev/null
|
||||
@@ -1,15 +1,0 @@
|
||||
@@ -1,16 +1,0 @@
|
||||
-{
|
||||
- "required": true,
|
||||
- "minVersion": "0.8",
|
||||
@@ -10,7 +10,8 @@
|
||||
- ],
|
||||
- "client": [],
|
||||
- "server": [
|
||||
- "ServerGamePacketListenerImplMixin"
|
||||
- "ServerGamePacketListenerImplMixin",
|
||||
- "ServerStatusPacketListenerMixin"
|
||||
- ],
|
||||
- "injectors": {
|
||||
- "defaultRequire": 1
|
||||
|
@@ -5,8 +5,8 @@
|
||||
| 1.18.2-1.20.2 | ✳️ |
|
||||
| 1.20.4 | ✳️ |
|
||||
-| 1.20.6 | ❌ |
|
||||
| 1.21 | ✳️ |
|
||||
+| 1.21 | 🚧 |
|
||||
| 1.21.x | ✳️ |
|
||||
+
|
||||
|
||||
- ❌ - Not Supported; no bug fixes or new features.
|
||||
- 🚧 - Work in Progress; not ready for release.
|
||||
|
@@ -11,9 +11,9 @@
|
||||
|
||||
group = rootProject.group
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
shade "me.hypherionmc.moon-config:core:${moon_config}"
|
||||
@@ -59,7 +59,7 @@
|
||||
shade "me.hypherionmc.moon-config:toml:${moon_config}"
|
||||
shade "me.hypherionmc.moon-config:json:${moon_config}"
|
||||
shade "com.hypherionmc:rpcsdk:${rpc_sdk}"
|
||||
- shade "me.hypherionmc.sdlink:mcdiscordformatter-1.20.3:${discord_formatter}"
|
||||
+ shade "me.hypherionmc.sdlink:mcdiscordformatter-1.19.1:${discord_formatter}"
|
||||
|
@@ -5,20 +5,20 @@
|
||||
|
||||
# Shared
|
||||
-minecraft_version=1.21
|
||||
+minecraft_version=1.19.3
|
||||
+minecraft_version=1.19.4
|
||||
project_group=com.hypherionmc.craterlib
|
||||
|
||||
# Fabric
|
||||
fabric_loader=0.15.11
|
||||
-fabric_api=0.100.1+1.21
|
||||
+fabric_api=0.76.1+1.19.3
|
||||
+fabric_api=0.87.2+1.19.4
|
||||
|
||||
# Forge
|
||||
-forge_version=50.0.6
|
||||
-
|
||||
-# NeoForged
|
||||
-neoforge_version=0.0-beta
|
||||
+forge_version=44.1.0
|
||||
+forge_version=45.3.0
|
||||
|
||||
# Dependencies
|
||||
moon_config=1.0.9
|
||||
|
Reference in New Issue
Block a user