Quick Fix With Fly Check Console Spam & Properly Defined Variables In TL for TNT command

This commit is contained in:
Driftay 2019-11-22 04:55:58 -05:00
parent 0b127cbe72
commit f3b0dcdb7f
7 changed files with 8 additions and 10 deletions

View File

@ -195,7 +195,7 @@ public class FactionsPlugin extends MPlugin {
return; return;
} }
//Update their config if needed //Update their config if needed
Updater.updateIfNeeded(getConfig()); // Updater.updateIfNeeded(getConfig());
RegisteredServiceProvider<Economy> rsp = FactionsPlugin.this.getServer().getServicesManager().getRegistration(Economy.class); RegisteredServiceProvider<Economy> rsp = FactionsPlugin.this.getServer().getServicesManager().getRegistration(Economy.class);
FactionsPlugin.econ = rsp.getProvider(); FactionsPlugin.econ = rsp.getProvider();
com.massivecraft.factions.integration.Essentials.setup(); com.massivecraft.factions.integration.Essentials.setup();

View File

@ -122,7 +122,7 @@ public class CmdFly extends FCommand {
} }
return me.hasPermission(Permission.FLY.node) && (access != Access.DENY || toFac.isSystemFaction()); return me.hasPermission(Permission.FLY.node) && (access != Access.DENY || toFac.isSystemFaction());
} }
return fme.canFlyAtLocation(); return true;
} }

View File

@ -62,7 +62,7 @@ public class CmdTnt extends FCommand {
return; return;
} }
ItemStack tnt = new ItemStack(Material.TNT, amount); ItemStack tnt = new ItemStack(Material.TNT, amount);
if (context.faction.getTnt() + amount > FactionsPlugin.instance.getConfig().getInt("ftnt.Bank-Limit")) { if (context.faction.getTnt() + amount > context.faction.getTntBankLimit()) {
context.msg(TL.COMMAND_TNT_EXCEEDLIMIT); context.msg(TL.COMMAND_TNT_EXCEEDLIMIT);
return; return;
} }
@ -71,7 +71,7 @@ public class CmdTnt extends FCommand {
context.faction.addTnt(amount); context.faction.addTnt(amount);
context.msg(TL.COMMAND_TNT_DEPOSIT_SUCCESS); context.msg(TL.COMMAND_TNT_DEPOSIT_SUCCESS);
context.fPlayer.sendMessage(FactionsPlugin.instance.color(TL.COMMAND_TNT_AMOUNT.toString().replace("{amount}", context.fPlayer.getFaction().getTnt() + ""))); context.fPlayer.sendMessage(FactionsPlugin.instance.color(TL.COMMAND_TNT_AMOUNT.toString().replace("{amount}", context.faction.getTnt() + "").replace("{maxAmount}", context.faction.getTntBankLimit() + "")));
return; return;
} }
@ -113,7 +113,7 @@ public class CmdTnt extends FCommand {
context.msg(TL.GENERIC_ARGS_TOOFEW); context.msg(TL.GENERIC_ARGS_TOOFEW);
context.msg(context.args.get(0).equalsIgnoreCase("take") || context.args.get(0).equalsIgnoreCase("t") ? TL.COMMAND_TNT_TAKE_DESCRIPTION : TL.COMMAND_TNT_ADD_DESCRIPTION); context.msg(context.args.get(0).equalsIgnoreCase("take") || context.args.get(0).equalsIgnoreCase("t") ? TL.COMMAND_TNT_TAKE_DESCRIPTION : TL.COMMAND_TNT_ADD_DESCRIPTION);
} }
context.sendMessage(TL.COMMAND_TNT_AMOUNT.toString().replace("{amount}", context.faction.getTnt() + "")); context.sendMessage(TL.COMMAND_TNT_AMOUNT.toString().replace("{amount}", context.faction.getTnt() + "").replace("{maxAmount}", context.faction.getTntBankLimit() + ""));
} }

View File

@ -35,8 +35,7 @@ public class Updater {
conf.set("Randomization.Start-Item.Disallowed.Lore", lore); conf.set("Randomization.Start-Item.Disallowed.Lore", lore);
conf.set("Randomization.Start-Item.Slot", 28); conf.set("Randomization.Start-Item.Slot", 28);
conf.set("Config-Version", 1.1); conf.set("Config-Version", 1.1);
version = 1.1; currentVersion = 1.1;
} }
//End with save + reload //End with save + reload
try { try {

View File

@ -989,7 +989,7 @@ public abstract class MemoryFPlayer implements FPlayer {
} }
if (faction.isSystemFaction()) { if (faction.isSystemFaction()) {
return CmdFly.checkBypassPerms(this, this.getPlayer(), faction); return CmdFly.checkBypassPerms(this, getPlayer(), faction);
} }
Access access = faction.getAccess(this, PermissableAction.FLY); Access access = faction.getAccess(this, PermissableAction.FLY);

View File

@ -888,7 +888,7 @@ public enum TL {
COMMAND_TNT_WIDTHDRAW_SUCCESS("&cSuccessfully withdrew tnt."), COMMAND_TNT_WIDTHDRAW_SUCCESS("&cSuccessfully withdrew tnt."),
COMMAND_TNT_WIDTHDRAW_NOTENOUGH("&cNot enough tnt in bank."), COMMAND_TNT_WIDTHDRAW_NOTENOUGH("&cNot enough tnt in bank."),
COMMAND_TNT_DEPOSIT_NOTENOUGH("&cNot enough tnt in tnt inventory."), COMMAND_TNT_DEPOSIT_NOTENOUGH("&cNot enough tnt in tnt inventory."),
COMMAND_TNT_AMOUNT("&cYour faction has %1$s tnt in the tnt bank."), COMMAND_TNT_AMOUNT("&cYour faction has {amount}/{maxAmount} tnt in the tnt bank."),
COMMAND_TNT_POSITIVE("&cPlease use positive numbers!"), COMMAND_TNT_POSITIVE("&cPlease use positive numbers!"),
COMMAND_TNT_DESCRIPTION("add/widthraw from faction's tnt bank"), COMMAND_TNT_DESCRIPTION("add/widthraw from faction's tnt bank"),
COMMAND_TNT_WIDTHDRAW_NOTENOUGH_SPACE("&cNot enough space in your inventory."), COMMAND_TNT_WIDTHDRAW_NOTENOUGH_SPACE("&cNot enough space in your inventory."),

View File

@ -1331,7 +1331,6 @@ Tntfill:
max-radius: 32 max-radius: 32
max-amount: 64 max-amount: 64
############################################################ ############################################################
# +------------------------------------------------------+ # # +------------------------------------------------------+ #
# | Big List of variables | # # | Big List of variables | #