2011-09-01 18:59:15 +02:00
|
|
|
package com.Acrobot.ChestShop.Protection.Plugins;
|
2011-05-15 18:16:25 +02:00
|
|
|
|
2011-09-01 18:59:15 +02:00
|
|
|
import com.Acrobot.ChestShop.Protection.Protection;
|
2011-09-06 19:01:57 +02:00
|
|
|
import com.daemitus.deadbolt.Deadbolt;
|
2011-05-15 18:16:25 +02:00
|
|
|
import org.bukkit.block.Block;
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Acrobot
|
|
|
|
*/
|
2011-09-06 19:01:57 +02:00
|
|
|
public class DeadboltPlugin implements Protection {
|
2011-05-15 18:16:25 +02:00
|
|
|
public boolean isProtected(Block block) {
|
2011-09-06 19:01:57 +02:00
|
|
|
return Deadbolt.isProtected(block);
|
2011-05-15 18:16:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public boolean canAccess(Player player, Block block) {
|
2011-09-06 19:01:57 +02:00
|
|
|
int length = (player.getName().length() > 15 ? 15 : player.getName().length());
|
|
|
|
return Deadbolt.getAllNames(block).contains(player.getName().substring(0, length));
|
2011-05-15 18:16:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public boolean protect(String name, Block block) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|