Fixed /f reload issue, with /f perms

This commit is contained in:
ProSavage 2019-01-06 21:04:38 -06:00
parent 909c2b9a9f
commit 7ecc09f64d
2 changed files with 49 additions and 47 deletions

View File

@ -358,7 +358,7 @@ public class SavageFactions extends MPlugin {
} }
} }
private void changeItemIDSInConfig() { public void changeItemIDSInConfig() {
log("Starting conversion of legacy material in config to 1.13 materials."); log("Starting conversion of legacy material in config to 1.13 materials.");
replaceStringInConfig("fperm-gui.relation.materials.recruit", "WOOD_SWORD", "WOODEN_SWORD"); replaceStringInConfig("fperm-gui.relation.materials.recruit", "WOOD_SWORD", "WOODEN_SWORD");

View File

@ -1,46 +1,48 @@
package com.massivecraft.factions.cmd; package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Conf; import com.massivecraft.factions.Conf;
import com.massivecraft.factions.SavageFactions; import com.massivecraft.factions.SavageFactions;
import com.massivecraft.factions.struct.Permission; import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.util.Particles.ReflectionUtils; import com.massivecraft.factions.util.Particles.ReflectionUtils;
import com.massivecraft.factions.zcore.util.TL; import com.massivecraft.factions.zcore.util.TL;
public class CmdReload extends FCommand { public class CmdReload extends FCommand {
public CmdReload() { public CmdReload() {
super(); super();
this.aliases.add("reload"); this.aliases.add("reload");
this.permission = Permission.RELOAD.node; this.permission = Permission.RELOAD.node;
this.disableOnLock = false; this.disableOnLock = false;
senderMustBePlayer = false; senderMustBePlayer = false;
senderMustBeMember = false; senderMustBeMember = false;
senderMustBeModerator = false; senderMustBeModerator = false;
senderMustBeColeader = false; senderMustBeColeader = false;
senderMustBeAdmin = false; senderMustBeAdmin = false;
} }
@Override @Override
public void perform() { public void perform() {
long timeInitStart = System.currentTimeMillis(); long timeInitStart = System.currentTimeMillis();
Conf.load(); Conf.load();
SavageFactions.plugin.reloadConfig(); Conf.save();
SavageFactions.plugin.loadLang(); SavageFactions.plugin.reloadConfig();
int version = Integer.parseInt(ReflectionUtils.PackageType.getServerVersion().split("_")[1]); SavageFactions.plugin.changeItemIDSInConfig();
SavageFactions.plugin.loadLang();
int version = Integer.parseInt(ReflectionUtils.PackageType.getServerVersion().split("_")[1]);
if (SavageFactions.plugin.getConfig().getBoolean("enable-faction-flight")) {
SavageFactions.plugin.factionsFlight = true;
} if (SavageFactions.plugin.getConfig().getBoolean("enable-faction-flight")) {
long timeReload = (System.currentTimeMillis() - timeInitStart); SavageFactions.plugin.factionsFlight = true;
}
msg(TL.COMMAND_RELOAD_TIME, timeReload); long timeReload = (System.currentTimeMillis() - timeInitStart);
}
msg(TL.COMMAND_RELOAD_TIME, timeReload);
@Override }
public TL getUsageTranslation() {
return TL.COMMAND_RELOAD_DESCRIPTION; @Override
} public TL getUsageTranslation() {
} return TL.COMMAND_RELOAD_DESCRIPTION;
}
}