1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2025-04-29 07:04:51 +02:00

Allow duplicate relative flags in entity teleport

Fixes 
This commit is contained in:
Nassim Jahnke 2025-01-15 12:13:58 +01:00
parent b6be7cd0ae
commit cd9d6d6998
No known key found for this signature in database
GPG key ID: EF6771C01F6EF02F

View file

@ -5,6 +5,7 @@ import com.google.common.base.Preconditions;
import com.google.common.base.Predicates;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.UUID;
@ -243,7 +244,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
Preconditions.checkArgument(location != null, "location cannot be null");
location.checkFinite();
// Paper start - Teleport passenger API
Set<io.papermc.paper.entity.TeleportFlag> flagSet = Set.of(flags);
Set<io.papermc.paper.entity.TeleportFlag> flagSet = new HashSet<>(List.of(flags)); // Wrap into list while multiple old flags link to the same new one
boolean dismount = !flagSet.contains(io.papermc.paper.entity.TeleportFlag.EntityState.RETAIN_VEHICLE);
boolean retainPassengers = flagSet.contains(io.papermc.paper.entity.TeleportFlag.EntityState.RETAIN_PASSENGERS);
// Don't allow teleporting between worlds while keeping passengers