mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 07:20:24 +01:00
One fix
This commit is contained in:
parent
c07518e0c6
commit
d5f9f3f9fc
1 changed files with 10 additions and 10 deletions
|
@ -123,17 +123,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ };
|
||||
+ }
|
||||
+
|
||||
+ public static net.minecraft.network.protocol.game.ClientboundPlayerPositionPacket.RelativeArgument toNmsRelativeFlag(io.papermc.paper.entity.TeleportFlag.Relative apiFlag) {
|
||||
+ public static net.minecraft.world.entity.RelativeMovement toNmsRelativeFlag(io.papermc.paper.entity.TeleportFlag.Relative apiFlag) {
|
||||
+ return switch (apiFlag) {
|
||||
+ case X -> net.minecraft.network.protocol.game.ClientboundPlayerPositionPacket.RelativeArgument.X;
|
||||
+ case Y -> net.minecraft.network.protocol.game.ClientboundPlayerPositionPacket.RelativeArgument.Y;
|
||||
+ case Z -> net.minecraft.network.protocol.game.ClientboundPlayerPositionPacket.RelativeArgument.Z;
|
||||
+ case PITCH -> net.minecraft.network.protocol.game.ClientboundPlayerPositionPacket.RelativeArgument.X_ROT;
|
||||
+ case YAW -> net.minecraft.network.protocol.game.ClientboundPlayerPositionPacket.RelativeArgument.Y_ROT;
|
||||
+ case X -> net.minecraft.world.entity.RelativeMovement.X;
|
||||
+ case Y -> net.minecraft.world.entity.RelativeMovement.Y;
|
||||
+ case Z -> net.minecraft.world.entity.RelativeMovement.Z;
|
||||
+ case PITCH -> net.minecraft.world.entity.RelativeMovement.X_ROT;
|
||||
+ case YAW -> net.minecraft.world.entity.RelativeMovement.Y_ROT;
|
||||
+ };
|
||||
+ }
|
||||
+
|
||||
+ public static io.papermc.paper.entity.TeleportFlag.Relative toApiRelativeFlag(net.minecraft.network.protocol.game.ClientboundPlayerPositionPacket.RelativeArgument nmsFlag) {
|
||||
+ public static io.papermc.paper.entity.TeleportFlag.Relative toApiRelativeFlag(net.minecraft.world.entity.RelativeMovement nmsFlag) {
|
||||
+ return switch (nmsFlag) {
|
||||
+ case X -> io.papermc.paper.entity.TeleportFlag.Relative.X;
|
||||
+ case Y -> io.papermc.paper.entity.TeleportFlag.Relative.Y;
|
||||
|
@ -145,13 +145,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+
|
||||
+ @Override
|
||||
+ public boolean teleport(Location location, org.bukkit.event.player.PlayerTeleportEvent.TeleportCause cause, io.papermc.paper.entity.TeleportFlag... flags) {
|
||||
+ java.util.Set<net.minecraft.network.protocol.game.ClientboundPlayerPositionPacket.RelativeArgument> relativeArguments;
|
||||
+ java.util.Set<net.minecraft.world.entity.RelativeMovement> relativeArguments;
|
||||
+ java.util.Set<io.papermc.paper.entity.TeleportFlag> allFlags;
|
||||
+ if (flags.length == 0) {
|
||||
+ relativeArguments = Set.of();
|
||||
+ allFlags = Set.of();
|
||||
+ } else {
|
||||
+ relativeArguments = java.util.EnumSet.noneOf(net.minecraft.network.protocol.game.ClientboundPlayerPositionPacket.RelativeArgument.class);
|
||||
+ relativeArguments = java.util.EnumSet.noneOf(net.minecraft.world.entity.RelativeMovement.class);
|
||||
+ allFlags = new HashSet<>();
|
||||
+ for (io.papermc.paper.entity.TeleportFlag flag : flags) {
|
||||
+ if (flag instanceof io.papermc.paper.entity.TeleportFlag.Relative relativeTeleportFlag) {
|
||||
|
@ -209,7 +209,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
// Check if the fromWorld and toWorld are the same.
|
||||
if (fromWorld == toWorld) {
|
||||
- entity.connection.teleport(to);
|
||||
+ entity.connection.internalTeleport(to.getX(), to.getY(), to.getZ(), to.getYaw(), to.getPitch(), relativeArguments, dismount); // Paper - Teleport API
|
||||
+ entity.connection.internalTeleport(to.getX(), to.getY(), to.getZ(), to.getYaw(), to.getPitch(), relativeArguments); // Paper - Teleport API
|
||||
} else {
|
||||
server.getHandle().respawn(entity, toWorld, true, to, !toWorld.paperConfig().environment.disableTeleportationSuffocationCheck); // Paper
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue