mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-27 11:14:44 +02:00
Assorted cleanup.
This commit is contained in:
@ -23,7 +23,7 @@ public class McremoveCommand implements TabExecutor {
|
||||
case 1:
|
||||
String playerName = CommandUtils.getMatchedPlayerName(args[0]);
|
||||
|
||||
if (UserManager.getPlayer(playerName, true) == null && CommandUtils.unloadedProfile(sender, mcMMO.getDatabaseManager().loadPlayerProfile(playerName, false))) {
|
||||
if (UserManager.getOfflinePlayer(playerName) == null && CommandUtils.unloadedProfile(sender, mcMMO.getDatabaseManager().loadPlayerProfile(playerName, false))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -68,7 +68,7 @@ public abstract class ExperienceCommand implements TabExecutor {
|
||||
int value = Integer.parseInt(args[2]);
|
||||
|
||||
String playerName = CommandUtils.getMatchedPlayerName(args[0]);
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(playerName, true);
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getOfflinePlayer(playerName);
|
||||
|
||||
// If the mcMMOPlayer doesn't exist, create a temporary profile and check if it's present in the database. If it's not, abort the process.
|
||||
if (mcMMOPlayer == null) {
|
||||
|
@ -66,7 +66,7 @@ public class SkillresetCommand implements TabExecutor {
|
||||
}
|
||||
|
||||
String playerName = CommandUtils.getMatchedPlayerName(args[0]);
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(playerName, true);
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getOfflinePlayer(playerName);
|
||||
|
||||
// If the mcMMOPlayer doesn't exist, create a temporary profile and check if it's present in the database. If it's not, abort the process.
|
||||
if (mcMMOPlayer == null) {
|
||||
|
@ -18,7 +18,7 @@ public class PartyInviteCommand implements CommandExecutor {
|
||||
switch (args.length) {
|
||||
case 2:
|
||||
String targetName = CommandUtils.getMatchedPlayerName(args[1]);
|
||||
McMMOPlayer mcMMOTarget = UserManager.getPlayer(targetName, true);
|
||||
McMMOPlayer mcMMOTarget = UserManager.getOfflinePlayer(targetName);
|
||||
|
||||
if (!CommandUtils.checkPlayerExistence(sender, targetName, mcMMOTarget)) {
|
||||
return false;
|
||||
|
@ -18,7 +18,7 @@ public class PartyAllianceInviteCommand implements CommandExecutor {
|
||||
switch (args.length) {
|
||||
case 3:
|
||||
String targetName = CommandUtils.getMatchedPlayerName(args[2]);
|
||||
McMMOPlayer mcMMOTarget = UserManager.getPlayer(targetName, true);
|
||||
McMMOPlayer mcMMOTarget = UserManager.getOfflinePlayer(targetName);
|
||||
|
||||
if (!CommandUtils.checkPlayerExistence(sender, targetName, mcMMOTarget)) {
|
||||
return false;
|
||||
|
@ -29,7 +29,7 @@ public class InspectCommand implements TabExecutor {
|
||||
switch (args.length) {
|
||||
case 1:
|
||||
String playerName = CommandUtils.getMatchedPlayerName(args[0]);
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(playerName, true);
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getOfflinePlayer(playerName);
|
||||
|
||||
// If the mcMMOPlayer doesn't exist, create a temporary profile and check if it's present in the database. If it's not, abort the process.
|
||||
if (mcMMOPlayer == null) {
|
||||
|
@ -47,7 +47,7 @@ public class McrankCommand implements TabExecutor {
|
||||
}
|
||||
|
||||
String playerName = CommandUtils.getMatchedPlayerName(args[0]);
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(playerName, true);
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getOfflinePlayer(playerName);
|
||||
|
||||
if (mcMMOPlayer != null) {
|
||||
Player player = mcMMOPlayer.getPlayer();
|
||||
|
@ -51,7 +51,6 @@ public class FishingCommand extends SkillCommand {
|
||||
@Override
|
||||
protected void dataCalculations(Player player, float skillValue, boolean isLucky) {
|
||||
FishingManager fishingManager = UserManager.getPlayer(player).getFishingManager();
|
||||
boolean isStorming = player.getWorld().hasStorm();
|
||||
|
||||
// TREASURE HUNTER
|
||||
if (canTreasureHunt) {
|
||||
@ -70,7 +69,7 @@ public class FishingCommand extends SkillCommand {
|
||||
double totalEnchantChance = 0;
|
||||
|
||||
for (Rarity rarity : Rarity.values()) {
|
||||
if (rarity != Rarity.TRAP || rarity != Rarity.RECORD) {
|
||||
if (rarity != Rarity.TRAP && rarity != Rarity.RECORD) {
|
||||
totalEnchantChance += TreasureConfig.getInstance().getEnchantmentDropRate(lootTier, rarity);
|
||||
}
|
||||
}
|
||||
@ -92,7 +91,7 @@ public class FishingCommand extends SkillCommand {
|
||||
|
||||
// MASTER ANGLER
|
||||
if (canMasterAngler) {
|
||||
double rawBiteChance = 1.0 / (isStorming ? 300 : 500);
|
||||
double rawBiteChance = 1.0 / (player.getWorld().hasStorm() ? 300 : 500);
|
||||
Location location = fishingManager.getHookLocation();
|
||||
|
||||
if (location == null) {
|
||||
|
Reference in New Issue
Block a user