}
if (hasMoved()) {
Block currentBlock = location.getBlock();
if (currentBlock.getType() == Material.ENDER_PORTAL) {
EventFactory.callEvent(new EntityPortalEnterEvent(this, currentBlock.getLocation()));
if (server.getAllowEnd()) {
Location previousLocation = location.clone();
boolean success;
if (getWorld().getEnvironment() == World.Environment.THE_END) {
success = teleportToSpawn();