spring-cleaning, update all the dependencies

This commit is contained in:
nossr50 2024-05-19 13:48:25 -07:00
parent 32ff8c6818
commit 364d4cd6e7
15 changed files with 64 additions and 70 deletions

View File

@ -1,5 +1,6 @@
Version 2.2.013
mcMMO now requires Java 21 (see notes)
Modified the RNG for dropping non-ore blocks from Blast Mining to yield about 50% of what was destroyed
(API) Deprecated com.gmail.nossr50.mcMMO.getPlaceStore
(API) Added com.gmail.nossr50.mcMMO.getUserBlockTracker
(API) Added com.gmail.nossr50.mcMMO.getChunkManager

41
pom.xml
View File

@ -75,7 +75,7 @@
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M7</version>
<version>3.2.5</version>
<configuration>
<junitArtifactName>org.junit.jupiter:junit-jupiter</junitArtifactName>
@ -85,7 +85,7 @@
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.0.0-M7</version>
<version>3.2.5</version>
<configuration>
<junitArtifactName>org.junit.jupiter:junit-jupiter</junitArtifactName>
@ -113,6 +113,7 @@
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.7.1</version>
<configuration>
<descriptors>
<descriptor>src/main/assembly/package.xml</descriptor>
@ -304,42 +305,42 @@
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-gson</artifactId>
<version>4.16.0</version>
<version>4.17.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-gson-legacy-impl</artifactId>
<version>4.16.0</version>
<version>4.17.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-json</artifactId>
<version>4.16.0</version>
<version>4.17.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-json-legacy-impl</artifactId>
<version>4.16.0</version>
<version>4.17.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-api</artifactId>
<version>4.16.0</version>
<version>4.17.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-nbt</artifactId>
<version>4.16.0</version>
<version>4.17.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-key</artifactId>
<version>4.16.0</version>
<version>4.17.0</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-platform-api</artifactId>
<version>4.3.2</version>
<version>4.3.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
@ -349,12 +350,12 @@
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-platform-facet</artifactId>
<version>4.3.2</version>
<version>4.3.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-platform-viaversion</artifactId>
<version>4.3.2</version>
<version>4.3.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
@ -364,12 +365,12 @@
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-provider-gitexe</artifactId>
<version>2.0.0-M1</version>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>org.bstats</groupId>
<artifactId>bstats-bukkit</artifactId>
<version>3.0.0</version>
<version>3.0.2</version>
<scope>compile</scope>
</dependency>
<dependency>
@ -411,36 +412,36 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.9.0</version>
<version>5.11.0-M2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>4.6.1</version>
<version>5.12.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-inline</artifactId>
<version>4.6.1</version>
<version>5.2.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jdbc</artifactId>
<version>10.1.0-M17</version>
<version>10.1.24</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>23.0.0</version>
<version>24.1.0</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>32.1.1-jre</version> <!-- At this time Spigot is including 29.0 Guava classes that we are using -->
<version>33.2.0-jre</version> <!-- At this time Spigot is including 29.0 Guava classes that we are using -->
<scope>compile</scope>
</dependency>
<dependency>

View File

@ -3,7 +3,7 @@ package com.gmail.nossr50.commands.player;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.runnables.commands.McrankCommandAsyncTask;
import com.gmail.nossr50.runnables.commands.McRankCommandAsyncTask;
import com.gmail.nossr50.util.MetadataConstants;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.commands.CommandUtils;
@ -111,7 +111,7 @@ public class McrankCommand implements TabExecutor {
boolean useBoard = mcMMO.p.getGeneralConfig().getScoreboardsEnabled() && (sender instanceof Player) && (mcMMO.p.getGeneralConfig().getRankUseBoard());
boolean useChat = !useBoard || mcMMO.p.getGeneralConfig().getRankUseChat();
mcMMO.p.getFoliaLib().getImpl().runAsync(new McrankCommandAsyncTask(playerName, sender, useBoard, useChat));
mcMMO.p.getFoliaLib().getImpl().runAsync(new McRankCommandAsyncTask(playerName, sender, useBoard, useChat));
}
private long getCDSeconds(McMMOPlayer mcMMOPlayer, long cooldownMillis) {

View File

@ -4,7 +4,7 @@ import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.runnables.commands.MctopCommandAsyncTask;
import com.gmail.nossr50.runnables.commands.McTopCommandAsyncTask;
import com.gmail.nossr50.util.MetadataConstants;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.commands.CommandUtils;
@ -115,7 +115,7 @@ public class MctopCommand implements TabExecutor {
boolean useBoard = (sender instanceof Player) && (mcMMO.p.getGeneralConfig().getTopUseBoard());
boolean useChat = !useBoard || mcMMO.p.getGeneralConfig().getTopUseChat();
mcMMO.p.getFoliaLib().getImpl().runAsync(new MctopCommandAsyncTask(page, skill, sender, useBoard, useChat));
mcMMO.p.getFoliaLib().getImpl().runAsync(new McTopCommandAsyncTask(page, skill, sender, useBoard, useChat));
}
private PrimarySkillType extractSkill(CommandSender sender, String skillName) {

View File

@ -3,7 +3,6 @@ package com.gmail.nossr50.config.mods;
import com.gmail.nossr50.config.LegacyConfigLoader;
import com.gmail.nossr50.datatypes.mods.CustomEntity;
import com.gmail.nossr50.mcMMO;
import org.apache.commons.lang.ClassUtils;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
@ -30,7 +29,7 @@ public class CustomEntityLegacyConfig extends LegacyConfigLoader {
String className = config.getString(entityName + ".Class", "");
try {
clazz = ClassUtils.getClass(className);
clazz = Class.forName(className);
} catch (ClassNotFoundException e) {
mcMMO.p.getLogger().warning("Invalid class (" + className + ") detected for " + entityName + ".");
mcMMO.p.getLogger().warning("This custom entity may not function properly.");

View File

@ -300,7 +300,7 @@ public class FlatFileDataProcessor {
//We add a trailing : as it is needed for some reason (is it?)
//TODO: Is the trailing ":" actually necessary?
String fromSplit = org.apache.commons.lang.StringUtils.join(splitData, ":") + ":";
String fromSplit = org.apache.commons.lang3.StringUtils.join(splitData, ":") + ":";
stringBuilder.append(fromSplit).append("\r\n");
}

View File

@ -234,7 +234,7 @@ public final class FlatFileDatabaseManager implements DatabaseManager {
if (rewrite) {
// Rewrite their data with a valid time
character[OVERHAUL_LAST_LOGIN] = Long.toString(lastPlayed);
String newLine = org.apache.commons.lang.StringUtils.join(character, ":");
String newLine = org.apache.commons.lang3.StringUtils.join(character, ":");
writer.append(newLine).append("\r\n");
} else {
writer.append(line).append("\r\n");
@ -905,7 +905,7 @@ public final class FlatFileDatabaseManager implements DatabaseManager {
}
character[UUID_INDEX] = fetchedUUIDs.remove(character[USERNAME_INDEX]).toString();
line = org.apache.commons.lang.StringUtils.join(character, ":") + ":";
line = org.apache.commons.lang3.StringUtils.join(character, ":") + ":";
}
i++;

View File

@ -1,6 +1,6 @@
package com.gmail.nossr50.placeholders;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.bukkit.entity.Player;
public class PartyLeaderPlaceholder implements Placeholder {
@ -12,7 +12,7 @@ public class PartyLeaderPlaceholder implements Placeholder {
@Override
public String process(Player player, String params) {
return StringUtils.stripToEmpty(papiExpansion.getPartyLeader(player));
return StringUtils.trimToEmpty(papiExpansion.getPartyLeader(player));
}
@Override

View File

@ -1,6 +1,6 @@
package com.gmail.nossr50.placeholders;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.bukkit.entity.Player;
public class PartyNamePlaceholder implements Placeholder {
@ -12,7 +12,7 @@ public class PartyNamePlaceholder implements Placeholder {
@Override
public String process(Player player, String params) {
return StringUtils.stripToEmpty(papiExpansion.getPartyName(player));
return StringUtils.trimToEmpty(papiExpansion.getPartyName(player));
}
@Override

View File

@ -3,18 +3,18 @@ package com.gmail.nossr50.runnables.commands;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.CancellableRunnable;
import org.apache.commons.lang.Validate;
import org.apache.commons.lang3.Validate;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import java.util.Map;
public class McrankCommandAsyncTask extends CancellableRunnable {
public class McRankCommandAsyncTask extends CancellableRunnable {
private final String playerName;
private final CommandSender sender;
private final boolean useBoard, useChat;
public McrankCommandAsyncTask(String playerName, CommandSender sender, boolean useBoard, boolean useChat) {
public McRankCommandAsyncTask(String playerName, CommandSender sender, boolean useBoard, boolean useChat) {
Validate.isTrue(useBoard || useChat, "Attempted to start a rank retrieval with both board and chat off");
Validate.notNull(sender, "Attempted to start a rank retrieval with no recipient");

View File

@ -4,19 +4,19 @@ import com.gmail.nossr50.datatypes.database.PlayerStat;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.CancellableRunnable;
import org.apache.commons.lang.Validate;
import org.apache.commons.lang3.Validate;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import java.util.List;
public class MctopCommandAsyncTask extends CancellableRunnable {
public class McTopCommandAsyncTask extends CancellableRunnable {
private final CommandSender sender;
private final PrimarySkillType skill;
private final int page;
private final boolean useBoard, useChat;
public MctopCommandAsyncTask(int page, PrimarySkillType skill, CommandSender sender, boolean useBoard, boolean useChat) {
public McTopCommandAsyncTask(int page, PrimarySkillType skill, CommandSender sender, boolean useBoard, boolean useChat) {
Validate.isTrue(useBoard || useChat, "Attempted to start a rank retrieval with both board and chat off");
Validate.notNull(sender, "Attempted to start a rank retrieval with no recipient");

View File

@ -14,7 +14,7 @@ import org.bukkit.entity.Player;
import java.util.List;
/**
* Display the results of {@link MctopCommandAsyncTask} to the sender.
* Display the results of {@link McTopCommandAsyncTask} to the sender.
*/
public class MctopCommandDisplayTask extends CancellableRunnable {
private final List<PlayerStat> userStats;

View File

@ -13,10 +13,11 @@ import com.gmail.nossr50.runnables.skills.AbilityCooldownTask;
import com.gmail.nossr50.skills.SkillManager;
import com.gmail.nossr50.util.*;
import com.gmail.nossr50.util.player.NotificationManager;
import com.gmail.nossr50.util.random.Probability;
import com.gmail.nossr50.util.random.ProbabilityUtil;
import com.gmail.nossr50.util.skills.RankUtils;
import com.gmail.nossr50.util.skills.SkillUtils;
import org.apache.commons.lang.math.RandomUtils;
import org.apache.commons.lang3.RandomUtils;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
@ -202,7 +203,7 @@ public class MiningManager extends SkillManager {
if (isDropIllegal(blockState.getType()))
continue;
if (RandomUtils.nextFloat() < debrisYield) {
if (Probability.ofPercent(50).evaluate()) {
Misc.spawnItem(getPlayer(), Misc.getBlockCenter(blockState), new ItemStack(blockState.getType()), ItemSpawnReason.BLAST_MINING_DEBRIS_NON_ORES); // Initial block that would have been dropped
}
}

View File

@ -18,7 +18,6 @@ import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.scoreboards.ScoreboardManager.SidebarType;
import com.gmail.nossr50.util.skills.SkillTools;
import com.tcoded.folialib.wrapper.task.WrappedTask;
import org.apache.commons.lang.Validate;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.scoreboard.DisplaySlot;
@ -30,6 +29,8 @@ import org.jetbrains.annotations.NotNull;
import java.util.List;
import java.util.Map;
import static java.util.Objects.requireNonNull;
public class ScoreboardWrapper {
public static final String SIDE_OBJECTIVE = "mcMMO_sideObjective";
public static final String POWER_OBJECTIVE = "mcMMO_powerObjective";
@ -485,7 +486,7 @@ public class ScoreboardWrapper {
break;
case SKILL_BOARD:
Validate.notNull(targetSkill);
requireNonNull(targetSkill);
if (!SkillTools.isChildSkill(targetSkill)) {
int currentXP = mcMMOPlayer.getSkillXpLevel(targetSkill);

View File

@ -3,7 +3,7 @@ package com.gmail.nossr50.util.skills;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.sounds.SoundManager;
import com.gmail.nossr50.util.sounds.SoundType;
import org.apache.commons.lang.math.RandomUtils;
import org.apache.commons.lang3.RandomUtils;
import org.bukkit.Effect;
import org.bukkit.Location;
import org.bukkit.Material;
@ -42,31 +42,22 @@ public final class ParticleEffectUtils {
double offSetVal = 0.3D;
switch(RandomUtils.nextInt(10)) {
case 0:
return new Location(world, x - offSetVal, y, z);
case 1:
return new Location(world, x + offSetVal, y, z);
case 2:
return new Location(world, x, y + offSetVal, z);
case 3:
return new Location(world, x, y - offSetVal, z);
case 4: Location locE = new Location(world, x, y, z + offSetVal);
return new Location(world, x, y, z - offSetVal);
case 5:
return new Location(world, x + offSetVal, y, z + offSetVal);
case 6:
return new Location(world, x - offSetVal, y, z - offSetVal);
case 7:
return new Location(world, x - offSetVal, y - offSetVal, z - offSetVal);
case 8:
return new Location(world, x + offSetVal, y - offSetVal, z + offSetVal);
case 9:
return new Location(world, x - offSetVal, y + offSetVal, z - offSetVal);
default:
return new Location(world, x + offSetVal, y + offSetVal, z - offSetVal);
}
return switch (RandomUtils.nextInt(0, 10)) {
case 0 -> new Location(world, x - offSetVal, y, z);
case 1 -> new Location(world, x + offSetVal, y, z);
case 2 -> new Location(world, x, y + offSetVal, z);
case 3 -> new Location(world, x, y - offSetVal, z);
case 4 -> {
Location locE = new Location(world, x, y, z + offSetVal);
yield new Location(world, x, y, z - offSetVal);
}
case 5 -> new Location(world, x + offSetVal, y, z + offSetVal);
case 6 -> new Location(world, x - offSetVal, y, z - offSetVal);
case 7 -> new Location(world, x - offSetVal, y - offSetVal, z - offSetVal);
case 8 -> new Location(world, x + offSetVal, y - offSetVal, z + offSetVal);
case 9 -> new Location(world, x - offSetVal, y + offSetVal, z - offSetVal);
default -> new Location(world, x + offSetVal, y + offSetVal, z - offSetVal);
};
}
public static void playDodgeEffect(Player player) {