Skip to content

Commit

Permalink
Minecraft's getVehicle method can return the same entity if no vehicl…
Browse files Browse the repository at this point in the history
…e is present - convert this case to null
  • Loading branch information
fullwall committed Apr 5, 2016
1 parent fe0e8ed commit 7d310ce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/net/citizensnpcs/util/NMS.java
Expand Up @@ -486,7 +486,8 @@ public static float getStepHeight(org.bukkit.entity.Entity entity) {
}

public static Entity getVehicle(org.bukkit.entity.Entity entity) {
return getHandle(entity).getVehicle();
Entity e = getHandle(entity).getVehicle();
return e == getHandle(entity) ? null : e;
}

public static void initNetworkManager(NetworkManager network) {
Expand Down

0 comments on commit 7d310ce

Please sign in to comment.