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;