Fixed a Bunch of Misc stuff & Made config.yml CLEAN

This commit is contained in:
Driftay
2019-10-01 12:18:44 -04:00
parent 10f06baadc
commit a057a235b8
7 changed files with 208 additions and 200 deletions

View File

@@ -44,7 +44,7 @@ public class CmdUnban extends FCommand {
context.faction.unban(target);
context.msg(TL.COMMAND_UNBAN_UNBANNED, context.fPlayer.getName(), target.getName());
target.msg(TL.COMMAND_UNBAN_TARGET, context.faction.getTag(target));
target.msg(TL.COMMAND_UNBAN_TARGET.toString(), context.faction.getTag(target));
}
@Override

View File

@@ -77,6 +77,9 @@ public class CheckTask implements Runnable {
}
faction.msg(TL.CHECK_WALLS_CHECK);
if (!Conf.useDiscordSystem) return;
String channelId = faction.getWallNotifyChannelId();
if (channelId == null) {
continue;
@@ -122,6 +125,10 @@ public class CheckTask implements Runnable {
CheckTask.bufferChecks.add(faction.getId());
}
faction.msg(TL.CHECK_BUFFERS_CHECK);
if (!Conf.useDiscordSystem) return;
String channelId = faction.getBufferNotifyChannelId();
if (channelId == null) {
continue;

View File

@@ -1,5 +1,6 @@
package com.massivecraft.factions.cmd.check;
import com.massivecraft.factions.Conf;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.Factions;
import com.massivecraft.factions.FactionsPlugin;
@@ -24,9 +25,9 @@ public class WeeWooTask implements Runnable {
continue;
}
faction.msg(TL.WEE_WOO_MESSAGE);
if (!FactionChatHandler.jda.getStatus().equals(JDA.Status.CONNECTED)) {
continue;
}
if (!Conf.useDiscordSystem) return;
String discordChannelId = faction.getWeeWooChannelId();
if (discordChannelId == null || discordChannelId.isEmpty()) {
continue;

View File

@@ -115,16 +115,16 @@ public class CmdTnt extends FCommand {
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.sendMessage(TL.COMMAND_TNT_AMOUNT.toString().replace("{amount}", context.faction.getTnt() + "").replace("{bankSize}", context.faction.getTntBankLimit() + ""));
context.msg(TL.COMMAND_TNT_AMOUNT, context.faction.getTnt(), context.faction.getTntBankLimit());
}
public boolean inventoryContains(Inventory inventory, ItemStack item) {
int count = 0;
ItemStack[] items = inventory.getContents();
for (int i = 0; i < items.length; i++) {
if (items[i] != null && items[i].getType() == item.getType() && items[i].getDurability() == item.getDurability()) {
count += items[i].getAmount();
for (ItemStack item1 : items) {
if (item1 != null && item1.getType() == item.getType() && item1.getDurability() == item.getDurability()) {
count += item1.getAmount();
}
if (count >= item.getAmount()) {
return true;

View File

@@ -805,7 +805,7 @@ public abstract class MemoryFPlayer implements FPlayer {
int factionBuffer = FactionsPlugin.getInstance().getConfig().getInt("hcf.buffer-zone", 0);
int worldBuffer = FactionsPlugin.getInstance().getConfig().getInt("world-border.buffer", 0);
if (Conf.worldGuardChecking && Worldguard.checkForRegionsInChunk(flocation)) {
if (Conf.worldGuardChecking && Worldguard.checkForRegionsInChunk(flocation) && !this.isAdminBypassing()) {
// Checks for WorldGuard regions in the chunk attempting to be claimed
error = FactionsPlugin.getInstance().txt.parse(TL.CLAIM_PROTECTED.toString());
} else if (flocation.isOutsideWorldBorder(FactionsPlugin.getInstance().getConfig().getInt("world-border.buffer", 0))) {
@@ -1226,7 +1226,7 @@ public abstract class MemoryFPlayer implements FPlayer {
}
LandClaimEvent claimEvent = new LandClaimEvent(flocation, forFaction, this);
Bukkit.getScheduler().runTask(FactionsPlugin.getInstance(), () -> Bukkit.getPluginManager().callEvent(claimEvent));
Bukkit.getPluginManager().callEvent(claimEvent);
if (claimEvent.isCancelled()) {
return false;
}

View File

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