3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 04:20:08 +01:00

Fix NPE that could happen on teleporting

Dieser Commit ist enthalten in:
Thinkofdeath 2015-04-16 21:23:26 +01:00
Ursprung 8e5e4c189b
Commit ab309d78c6

Datei anzeigen

@ -1,5 +1,5 @@
--- /home/matt/mc-dev-private//net/minecraft/server/PortalTravelAgent.java 2015-03-04 09:48:49.303820658 +0000 --- /home/matt/mc-dev-private//net/minecraft/server/PortalTravelAgent.java 2015-04-16 21:22:47.467439143 +0100
+++ src/main/java/net/minecraft/server/PortalTravelAgent.java 2015-03-04 09:48:49.311820658 +0000 +++ src/main/java/net/minecraft/server/PortalTravelAgent.java 2015-04-16 21:22:47.471439143 +0100
@@ -5,6 +5,12 @@ @@ -5,6 +5,12 @@
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;
@ -129,7 +129,7 @@
+ BlockPosition object = new BlockPosition(position.getBlockX(), position.getBlockY(), position.getBlockZ()); + BlockPosition object = new BlockPosition(position.getBlockX(), position.getBlockY(), position.getBlockZ());
+ float f = position.getYaw(); + float f = position.getYaw();
+ +
+ if (this.a.getWorld().getEnvironment() == org.bukkit.World.Environment.THE_END || entity.getBukkitEntity().getWorld().getEnvironment() == org.bukkit.World.Environment.THE_END) { + if (this.a.getWorld().getEnvironment() == org.bukkit.World.Environment.THE_END || entity.getBukkitEntity().getWorld().getEnvironment() == org.bukkit.World.Environment.THE_END || entity.aG() == null) {
+ // entity.setPositionRotation((double) i, (double) j, (double) k, entity.yaw, 0.0F); + // entity.setPositionRotation((double) i, (double) j, (double) k, entity.yaw, 0.0F);
+ // entity.motX = entity.motY = entity.motZ = 0.0D; + // entity.motX = entity.motY = entity.motZ = 0.0D;
+ position.setPitch(0.0F); + position.setPitch(0.0F);