Update to 1.21.11
Some checks are pending
build / build (21) (push) Waiting to run

This commit is contained in:
2026-03-09 09:08:41 +05:00
parent 629eab8032
commit 1eb7dca8e4
6 changed files with 18 additions and 23 deletions

View File

@@ -40,7 +40,7 @@ public class DonPayInteg implements ModInitializer {
if(j.getAndIncrement() % (20 * ConfigHandler.load().getCmdCooldown()) == 0) {
if (!commands.isEmpty()) {
world.getCommandManager().executeWithPrefix(world.getCommandSource(), commands.getFirst());
world.getCommandManager().parseAndExecute(world.getCommandSource(), commands.getFirst());
commands.removeFirst();
}
}

View File

@@ -1,6 +1,5 @@
package ru.bitheaven.donpayinteg.command;
import com.mojang.brigadier.arguments.IntegerArgumentType;
import com.mojang.brigadier.arguments.StringArgumentType;
import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
import net.minecraft.server.command.CommandManager;
@@ -14,22 +13,19 @@ public class DPI {
}
public static void register() {
CommandRegistrationCallback.EVENT.register((((dispatcher, registryAccess, environment) ->
{
dispatcher.register(CommandManager.literal("dpi")
.then(CommandManager.literal("set_token")
.then(CommandManager.argument("token", StringArgumentType.string())
.executes(context -> {
String token = StringArgumentType.getString(context, "token");
.then(CommandManager.literal("set_token")
.then(CommandManager.argument("token", StringArgumentType.string())
.executes(context -> {
String token = StringArgumentType.getString(context, "token");
Config config = ConfigHandler.load();
config.setDonpayToken(token);
ConfigHandler.save(config);
Config config = ConfigHandler.load();
config.setDonpayToken(token);
ConfigHandler.save(config);
context.getSource().sendFeedback(() -> Text.literal("DonatePay token set!"), false);
context.getSource().sendFeedback(() -> Text.literal("DonatePay token set!"), false);
return 1;
})))
);
})));
return 1;
})))))));
}
}

View File

@@ -6,7 +6,6 @@ import org.yaml.snakeyaml.LoaderOptions;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.Constructor;
import org.yaml.snakeyaml.inspector.TagInspector;
import ru.bitheaven.donpayinteg.DonPayInteg;
import java.io.*;