mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-30 02:05:41 +00:00
.
This commit is contained in:
parent
2bfc412e78
commit
516c21533c
@ -5,8 +5,11 @@ import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import me.totalfreedom.totalfreedommod.util.MaterialGroup;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.ShulkerBox;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
@ -99,4 +102,28 @@ public class BlockBlocker extends FreedomService
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onShulkerBoxPlace(BlockPlaceEvent event)
|
||||
{
|
||||
Block block = event.getBlock();
|
||||
if (MaterialGroup.SHULKER_BOXES.contains(event.getBlock().getType()))
|
||||
{
|
||||
ShulkerBox shulkerBox = (ShulkerBox)block.getState();
|
||||
boolean empty = true;
|
||||
for (ItemStack itemStack : shulkerBox.getInventory().getContents())
|
||||
{
|
||||
if (itemStack != null)
|
||||
{
|
||||
empty = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!empty)
|
||||
{
|
||||
shulkerBox.getInventory().clear();
|
||||
event.getPlayer().sendMessage(ChatColor.RED + "For security reasons, your shulker box has been emptied.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ public class Command_ro extends FreedomCommand
|
||||
String names = null;
|
||||
if (args[0].equalsIgnoreCase("shulker_boxes") || args[0].equalsIgnoreCase("shulkers"))
|
||||
{
|
||||
materials.addAll(MaterialGroup.SHULKER_BOX_COLORS);
|
||||
materials.addAll(MaterialGroup.SHULKER_BOXES);
|
||||
names = "shulker boxes";
|
||||
}
|
||||
else
|
||||
|
@ -1,7 +1,10 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.punishments.Punishment;
|
||||
import me.totalfreedom.totalfreedommod.punishments.PunishmentType;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.pravian.aero.util.Ips;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.GameMode;
|
||||
@ -39,6 +42,9 @@ public class Command_smite extends FreedomCommand
|
||||
}
|
||||
|
||||
smite(sender, player, reason);
|
||||
|
||||
plugin.pul.logPunishment(new Punishment(player.getName(), Ips.getIp(player), sender.getName(), PunishmentType.SMITE, reason));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Unbans a player", usage = "/<command> <username> [-r[estore]]", aliases = "pardon")
|
||||
@CommandParameters(description = "Unbans a player", usage = "/<command> <username> [-r[estore]]")
|
||||
public class Command_unban extends FreedomCommand
|
||||
{
|
||||
|
||||
|
@ -23,7 +23,7 @@ public class MaterialGroup
|
||||
Material.GRAY_WOOL,
|
||||
Material.LIGHT_GRAY_WOOL,
|
||||
Material.BLACK_WOOL);
|
||||
public static final List<Material> SHULKER_BOX_COLORS = Arrays.asList(
|
||||
public static final List<Material> SHULKER_BOXES = Arrays.asList(
|
||||
Material.WHITE_SHULKER_BOX,
|
||||
Material.RED_SHULKER_BOX,
|
||||
Material.ORANGE_SHULKER_BOX,
|
||||
|
@ -120,6 +120,7 @@ blocked_commands:
|
||||
# Disabled commands
|
||||
- 'n:b:/time:Server-side time changing is disabled. Please use /ptime to set your own personal time.'
|
||||
- 'n:b:/gamemode:Use /creative and /survival to set your gamemode.'
|
||||
- 'n:b:/pardon:_'
|
||||
- 'n:b:/ban-ip:_'
|
||||
- 'n:b:/pardon-ip:_'
|
||||
- 'n:b:/toggledownfall:_'
|
||||
|
Loading…
Reference in New Issue
Block a user