Skip to content

Commit

Permalink
Prevent out of world claims (#4475)
Browse files Browse the repository at this point in the history
* Prevent out of world claims

* update java version in workflows
  • Loading branch information
SirYwell authored Aug 13, 2024
1 parent 1ebcbf6 commit bbb3736
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
java-version: 21
- name: Clean Build
run: ./gradlew clean build
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
java-version: 21
- name: Clean Build
run: ./gradlew clean build
- name: Determine release status
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
java-version: 21
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
Expand Down
3 changes: 3 additions & 0 deletions Core/src/main/java/com/plotsquared/core/plot/Plot.java
Original file line number Diff line number Diff line change
Expand Up @@ -2182,6 +2182,9 @@ public BlockLoc getPosition() {
* @return if the given player can claim the plot
*/
public boolean canClaim(@NonNull PlotPlayer<?> player) {
if (!WorldUtil.isValidLocation(getBottomAbs())) {
return false;
}
PlotCluster cluster = this.getCluster();
if (cluster != null) {
if (!cluster.isAdded(player.getUUID()) && !player.hasPermission("plots.admin.command.claim")) {
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ subprojects {

plugins.withId("java") {
the<JavaPluginExtension>().toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
languageVersion.set(JavaLanguageVersion.of(21))
}
}

Expand Down

0 comments on commit bbb3736

Please sign in to comment.