Add villager-interact flag

This commit is contained in:
Jesse Boyd 2016-09-09 15:17:37 +10:00
parent 85ff8bf639
commit a95b68b73c
2 changed files with 5 additions and 0 deletions

View File

@ -65,6 +65,7 @@ import org.bukkit.entity.TNTPrimed;
import org.bukkit.entity.Tameable;
import org.bukkit.entity.ThrownPotion;
import org.bukkit.entity.Vehicle;
import org.bukkit.entity.Villager;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
@ -1966,6 +1967,9 @@ public class PlayerEvents extends PlotListener implements Listener {
if (entity instanceof Player && plot.getFlag(Flags.PLAYER_INTERACT, false)) {
return;
}
if (entity instanceof Villager && plot.getFlag(Flags.VILLAGER_INTERACT, false)) {
return;
}
if (!Permissions.hasPermission(pp, C.PERMISSION_ADMIN_INTERACT_OTHER)) {
MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_INTERACT_OTHER);
event.setCancelled(true);

View File

@ -68,6 +68,7 @@ public final class Flags {
public static final BooleanFlag MISC_PLACE = new BooleanFlag("misc-place");
public static final BooleanFlag MISC_BREAK = new BooleanFlag("misc-break");
public static final BooleanFlag MISC_INTERACT = new BooleanFlag("misc-interact");
public static final BooleanFlag VILLAGER_INTERACT = new BooleanFlag("villager-interact");
public static final BooleanFlag PLAYER_INTERACT = new BooleanFlag("player-interact");
public static final BooleanFlag TAMED_ATTACK = new BooleanFlag("tamed-attack");
public static final BooleanFlag TAMED_INTERACT = new BooleanFlag("tamed-interact");