Add settings to allow players to also build in unclaimed land
This commit is contained in:
parent
7c2ed6af7d
commit
f998e7ed28
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>com.github.judgetread</groupId>
|
<groupId>com.github.judgetread</groupId>
|
||||||
<artifactId>GriefPreventionQuickShopBridge</artifactId>
|
<artifactId>GriefPreventionQuickShopBridge</artifactId>
|
||||||
<version>1.2.0</version>
|
<version>1.3.0</version>
|
||||||
|
|
||||||
<licenses>
|
<licenses>
|
||||||
<license>
|
<license>
|
||||||
|
@ -37,9 +37,11 @@ public final class QuickShopListener implements Listener {
|
|||||||
* @param event QuickShop ShopPreCreateEvent
|
* @param event QuickShop ShopPreCreateEvent
|
||||||
*/
|
*/
|
||||||
@EventHandler(priority = EventPriority.HIGH)
|
@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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,16 +49,21 @@ public final class QuickShopListener implements Listener {
|
|||||||
final Claim claim = GriefPrevention.instance.dataStore.getClaimAt(location, false, null);
|
final Claim claim = GriefPrevention.instance.dataStore.getClaimAt(location, false, null);
|
||||||
final Player player = event.getPlayer();
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(claim == null){
|
if(!plugin.getConfig().getBoolean("allow-unclaimed-land-shops", true) && claim == null)
|
||||||
|
{
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
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);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,15 @@
|
|||||||
# Only allow shops to be created in claims that player is owner of.
|
# Only allow shops to be created in claims that player is owner of.
|
||||||
# --> If false anyone can create a shop in the any claim.
|
# --> If false anyone can create a shop in any claim.
|
||||||
only-claim-owner-can-create-shops: true
|
only-claim-owner-can-create-shops: true
|
||||||
|
|
||||||
# Ignore claim checks if player is op, allows op to create shop anywhere.
|
# Ignore claim checks if player is op, allows op to create shop anywhere.
|
||||||
op-bypass-claim-checks: true
|
op-bypass-claim-checks: true
|
||||||
|
|
||||||
# Delete shops inside a claim if that claim is deleted/removed
|
# Delete shops inside a claim if that claim is deleted/removed
|
||||||
delete-shops-when-claims-deleted: true
|
delete-shops-when-claims-deleted: false
|
||||||
|
|
||||||
# Delete shops inside a claim if that claim expires
|
# Delete shops inside a claim if that claim expires
|
||||||
delete-shops-when-claims-expires: true
|
delete-shops-when-claims-expires: false
|
||||||
|
|
||||||
|
# Allows players to make shops anywhere EXCEPT other player's claims, so even in unclaimed land
|
||||||
|
allow-unclaimed-land-shops: true
|
Loading…
Reference in New Issue
Block a user