Pathplanning #399
@ -46,6 +46,7 @@ import org.bukkit.entity.EntityType;
|
|||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.entity.Villager;
|
import org.bukkit.entity.Villager;
|
||||||
|
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||||
import org.bukkit.scheduler.BukkitTask;
|
import org.bukkit.scheduler.BukkitTask;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
@ -212,7 +213,7 @@ public abstract class AI {
|
|||||||
if(!team.getFightPlayer(entity).canEntern() && !team.getExtendRegion().inRegion(target))
|
if(!team.getFightPlayer(entity).canEntern() && !team.getExtendRegion().inRegion(target))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
entity.teleport(target);
|
entity.teleport(target, PlayerTeleportEvent.TeleportCause.COMMAND);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -89,8 +89,11 @@ public class FightPlayer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void ifAI(Consumer<AI> function) {
|
public void ifAI(Consumer<AI> function) {
|
||||||
if(!(entity instanceof Player))
|
if(entity instanceof Player)
|
||||||
function.accept(AI.getAI(entity.getUniqueId()));
|
return;
|
||||||
|
AI ai = AI.getAI(entity.getUniqueId());
|
||||||
|
if(ai != null)
|
||||||
|
function.accept(ai);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ifPlayer(Consumer<Player> function) {
|
public void ifPlayer(Consumer<Player> function) {
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren