mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-12-05 00:03:29 +01:00
a84c68d49d
- Added support for Deadbolt - By default, left clicking your own sign doesn't do anything - Restricted signs now check if you've got permission ChestShop.group.groupName - Added support for stacking unstackable things - Updated Register - Changed how plugins are loaded.
27 lines
752 B
Java
27 lines
752 B
Java
package com.Acrobot.ChestShop.Protection.Plugins;
|
|
|
|
import com.Acrobot.ChestShop.Protection.Protection;
|
|
import com.daemitus.deadbolt.Deadbolt;
|
|
import org.bukkit.block.Block;
|
|
import org.bukkit.entity.Player;
|
|
|
|
/**
|
|
* @author Acrobot
|
|
*/
|
|
public class DeadboltPlugin implements Protection {
|
|
public static Deadbolt deadbolt;
|
|
|
|
public boolean isProtected(Block block) {
|
|
return Deadbolt.isProtected(block);
|
|
}
|
|
|
|
public boolean canAccess(Player player, Block block) {
|
|
int length = (player.getName().length() > 15 ? 15 : player.getName().length());
|
|
return Deadbolt.getAllNames(block).contains(player.getName().substring(0, length));
|
|
}
|
|
|
|
public boolean protect(String name, Block block) {
|
|
return false;
|
|
}
|
|
}
|