Made F Stuck Toggleable

This commit is contained in:
Driftay 2020-03-23 16:11:54 -04:00
parent 323dce1c4f
commit 606e82c890
5 changed files with 13 additions and 2 deletions

View File

@ -111,6 +111,7 @@ public class CmdDisband extends FCommand {
} else { } else {
context.player.sendMessage(String.valueOf(TL.COMMAND_DISBAND_PLAYER)); context.player.sendMessage(String.valueOf(TL.COMMAND_DISBAND_PLAYER));
} }
Bukkit.broadcastMessage("Called");
faction.disband(context.player, PlayerDisbandReason.COMMAND); faction.disband(context.player, PlayerDisbandReason.COMMAND);
if (!context.fPlayer.canFlyAtLocation() && FactionsPlugin.getInstance().getConfig().getBoolean("enable-faction-flight")) { if (!context.fPlayer.canFlyAtLocation() && FactionsPlugin.getInstance().getConfig().getBoolean("enable-faction-flight")) {
context.fPlayer.setFFlying(false, false); context.fPlayer.setFFlying(false, false);

View File

@ -21,7 +21,8 @@ public class CmdLeave extends FCommand {
@Override @Override
public void perform(CommandContext context) { public void perform(CommandContext context) {
context.fPlayer.leave(true);
context.fPlayer.leave(true);
} }
@Override @Override

View File

@ -35,6 +35,14 @@ public class CmdStuck extends FCommand {
final long delay = FactionsPlugin.getInstance().getConfig().getLong("hcf.stuck.delay", 30); final long delay = FactionsPlugin.getInstance().getConfig().getLong("hcf.stuck.delay", 30);
final int radius = FactionsPlugin.getInstance().getConfig().getInt("hcf.stuck.radius", 10); final int radius = FactionsPlugin.getInstance().getConfig().getInt("hcf.stuck.radius", 10);
if (!FactionsPlugin.getInstance().getConfig().getBoolean("hcf.stuck.Enabled", false)) {
context.msg(TL.GENERIC_DISABLED, "Factions Stuck");
return;
}
if (FactionsPlugin.getInstance().getStuckMap().containsKey(player.getUniqueId())) { if (FactionsPlugin.getInstance().getStuckMap().containsKey(player.getUniqueId())) {
long wait = FactionsPlugin.getInstance().getTimers().get(player.getUniqueId()) - System.currentTimeMillis(); long wait = FactionsPlugin.getInstance().getTimers().get(player.getUniqueId()) - System.currentTimeMillis();
String time = DurationFormatUtils.formatDuration(wait, TL.COMMAND_STUCK_TIMEFORMAT.toString(), true); String time = DurationFormatUtils.formatDuration(wait, TL.COMMAND_STUCK_TIMEFORMAT.toString(), true);

View File

@ -820,7 +820,7 @@ public class FactionsPlayerListener implements Listener {
Material type; Material type;
if (event.getItem() != null) { if (event.getItem() != null) {
// Convert 1.8 Material Names -> 1.14 // Convert 1.8 Material Names -> 1.15
type = XMaterial.matchXMaterial(event.getItem().getType().toString()).get().parseMaterial(); type = XMaterial.matchXMaterial(event.getItem().getType().toString()).get().parseMaterial();
} else { } else {
type = null; type = null;

View File

@ -260,6 +260,7 @@ hcf:
buffer-zone: 0 buffer-zone: 0
stuck: stuck:
Enabled: false
delay: 30 delay: 30
radius: 10 radius: 10