mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-17 06:11:24 +00:00
Merge remote-tracking branch 'origin/ver/6.1.2' into ver/6.2.0
# Conflicts: # platforms/fabric/src/main/resources/terra.mixins.json
This commit is contained in:
@@ -16,7 +16,7 @@ dependencies {
|
||||
|
||||
modImplementation("net.fabricmc:fabric-loader:${Versions.Fabric.fabricLoader}")
|
||||
|
||||
setOf("fabric-lifecycle-events-v1", "fabric-resource-loader-v0", "fabric-api-base").forEach { apiModule ->
|
||||
setOf("fabric-lifecycle-events-v1", "fabric-resource-loader-v0", "fabric-api-base", "fabric-command-api-v2").forEach { apiModule ->
|
||||
val module = fabricApi.module(apiModule, Versions.Fabric.fabricAPI)
|
||||
modImplementation(module)
|
||||
include(module)
|
||||
@@ -29,8 +29,8 @@ dependencies {
|
||||
"annotationProcessor"("net.fabricmc:sponge-mixin:${Versions.Fabric.mixin}")
|
||||
"annotationProcessor"("net.fabricmc:fabric-loom:${Versions.Fabric.loom}")
|
||||
|
||||
//include(modImplementation("cloud.commandframework", "cloud-fabric", Versions.Libraries.cloud))
|
||||
//include("cloud.commandframework", "cloud-fabric", Versions.Libraries.cloud)
|
||||
include(modImplementation("cloud.commandframework", "cloud-fabric", Versions.Libraries.cloud))
|
||||
include("cloud.commandframework", "cloud-fabric", Versions.Libraries.cloud)
|
||||
}
|
||||
|
||||
loom {
|
||||
|
||||
@@ -17,7 +17,15 @@
|
||||
|
||||
package com.dfsek.terra.fabric;
|
||||
|
||||
import cloud.commandframework.execution.CommandExecutionCoordinator;
|
||||
|
||||
import cloud.commandframework.fabric.FabricServerCommandManager;
|
||||
|
||||
import com.dfsek.terra.api.command.CommandSender;
|
||||
import com.dfsek.terra.api.event.events.platform.CommandRegistrationEvent;
|
||||
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
import net.minecraft.server.command.ServerCommandSource;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.world.gen.WorldPresets;
|
||||
@@ -45,7 +53,7 @@ public class FabricEntryPoint implements ModInitializer {
|
||||
@Override
|
||||
public void onInitialize() {
|
||||
logger.info("Initializing Terra Fabric mod...");
|
||||
/*
|
||||
|
||||
FabricServerCommandManager<CommandSender> manager = new FabricServerCommandManager<>(
|
||||
CommandExecutionCoordinator.simpleCoordinator(),
|
||||
serverCommandSource -> (CommandSender) serverCommandSource,
|
||||
@@ -56,7 +64,5 @@ public class FabricEntryPoint implements ModInitializer {
|
||||
manager.brigadierManager().setNativeNumberSuggestions(false);
|
||||
|
||||
TERRA_PLUGIN.getEventManager().callEvent(new CommandRegistrationEvent(manager));
|
||||
TODO: re-enable when Cloud updates
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
package com.dfsek.terra.fabric.mixin;
|
||||
|
||||
import com.dfsek.terra.fabric.FabricEntryPoint;
|
||||
|
||||
import net.minecraft.server.command.ReloadCommand;
|
||||
import net.minecraft.server.command.ServerCommandSource;
|
||||
import net.minecraft.text.Text;
|
||||
import org.checkerframework.checker.units.qual.A;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
|
||||
@Mixin(ReloadCommand.class)
|
||||
public class ReloadCommandMixin {
|
||||
@Inject(method = "tryReloadDataPacks", at = @At("HEAD"))
|
||||
private static void inject(Collection<String> dataPacks, ServerCommandSource source, CallbackInfo ci) {
|
||||
source.sendFeedback(Text.literal("Reloading Terra..."), true);
|
||||
FabricEntryPoint.getPlatform().reload();
|
||||
source.sendFeedback(Text.literal("Done."), true);
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,6 @@
|
||||
"package": "com.dfsek.terra.fabric.mixin",
|
||||
"compatibilityLevel": "JAVA_17",
|
||||
"mixins": [
|
||||
"ReloadCommandMixin",
|
||||
"access.MobSpawnerLogicAccessor",
|
||||
"access.StateAccessor",
|
||||
"access.StructureAccessorAccessor",
|
||||
|
||||
Reference in New Issue
Block a user