Wire up party config pt 4

This commit is contained in:
nossr50
2019-03-17 04:24:32 -07:00
parent 8a6ed2f076
commit 80df1dd4bd
13 changed files with 36 additions and 253 deletions

View File

@@ -1,8 +1,8 @@
package com.gmail.nossr50.commands.party.teleport;
import com.gmail.nossr50.config.MainConfig;
import com.gmail.nossr50.datatypes.party.PartyTeleportRecord;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.skills.SkillUtils;
@@ -28,7 +28,7 @@ public class PtpAcceptCommand implements CommandExecutor {
return true;
}
if (SkillUtils.cooldownExpired(ptpRecord.getTimeout(), MainConfig.getInstance().getPTPCommandTimeout())) {
if (SkillUtils.cooldownExpired(ptpRecord.getTimeout(), mcMMO.getConfigManager().getConfigParty().getPTP().getPtpRequestTimeout())) {
ptpRecord.removeRequest();
player.sendMessage(LocaleLoader.getString("Commands.ptp.RequestExpired"));
return true;
@@ -41,7 +41,7 @@ public class PtpAcceptCommand implements CommandExecutor {
return true;
}
if (MainConfig.getInstance().getPTPCommandWorldPermissions()) {
if (mcMMO.getConfigManager().getConfigParty().getPTP().isPtpWorldBasedPermissions()) {
World targetWorld = target.getWorld();
World playerWorld = player.getWorld();

View File

@@ -1,6 +1,5 @@
package com.gmail.nossr50.commands.party.teleport;
import com.gmail.nossr50.config.MainConfig;
import com.gmail.nossr50.config.WorldBlacklist;
import com.gmail.nossr50.datatypes.party.Party;
import com.gmail.nossr50.datatypes.party.PartyFeature;
@@ -84,7 +83,7 @@ public class PtpCommand implements TabExecutor {
}
long recentlyHurt = mcMMOPlayer.getRecentlyHurt();
int hurtCooldown = MainConfig.getInstance().getPTPCommandRecentlyHurtCooldown();
int hurtCooldown = mcMMO.getConfigManager().getConfigParty().getPTP().getPtpRecentlyHurtCooldown();
if (hurtCooldown > 0) {
int timeRemaining = SkillUtils.calculateTimeLeft(recentlyHurt * Misc.TIME_CONVERSION_FACTOR, hurtCooldown, player);
@@ -104,7 +103,7 @@ public class PtpCommand implements TabExecutor {
return true;
}
int ptpCooldown = MainConfig.getInstance().getPTPCommandCooldown();
int ptpCooldown = mcMMO.getConfigManager().getConfigParty().getPTP().getPtpCooldown();
long ptpLastUse = mcMMOPlayer.getPartyTeleportRecord().getLastUse();
if (ptpCooldown > 0) {
@@ -169,7 +168,7 @@ public class PtpCommand implements TabExecutor {
player.sendMessage(LocaleLoader.getString("Commands.Invite.Success"));
target.sendMessage(LocaleLoader.getString("Commands.ptp.Request1", player.getName()));
target.sendMessage(LocaleLoader.getString("Commands.ptp.Request2", MainConfig.getInstance().getPTPCommandTimeout()));
target.sendMessage(LocaleLoader.getString("Commands.ptp.Request2", mcMMO.getConfigManager().getConfigParty().getPTP().getPtpRequestTimeout()));
}
protected static boolean canTeleport(CommandSender sender, Player player, String targetName) {
@@ -208,7 +207,7 @@ public class PtpCommand implements TabExecutor {
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(teleportingPlayer);
McMMOPlayer mcMMOTarget = UserManager.getPlayer(targetPlayer);
long warmup = MainConfig.getInstance().getPTPCommandWarmup();
long warmup = mcMMO.getConfigManager().getConfigParty().getPTP().getPtpWarmup();
mcMMOPlayer.actualizeTeleportCommenceLocation(teleportingPlayer);