Prevents suffocation when teleporting on a horse

This commit is contained in:
Kristian Knarvik 2021-09-12 06:02:10 +02:00
parent abd48b646d
commit 319849fd96

View File

@ -24,6 +24,7 @@ import org.bukkit.block.data.BlockData;
import org.bukkit.block.data.Orientable;
import org.bukkit.block.data.Powerable;
import org.bukkit.block.data.type.Slab;
import org.bukkit.entity.AbstractHorse;
import org.bukkit.entity.Boat;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
@ -844,6 +845,9 @@ public class Portal {
exitLocation = DirectionHelper.adjustLocation(exitLocation, 0, 0, (entitySize / 2D) - 1, modX, modZ);
}
}
if (entity instanceof AbstractHorse) {
exitLocation = DirectionHelper.adjustLocation(exitLocation, 0, 0, 1, modX, modZ);
}
return exitLocation;
}