ChestShop-3/com/Acrobot/ChestShop/Protection/LockettePlugin.java
Acrobot 7b6d7d59bd - Long name (>15 chars) support
- Added Bukkit Persistence Reimplemented by LennardF1989
- Made the plugin faster
- Deleted unnecessary files (.jar size went down by 10 KB)
- Added final and private keywords
- Support for Bukkit's built-in permissions
- Updated to newest Bukkit's standard (getFace -> getRelative)
2011-07-23 21:00:47 +02:00

26 lines
701 B
Java

package com.Acrobot.ChestShop.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) {
int length = (player.getName().length() > 15? 15 : player.getName().length());
return player.getName().substring(0, length).equals(Lockette.getProtectedOwner(block));
}
public boolean protect(String name, Block block) {
return false;
}
}