mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-12-20 23:37:36 +01:00
dc4d9961c1
- Fixed LWC, Lockette and Default protections - Added restricted signs (Changed how they work) - Added an option to use another name - Fixed a bug where default protection was initialized too many times - Disallowed players to place another chest near a shop chest - Speeded up and fixed enchantment and durability in itemstacks - Changed /iteminfo a bit - Added /chestshop reload - Added many default permission kits - Fixed dye colors - Added an option to allow towny residents place shops in their town
29 lines
817 B
Java
29 lines
817 B
Java
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
|
|
*/
|
|
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;
|
|
}
|
|
}
|