Add settings to allow players to also build in unclaimed land
This commit is contained in:
@@ -37,9 +37,11 @@ public final class QuickShopListener implements Listener {
|
||||
* @param event QuickShop ShopPreCreateEvent
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public final void onPreShopEvent(@NonNull ShopPreCreateEvent event) {
|
||||
public final void onPreShopEvent(@NonNull ShopPreCreateEvent event)
|
||||
{
|
||||
|
||||
if (event.isCancelled()) {
|
||||
if (event.isCancelled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -47,16 +49,21 @@ public final class QuickShopListener implements Listener {
|
||||
final Claim claim = GriefPrevention.instance.dataStore.getClaimAt(location, false, null);
|
||||
final Player player = event.getPlayer();
|
||||
|
||||
if(plugin.getConfig().getBoolean("op-bypass-claim-checks", true) && player.isOp()){
|
||||
if(plugin.getConfig().getBoolean("op-bypass-claim-checks", true) && player.isOp())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(claim == null){
|
||||
if(!plugin.getConfig().getBoolean("allow-unclaimed-land-shops", true) && claim == null)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if(plugin.getConfig().getBoolean("only-claim-owner-can-create-shops", true) && !claim.ownerID.toString().equals(player.getUniqueId().toString())){
|
||||
if(claim != null &&
|
||||
plugin.getConfig().getBoolean("only-claim-owner-can-create-shops", true) &&
|
||||
!claim.ownerID.toString().equals(player.getUniqueId().toString()))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user