Removed Towny protection hook.

This commit is contained in:
Fernando Pettinelli 2021-01-22 14:32:44 -03:00 committed by Brianna
parent 6374c7181c
commit 96249b1c2f
2 changed files with 0 additions and 39 deletions

View File

@ -44,7 +44,6 @@ public final class PluginHook<T extends Class> {
public static final PluginHook PROTECTION_LANDS = new PluginHook(Protection.class, "Lands", LandsProtection.class);
public static final PluginHook PROTECTION_REDPROTECT = new PluginHook(Protection.class, "RedProtect", RedProtectProtection.class);
public static final PluginHook PROTECTION_ULTIMATECLAIMS = new PluginHook(Protection.class, "UltimateClaims", UltimateClaimsProtection.class);
public static final PluginHook PROTECTION_TOWNY = new PluginHook(Protection.class, "Towny", TownyProtection.class);
public static final PluginHook PROTECTION_BENTOBOX = new PluginHook(Protection.class, "BentoBox", BentoBoxProtection.class);
/******* Start Manager stuff *******/

View File

@ -1,38 +0,0 @@
package com.songoda.core.hooks.protection;
import com.palmergames.bukkit.towny.object.TownyPermission;
import com.palmergames.bukkit.towny.utils.PlayerCacheUtil;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
public class TownyProtection extends Protection {
public TownyProtection(Plugin plugin) {
super(plugin);
}
@Override
public boolean canPlace(Player player, Location location) {
return PlayerCacheUtil.getCachePermission(player, location, location.getBlock().getType(), TownyPermission.ActionType.BUILD);
}
@Override
public boolean canBreak(Player player, Location location) {
return PlayerCacheUtil.getCachePermission(player, location, location.getBlock().getType(), TownyPermission.ActionType.DESTROY);
}
@Override
public boolean canInteract(Player player, Location location) {
return PlayerCacheUtil.getCachePermission(player, location, location.getBlock().getType(), TownyPermission.ActionType.SWITCH);
}
@Override
public String getName() {
return "Towny";
}
@Override
public boolean isEnabled() {
return true;
}
}