Worked patch on 1.20.1

This commit is contained in:
BitHeaven 2024-09-29 13:48:50 +05:00
parent 74fd36eea9
commit f33ec41d0d
3 changed files with 12 additions and 10 deletions

View File

@ -42,8 +42,8 @@ dependencies {
// Fabric API. This is technically optional, but you probably want it anyway. // Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
implementation group: 'org.yaml', name: 'snakeyaml', version: '2.3' implementation group: 'org.yaml', name: 'snakeyaml', version: '2.0'
includedJars group: 'org.yaml', name: 'snakeyaml', version: '2.3' includedJars group: 'org.yaml', name: 'snakeyaml', version: '2.0'
implementation group: 'org.json', name: 'json', version: '20240303' implementation group: 'org.json', name: 'json', version: '20240303'
includedJars group: 'org.json', name: 'json', version: '20240303' includedJars group: 'org.json', name: 'json', version: '20240303'
} }
@ -85,12 +85,14 @@ java {
} }
jar { jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from("LICENSE") { from("LICENSE") {
rename { "${it}_${project.archivesBaseName}" } rename { "${it}_${project.archivesBaseName}" }
} }
from configurations.includedJars.collect { duplicatesStrategy = DuplicatesStrategy.EXCLUDE
it.isDirectory() ? it : zipTree(it) from {
configurations.includedJars.collect {
it.isDirectory() ? it : zipTree(it)
}
} }
} }
// configure the maven publication // configure the maven publication

View File

@ -16,7 +16,7 @@ public class DonPayInteg implements ModInitializer {
public static final String MOD_ID = "donpayinteg"; public static final String MOD_ID = "donpayinteg";
public static final String NAME = "DonatePayIntegration"; public static final String NAME = "DonatePayIntegration";
public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID); public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);
public static List<String> commands = new ArrayList<String>(); public static List<String> commands = new ArrayList<>();
@Override @Override
public void onInitialize() { public void onInitialize() {
@ -40,8 +40,8 @@ public class DonPayInteg implements ModInitializer {
if(j.getAndIncrement() % (20 * 2) == 0) { if(j.getAndIncrement() % (20 * 2) == 0) {
if (!commands.isEmpty()) { if (!commands.isEmpty()) {
world.getCommandManager().executeWithPrefix(world.getCommandSource(), commands.getFirst()); world.getCommandManager().executeWithPrefix(world.getCommandSource(), commands.get(0));
commands.removeFirst(); commands.remove(0);
} }
} }
}); });

View File

@ -47,8 +47,8 @@ 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.add("title @a title \"" + msg.replace("{username}", objects.getJSONObject("vars").getString("name")) + "\"");
DonPayInteg.commands.addLast(cmd.replace("{username}", objects.getJSONObject("vars").getString("name"))); DonPayInteg.commands.add(cmd.replace("{username}", objects.getJSONObject("vars").getString("name")));
LOGGER.info("Exec donate #{}", lastDonate); LOGGER.info("Exec donate #{}", lastDonate);
Config config = ConfigHandler.load(); Config config = ConfigHandler.load();