Skip to content

Commit

Permalink
Ensure subclaim boundaries are inside parent (#590)
Browse files Browse the repository at this point in the history
Fixes GHSA-7mmh-4c9r-pf6v
  • Loading branch information
Jikoo authored and RoboMWM committed Aug 23, 2019
1 parent 6746523 commit d326f10
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/main/java/me/ryanhamshire/GriefPrevention/DataStore.java
Expand Up @@ -847,6 +847,18 @@ synchronized public CreateClaimResult createClaim(World world, int x1, int x2, i
smallz = z2;
bigz = z1;
}

if(parent != null)
{
Location lesser = parent.getLesserBoundaryCorner();
Location greater = parent.getGreaterBoundaryCorner();
if(smallx < lesser.getX() || smallz < lesser.getZ() || bigx > greater.getX() || bigz > greater.getZ())
{
result.succeeded = false;
result.claim = parent;
return result;
}
}

//creative mode claims always go to bedrock
if(GriefPrevention.instance.config_claims_worldModes.get(world) == ClaimsMode.Creative)
Expand Down

0 comments on commit d326f10

Please sign in to comment.