Improved vehicle place flag to handle boats.

This commit is contained in:
sk89q 2011-04-02 17:57:58 -07:00
parent 0821a08df2
commit 64b12f8497

View File

@ -206,11 +206,19 @@ public void handleBlockRightClick(PlayerInteractEvent event) {
}
}
if (type == Material.RAILS
&& (item.getType() == Material.MINECART || item.getType() == Material.BOAT)) {
if (type == Material.RAILS && item.getType() == Material.MINECART) {
if (!set.canBuild(localPlayer)
&& !set.allows(DefaultFlag.PLACE_VEHICLE)) {
player.sendMessage(ChatColor.DARK_RED + "You don't have permission for this area.");
player.sendMessage(ChatColor.DARK_RED + "You don't have permission to place vehicles here.");
event.setCancelled(true);
return;
}
}
if (item.getType() == Material.BOAT) {
if (!set.canBuild(localPlayer)
&& !set.allows(DefaultFlag.PLACE_VEHICLE)) {
player.sendMessage(ChatColor.DARK_RED + "You don't have permission to place vehicles here.");
event.setCancelled(true);
return;
}