ChestShop-3/com/Acrobot/ChestShop/Protection/Plugins/LockettePlugin.java
Acrobot dc4d9961c1 - Fancy sign formatting :D
- Fixed LWC, Lockette and Default protections
- Added restricted signs (Changed how they work)
- Added an option to use another name
- Fixed a bug where default protection was initialized too many times
- Disallowed players to place another chest near a shop chest
- Speeded up and fixed enchantment and durability in itemstacks
- Changed /iteminfo a bit
- Added /chestshop reload
- Added many default permission kits
- Fixed dye colors
- Added an option to allow towny residents place shops in their town
2012-01-09 22:39:38 +01:00

29 lines
817 B
Java

package com.Acrobot.ChestShop.Protection.Plugins;
import com.Acrobot.ChestShop.Protection.Protection;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.yi.acru.bukkit.Lockette.Lockette;
/**
* @author Acrobot
*/
public class LockettePlugin implements Protection {
public static Lockette lockette;
public boolean isProtected(Block block) {
return Lockette.isProtected(block);
}
public boolean canAccess(Player player, Block block) {
String pName = player.getName();
int length = (pName.length() > 15 ? 15 : pName.length());
String owner = Lockette.getProtectedOwner(block);
return owner == null || pName.substring(0, length).equals(owner);
}
public boolean protect(String name, Block block) {
return false;
}
}