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

34 lines
879 B
Java
Raw Normal View History

package com.Acrobot.ChestShop.Protection.Plugins;
import com.Acrobot.ChestShop.Protection.Protection;
2012-04-19 15:50:53 +02:00
import com.Acrobot.ChestShop.Utils.uLongName;
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 {
2012-04-19 15:50:53 +02:00
public Lockette lockette;
public LockettePlugin(Lockette lockette) {
this.lockette = lockette;
}
public boolean isProtected(Block block) {
return Lockette.isProtected(block);
}
public boolean canAccess(Player player, Block block) {
String pName = player.getName();
2012-04-19 15:50:53 +02:00
String owner = Lockette.getProtectedOwner(block);
2012-04-19 15:50:53 +02:00
return owner == null || owner.equals(uLongName.stripName(pName));
}
public boolean protect(String name, Block block) {
return false;
}
}