Fix NPE that could happen on teleporting

This commit is contained in:
Thinkofdeath 2015-04-16 21:23:26 +01:00
parent 8e5e4c189b
commit ab309d78c6

View file

@ -1,5 +1,5 @@
--- /home/matt/mc-dev-private//net/minecraft/server/PortalTravelAgent.java 2015-03-04 09:48:49.303820658 +0000
+++ src/main/java/net/minecraft/server/PortalTravelAgent.java 2015-03-04 09:48:49.311820658 +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-04-16 21:22:47.471439143 +0100
@@ -5,6 +5,12 @@
import java.util.List;
import java.util.Random;
@ -129,7 +129,7 @@
+ BlockPosition object = new BlockPosition(position.getBlockX(), position.getBlockY(), position.getBlockZ());
+ 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.motX = entity.motY = entity.motZ = 0.0D;
+ position.setPitch(0.0F);