mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-25 02:04:44 +02:00
spring-cleaning, update all the dependencies
This commit is contained in:
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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.");
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
@ -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++;
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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");
|
||||
|
@ -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");
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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) {
|
||||
|
Reference in New Issue
Block a user