ChestShop-3/com/Acrobot/ChestShop/Protection/Plugins/LockettePlugin.java

29 lines
817 B
Java
Raw Normal View History

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
*/
2011-05-29 13:25:25 +02:00
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;
}
}