Don't allow placing banners and string. Fixes PC-333
This commit is contained in:
parent
9853ef824e
commit
9acdbd7cbe
@ -303,7 +303,28 @@ public class ClansGame extends MiniPlugin
|
||||
UtilPlayer.message(player, F.main("Clans", "You cannot place blocks in " + F.elem("Borderlands") + "."));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Banners/String
|
||||
if (player.getGameMode() != GameMode.CREATIVE && player.getItemInHand() != null)
|
||||
{
|
||||
if (player.getItemInHand().getType() == Material.BANNER || player.getItemInHand().getType() == Material.STRING)
|
||||
{
|
||||
Location destLocation = event.getClickedBlock().getRelative(event.getBlockFace()).getLocation();
|
||||
ClanTerritory territory = _clans.getClanUtility().getClaim(destLocation);
|
||||
if (territory != null)
|
||||
{
|
||||
if (territory.Owner.equals("Shops") || territory.Owner.equals("Fields") || territory.Owner.equals("Spawn") || territory.Owner.equals("Borderlands")) {
|
||||
// Disallow
|
||||
event.setCancelled(true);
|
||||
|
||||
// Inform
|
||||
UtilPlayer.message(player, F.main("Clans", "You cannot place that in " + F.elem(_clans.getClanUtility().getOwnerStringRel(destLocation, player)) + "."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ClanRelation access = _clans.getClanUtility().getAccess(player, loc);
|
||||
ClanInfo clan = _clans.getClan(player);
|
||||
ClanInfo blockClan = _clans.getClanUtility().getClaim(loc) == null ? null : _clans.getClan(_clans.getClanUtility().getClaim(loc).Owner);
|
||||
|
Loading…
Reference in New Issue
Block a user