2011-05-15 19:33:03 +02:00
|
|
|
package com.Acrobot.ChestShop.Protection;
|
2011-05-15 18:16:25 +02:00
|
|
|
|
|
|
|
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 {
|
2011-05-15 18:16:25 +02:00
|
|
|
public static Lockette lockette;
|
|
|
|
|
|
|
|
public boolean isProtected(Block block) {
|
|
|
|
return Lockette.isProtected(block);
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean canAccess(Player player, Block block) {
|
2011-07-23 21:00:47 +02:00
|
|
|
int length = (player.getName().length() > 15? 15 : player.getName().length());
|
|
|
|
return player.getName().substring(0, length).equals(Lockette.getProtectedOwner(block));
|
2011-05-15 18:16:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public boolean protect(String name, Block block) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|