4 Commits

Author SHA1 Message Date
1eb7dca8e4 Update to 1.21.11
Some checks failed
build / build (21) (push) Has been cancelled
2026-03-09 09:08:41 +05:00
629eab8032 Update gradle
Some checks failed
build / build (21) (push) Has been cancelled
2025-01-27 10:55:17 +05:00
c809da4ec4 Update gradle
Some checks failed
build / build (21) (push) Failing after 4m41s
2025-01-27 10:29:20 +05:00
c16a344585 Add message command 2025-01-27 10:23:44 +05:00
8 changed files with 41 additions and 25 deletions

View File

@@ -52,11 +52,19 @@ dependencies {
} }
processResources { processResources {
inputs.property "version", project.version // require dependencies to be the version compiled against or newer
Map<String, Object> properties = [
"version": version,
"minecraft_version": libs.versions.minecraft.get(),
"loader_version": libs.versions.fabric.loader.get(),
]
inputs.properties(properties)
filesMatching("fabric.mod.json") { filesMatching("fabric.mod.json") {
expand "version": project.version expand properties
} }
} }
tasks.withType(JavaCompile).configureEach { tasks.withType(JavaCompile).configureEach {
@@ -64,6 +72,10 @@ tasks.withType(JavaCompile).configureEach {
it.options.release = 21 it.options.release = 21
} }
tasks.withType(Jar).configureEach {
exclude('META-INF/maven/**')
}
java { java {
sourceCompatibility = JavaVersion.VERSION_21 sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21 targetCompatibility = JavaVersion.VERSION_21

View File

@@ -1,12 +1,12 @@
# The latest versions are available at https://quiltmc.org/en/usage/latest-versions # The latest versions are available at https://quiltmc.org/en/usage/latest-versions
[versions] [versions]
minecraft = "1.21.4" minecraft = "1.21.11"
yarn_mappings="1.21.4+build.8" yarn_mappings="1.21.11+build.4"
fabric_loom = "1.9-SNAPSHOT" fabric_loom = "1.15-SNAPSHOT"
# check these on https://modmuss50.me/fabric.html # check these on https://modmuss50.me/fabric.html
fabric_loader = "0.16.10" fabric_loader = "0.18.4"
fabric_version = "0.115.0+1.21.4" fabric_version = "0.141.3+1.21.11"
compression = "1.+" compression = "1.+"

View File

@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME

View File

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

View File

@@ -47,7 +47,7 @@ public class DonateThread extends Thread {
lastDonate = objects.getInt("id"); lastDonate = objects.getInt("id");
DonPayInteg.commands.addLast("title @a title \"" + msg.replace("{username}", objects.getJSONObject("vars").getString("name")) + "\""); DonPayInteg.commands.addLast(ConfigHandler.load().getMessageCmd().replace("{message}", msg.replace("{username}", objects.getJSONObject("vars").getString("name"))));
DonPayInteg.commands.addLast(cmd.replace("{username}", objects.getJSONObject("vars").getString("name"))); DonPayInteg.commands.addLast(cmd.replace("{username}", objects.getJSONObject("vars").getString("name")));
LOGGER.info("Exec donate #{}", lastDonate); LOGGER.info("Exec donate #{}", lastDonate);

View File

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

@@ -4,6 +4,7 @@ import java.util.List;
public class Config { public class Config {
private String donpayToken = "<YOUR_TOKEN>"; private String donpayToken = "<YOUR_TOKEN>";
private String messageCmd = "title @a title \"{message}\"";
private int reqCooldown = 15; private int reqCooldown = 15;
private int cmdCooldown = 2; private int cmdCooldown = 2;
private int lastDonate = 0; private int lastDonate = 0;
@@ -49,5 +50,13 @@ public class Config {
public void setCmdCooldown(int cmdCooldown) { public void setCmdCooldown(int cmdCooldown) {
this.cmdCooldown = cmdCooldown; this.cmdCooldown = cmdCooldown;
} }
public String getMessageCmd() {
return messageCmd;
}
public void setMessageCmd(String messageCmd) {
this.messageCmd = messageCmd;
}
} }

View File

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