Skip to content

Commit 6ef0d58

Browse files
fix: cancel teleport to denied plot (#4650)
* chore: add 1.21.5 to runServer task, download Paper FAWE jar * fix: don't allow teleport to denied plots
1 parent fbf4a63 commit 6ef0d58

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Bukkit/src/main/java/com/plotsquared/bukkit/listener/PlayerEventListener.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,11 @@ public void onTeleport(PlayerTeleportEvent event) {
598598
// i.e. untrusted-visit can override deny-teleport
599599
// this is acceptable, because otherwise it wouldn't make sense to have both flags set
600600
if (result || (plot.getFlag(UntrustedVisitFlag.class) && plot.getHomeSynchronous().equals(BukkitUtil.adaptComplete(to)))) {
601-
plotListener.plotEntry(pp, plot);
601+
// returns false if the player is not allowed to enter the plot (if they are denied, for example)
602+
// don't let the move event cancel the entry after teleport, but rather catch and cancel early (#4647)
603+
if (!plotListener.plotEntry(pp, plot)) {
604+
event.setCancelled(true);
605+
}
602606
} else {
603607
pp.sendMessage(
604608
TranslatableCaption.of("deny.no_enter"),

build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,14 +206,14 @@ tasks.getByName<Jar>("jar") {
206206
enabled = false
207207
}
208208

209-
val supportedVersions = listOf("1.19.4", "1.20.6", "1.21.1", "1.21.3", "1.21.4")
209+
val supportedVersions = listOf("1.19.4", "1.20.6", "1.21.1", "1.21.3", "1.21.4", "1.21.5")
210210
tasks {
211211
register("cacheLatestFaweArtifact") {
212212
val lastSuccessfulBuildUrl = uri("https://ci.athion.net/job/FastAsyncWorldEdit/lastSuccessfulBuild/api/json").toURL()
213213
val artifact = ((JsonSlurper().parse(lastSuccessfulBuildUrl) as Map<*, *>)["artifacts"] as List<*>)
214214
.map { it as Map<*, *> }
215215
.map { it["fileName"] as String }
216-
.first { it -> it.contains("Bukkit") }
216+
.first { it -> it.contains("Paper") }
217217
project.ext["faweArtifact"] = artifact
218218
}
219219

0 commit comments

Comments
 (0)