More improvements. (#15)

* This is rediculous

* Forgot some final and this

* Fixed and improved skull caging

* Windows wanted this yeah
This commit is contained in:
Seth
2017-12-31 20:43:10 -07:00
committed by Lemon
parent d9d1d4fa9b
commit 059bf14d90
16 changed files with 381 additions and 278 deletions

View File

@ -182,7 +182,7 @@ public class EventBlocker extends FreedomService
}
@EventHandler(priority = EventPriority.HIGH)
public void FireworkExplodeEvent(final FireworkExplodeEvent event
public void onFireworkExplode(final FireworkExplodeEvent event
)
{
if (!ConfigEntry.ALLOW_FIREWORK_EXPLOSION.getBoolean())
@ -192,7 +192,7 @@ public class EventBlocker extends FreedomService
}
@EventHandler(priority = EventPriority.HIGH)
public void BlockPistonRetractEvent(final BlockPistonRetractEvent event)
public void onBlockPistonRetract(BlockPistonRetractEvent event)
{
if (!ConfigEntry.ALLOW_REDSTONE.getBoolean())
{
@ -201,7 +201,7 @@ public class EventBlocker extends FreedomService
}
@EventHandler(priority = EventPriority.HIGH)
public void BlockPistonExtendEvent(final BlockPistonExtendEvent event)
public void onBlockPistonExtend(BlockPistonExtendEvent event)
{
if (!ConfigEntry.ALLOW_REDSTONE.getBoolean())
{
@ -210,7 +210,7 @@ public class EventBlocker extends FreedomService
}
@EventHandler(priority = EventPriority.HIGH)
public void BlockRedstoneEvent(final BlockRedstoneEvent event)
public void onBlockRedstone(BlockRedstoneEvent event)
{
if (!ConfigEntry.ALLOW_REDSTONE.getBoolean())
{

View File

@ -49,18 +49,21 @@ public class SignBlocker extends FreedomService
String line2 = bet.getString("Text2");
String line3 = bet.getString("Text3");
String line4 = bet.getString("Text4");
if(line1.contains("run_command") || line2.contains("run_command") || line3.contains("run_command") || line4.contains("run_command"))
if (line1.contains("run_command") || line2.contains("run_command") || line3.contains("run_command") || line4.contains("run_command"))
{
player.sendMessage(ChatColor.GRAY + "You are not allowed to place command signs.");
event.setCancelled(true);
}
}
}
@EventHandler(priority = EventPriority.LOWEST)
public void onPlayerInteractSign(PlayerInteractEvent event)
{
if(event.getAction() != Action.RIGHT_CLICK_BLOCK)
return;
if (event.getAction() != Action.RIGHT_CLICK_BLOCK)
{
return;
}
if (event.getClickedBlock() != null && event.getClickedBlock().getType().equals(Material.SIGN) || event.getClickedBlock().getType().equals(Material.SIGN_POST) || event.getClickedBlock().getType().equals(Material.WALL_SIGN))
{

View File

@ -21,11 +21,13 @@ public class CommandBlockerEntry
@Getter
private final String message;
public CommandBlockerEntry(final CommandBlockerRank rank, final CommandBlockerAction action, final String command, final String message) {
public CommandBlockerEntry(CommandBlockerRank rank, CommandBlockerAction action, String command, String message)
{
this(rank, action, command, null, message);
}
public CommandBlockerEntry(final CommandBlockerRank rank, final CommandBlockerAction action, final String command, final String subCommand, final String message) {
public CommandBlockerEntry(CommandBlockerRank rank, CommandBlockerAction action, String command, String subCommand, String message)
{
this.rank = rank;
this.action = action;
this.command = command;
@ -33,36 +35,44 @@ public class CommandBlockerEntry
this.message = ((message == null || message.equals("_")) ? "That command is blocked." : message);
}
public void doActions(final CommandSender sender) {
if (this.action == CommandBlockerAction.BLOCK_AND_EJECT && sender instanceof Player) {
TotalFreedomMod.plugin().ae.autoEject((Player)sender, "You used a prohibited command: " + this.command);
public void doActions(CommandSender sender)
{
if (action == CommandBlockerAction.BLOCK_AND_EJECT && sender instanceof Player)
{
TotalFreedomMod.plugin().ae.autoEject((Player)sender, "You used a prohibited command: " + command);
FUtil.bcastMsg(sender.getName() + " was automatically kicked for using harmful commands.", ChatColor.RED);
return;
}
if (this.action == CommandBlockerAction.BLOCK_UNKNOWN) {
FUtil.playerMsg(sender, "Unknown command. Type \"help\" for help.", ChatColor.RESET);
if (action == CommandBlockerAction.BLOCK_UNKNOWN)
{
FUtil.playerMsg(sender, "Unknown command. Type \"/help\" for help.", ChatColor.RESET);
return;
}
FUtil.playerMsg(sender, FUtil.colorize(this.message));
FUtil.playerMsg(sender, FUtil.colorize(message));
}
public CommandBlockerRank getRank() {
return this.rank;
public CommandBlockerRank getRank()
{
return rank;
}
public CommandBlockerAction getAction() {
return this.action;
public CommandBlockerAction getAction()
{
return action;
}
public String getCommand() {
return this.command;
public String getCommand()
{
return command;
}
public String getSubCommand() {
return this.subCommand;
public String getSubCommand()
{
return subCommand;
}
public String getMessage() {
return this.message;
public String getMessage()
{
return message;
}
}