Skip to content
Permalink
Browse files

List is not a valid cause. Each element is its own cause.

Fixes WORLDGUARD-4140.

Specifically, fixes not being able to break lilypads while in a boat,
even through the player would normally be able to.

Note that slowdown is client-side and getting stuck is due to Spigot
not updating the client when the break is cancelled, which are unrelated
to this issue (and not fixable by us).
  • Loading branch information...
wizjany committed Sep 13, 2019
1 parent 179c324 commit cb2c0870ec34a9e2c8354ac920061c9231af2850
@@ -24,6 +24,7 @@
import com.sk89q.worldedit.world.weather.WeatherType;
import com.sk89q.worldedit.world.weather.WeatherTypes;
import com.sk89q.worldguard.LocalPlayer;
import io.papermc.lib.PaperLib;
import org.bukkit.BanList.Type;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
@@ -179,6 +180,12 @@ public void resetFallDistance() {
getPlayer().setFallDistance(0);
}

@Override
public void teleport(Location location, String message) {
PaperLib.teleportAsync(getPlayer(), BukkitAdapter.adapt(location))
.thenApply(success -> { if (success) print(message); return success; });
}

@Override
public String[] getGroups() {
return plugin.getGroups(getPlayer());
@@ -270,7 +270,7 @@ private void addAll(@Nullable Object... element) {
}
}
} else if (o instanceof Vehicle) {
addAll(((Vehicle) o).getPassengers());
((Vehicle) o).getPassengers().forEach(this::addAll);
} else if (o instanceof AreaEffectCloud) {
indirect = true;
addAll(((AreaEffectCloud) o).getSource());

0 comments on commit cb2c087

Please sign in to comment.
You can’t perform that action at this time.