Compare commits
4 Commits
5baaba43d2
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 1eb7dca8e4 | |||
| 629eab8032 | |||
| c809da4ec4 | |||
| c16a344585 |
16
build.gradle
16
build.gradle
@@ -52,11 +52,19 @@ dependencies {
|
||||
}
|
||||
|
||||
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") {
|
||||
expand "version": project.version
|
||||
expand properties
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile).configureEach {
|
||||
@@ -64,6 +72,10 @@ tasks.withType(JavaCompile).configureEach {
|
||||
it.options.release = 21
|
||||
}
|
||||
|
||||
tasks.withType(Jar).configureEach {
|
||||
exclude('META-INF/maven/**')
|
||||
}
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_21
|
||||
targetCompatibility = JavaVersion.VERSION_21
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
# The latest versions are available at https://quiltmc.org/en/usage/latest-versions
|
||||
[versions]
|
||||
minecraft = "1.21.4"
|
||||
yarn_mappings="1.21.4+build.8"
|
||||
minecraft = "1.21.11"
|
||||
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
|
||||
fabric_loader = "0.16.10"
|
||||
fabric_version = "0.115.0+1.21.4"
|
||||
fabric_loader = "0.18.4"
|
||||
fabric_version = "0.141.3+1.21.11"
|
||||
|
||||
compression = "1.+"
|
||||
|
||||
|
||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
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
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public class DonateThread extends Thread {
|
||||
|
||||
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")));
|
||||
|
||||
LOGGER.info("Exec donate #{}", lastDonate);
|
||||
|
||||
@@ -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,7 +13,6 @@ 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())
|
||||
@@ -28,8 +26,6 @@ public class DPI {
|
||||
context.getSource().sendFeedback(() -> Text.literal("DonatePay token set!"), false);
|
||||
|
||||
return 1;
|
||||
})))
|
||||
);
|
||||
})));
|
||||
})))))));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.util.List;
|
||||
|
||||
public class Config {
|
||||
private String donpayToken = "<YOUR_TOKEN>";
|
||||
private String messageCmd = "title @a title \"{message}\"";
|
||||
private int reqCooldown = 15;
|
||||
private int cmdCooldown = 2;
|
||||
private int lastDonate = 0;
|
||||
@@ -49,5 +50,13 @@ public class Config {
|
||||
public void setCmdCooldown(int cmdCooldown) {
|
||||
this.cmdCooldown = cmdCooldown;
|
||||
}
|
||||
|
||||
public String getMessageCmd() {
|
||||
return messageCmd;
|
||||
}
|
||||
|
||||
public void setMessageCmd(String messageCmd) {
|
||||
this.messageCmd = messageCmd;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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.*;
|
||||
|
||||
Reference in New Issue
Block a user