Update to 26.1
This commit is contained in:
@@ -2,11 +2,11 @@ package io.github.skippyall.ruler.fabric;
|
||||
|
||||
import io.github.skippyall.ruler.command.CommandHelper;
|
||||
import net.kyori.adventure.audience.Audience;
|
||||
import net.minecraft.server.command.ServerCommandSource;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
|
||||
public class FabricCommandHelper implements CommandHelper<ServerCommandSource> {
|
||||
public class FabricCommandHelper implements CommandHelper<CommandSourceStack> {
|
||||
@Override
|
||||
public Audience toAudience(ServerCommandSource source) {
|
||||
public Audience toAudience(CommandSourceStack source) {
|
||||
return source.audience();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,6 @@ public class FabricPlatform implements Platform {
|
||||
|
||||
@Override
|
||||
public <T> CompletableFuture<T> runAsync(Supplier<T> supplier) {
|
||||
return CompletableFuture.supplyAsync(supplier, Util.getMainWorkerExecutor());
|
||||
return CompletableFuture.supplyAsync(supplier, Util.backgroundExecutor());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,20 +5,20 @@ import io.github.skippyall.ruler.Ruler;
|
||||
import io.github.skippyall.ruler.command.Commands;
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
|
||||
import net.minecraft.server.command.ServerCommandSource;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class RulerFabric implements ModInitializer {
|
||||
public static final String MOD_ID = "ruler";
|
||||
public static final Commands<ServerCommandSource> COMMANDS = new Commands<>(new FabricCommandHelper());
|
||||
public static final Commands<CommandSourceStack> COMMANDS = new Commands<>(new FabricCommandHelper());
|
||||
public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);
|
||||
|
||||
@Override
|
||||
public void onInitialize() {
|
||||
Ruler.init(new FabricPlatform());
|
||||
CommandRegistrationCallback.EVENT.register((dispatcher, access,environment) -> {
|
||||
for(LiteralArgumentBuilder<ServerCommandSource> node : COMMANDS.getCommands()) {
|
||||
for(LiteralArgumentBuilder<CommandSourceStack> node : COMMANDS.getCommands()) {
|
||||
dispatcher.register(node);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
},
|
||||
"depends": {
|
||||
"fabricloader": ">=${loader_version}",
|
||||
"fabric": "*",
|
||||
"minecraft": "${minecraft_version}"
|
||||
"fabric-api": "*",
|
||||
"minecraft": "~26.1"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user