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).
This commit is contained in:
wizjany 2019-09-13 16:32:28 -04:00
parent 179c324c80
commit cb2c0870ec
2 changed files with 8 additions and 1 deletions

View File

@ -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());

View File

@ -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());