mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-11-27 20:46:31 +01:00
c64627205e
- Speeded it up - Added Buy/Sell specified ID permission - Removed EXCLUDE_ITEM permission - just use normal Permission negating - Doesn't add more LWC's on an already protected block - Updated Register - Added option to turn off messages
34 lines
978 B
Java
34 lines
978 B
Java
package com.Acrobot.ChestShop.Protection;
|
|
|
|
import com.Acrobot.ChestShop.Utils.uBlock;
|
|
import com.Acrobot.ChestShop.Utils.uLongName;
|
|
import org.bukkit.block.Block;
|
|
import org.bukkit.block.Sign;
|
|
import org.bukkit.entity.Player;
|
|
|
|
/**
|
|
* @author Acrobot
|
|
*/
|
|
public class Security {
|
|
public static Protection protection = new Default();
|
|
|
|
public static boolean protect(String name, Block block) {
|
|
return protection.protect(name, block);
|
|
}
|
|
|
|
public static boolean canAccess(Player player, Block block) {
|
|
return protection.canAccess(player, block);
|
|
}
|
|
|
|
public static boolean isProtected(Block block) {
|
|
return protection.isProtected(block);
|
|
}
|
|
|
|
public static boolean canPlaceSign(Player p, Block block) {
|
|
Sign sign = uBlock.findSign(uBlock.findChest(block).getBlock());
|
|
if (sign == null) sign = uBlock.findSign(block);
|
|
|
|
return (sign == null || sign.getLine(0).equals(uLongName.stripName(p.getName())));
|
|
}
|
|
}
|