This commit is contained in:
ZeroEpoch1969 2018-08-11 21:21:57 -07:00
parent 3895c2235e
commit d17457dbfa
No known key found for this signature in database
GPG Key ID: A7BAB4E14F089CF3
3 changed files with 25 additions and 4 deletions

View File

@ -55,8 +55,6 @@ public class WorldEditListener extends PluginListener<TotalFreedomMod>
if (event.getLimit() < 0 || event.getLimit() > 200000)
{
player.setOp(false);
FUtil.bcastMsg(event.getPlayer().getName() + " tried to set their WorldEdit limit to " + event.getLimit() + " and has been de-opped", ChatColor.RED);
event.setCancelled(true);
player.sendMessage(ChatColor.RED + "You cannot set your limit higher than 200000 or to -1!");
}

View File

@ -14,8 +14,9 @@ public class Command_gravity extends FreedomCommand
@Override
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
{
playerSender.setGravity(!playerSender.hasGravity());
msg((playerSender.hasGravity() ? "En" : "Dis") + "abled gravity.", (playerSender.hasGravity() ? ChatColor.GREEN : ChatColor.RED));
boolean enabled = !playerSender.hasGravity();
playerSender.setGravity(enabled);
msg((enabled ? "En" : "Dis") + "abled gravity.", (enabled ? ChatColor.GREEN : ChatColor.RED));
return true;
}
}

View File

@ -0,0 +1,22 @@
package me.totalfreedom.totalfreedommod.command;
import me.totalfreedom.totalfreedommod.rank.Rank;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@CommandPermissions(level = Rank.OP, source = SourceType.ONLY_IN_GAME)
@CommandParameters(description = "Toggle item pickup.", usage = "/<command>")
public class Command_togglepickup extends FreedomCommand
{
@Override
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
{
boolean enabled = !playerSender.getCanPickupItems();
playerSender.setCanPickupItems(enabled);
msg((enabled ? "En" : "Dis") + "abled item pickup.", (enabled ? ChatColor.GREEN : ChatColor.RED));
return true;
}
}