AI recordings
Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Ursprung
f130af5465
Commit
c622e8b4f6
@ -27,6 +27,7 @@ import de.steamwar.fightsystem.fight.Fight;
|
||||
import de.steamwar.fightsystem.fight.FightTeam;
|
||||
import de.steamwar.fightsystem.fight.JoinRequest;
|
||||
import de.steamwar.fightsystem.listener.Chat;
|
||||
import de.steamwar.fightsystem.record.GlobalRecorder;
|
||||
import de.steamwar.fightsystem.states.FightState;
|
||||
import de.steamwar.fightsystem.states.OneShotStateDependent;
|
||||
import de.steamwar.fightsystem.utils.Region;
|
||||
@ -236,6 +237,8 @@ public abstract class AI {
|
||||
|
||||
if(!entity.teleport(target, PlayerTeleportEvent.TeleportCause.PLUGIN))
|
||||
FightSystem.getPlugin().getLogger().log(Level.INFO, "Entity not teleported: " + entity.isValid());
|
||||
|
||||
GlobalRecorder.getInstance().entityMoves(entity);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -50,7 +50,6 @@ public class LixfelAI extends AI {
|
||||
public LixfelAI(FightTeam team) {
|
||||
super(team, SteamwarUser.get("Lixfel.AI"));
|
||||
getEntity().setGlowing(true);
|
||||
//TODO AI Replay
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -43,6 +43,7 @@ import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
@ -70,7 +71,7 @@ public class Recording implements Listener {
|
||||
return stack;
|
||||
}
|
||||
|
||||
public static boolean isNotSent(Player p){
|
||||
public static boolean isNotSent(LivingEntity p){
|
||||
FightPlayer fp = Fight.getFightPlayer(p);
|
||||
return fp == null || !fp.isLiving() || FightState.getFightState() == FightState.SPECTATE;
|
||||
}
|
||||
@ -193,10 +194,10 @@ public class Recording implements Listener {
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||
public void onEntityDamage(EntityDamageEvent e) {
|
||||
if(e.getEntityType() != EntityType.PLAYER)
|
||||
if(!e.getEntityType().isAlive())
|
||||
return;
|
||||
|
||||
Player p = (Player) e.getEntity();
|
||||
LivingEntity p = (LivingEntity) e.getEntity();
|
||||
if(isNotSent(p))
|
||||
return;
|
||||
|
||||
@ -208,10 +209,10 @@ public class Recording implements Listener {
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||
public void onEntityCombust(EntityCombustEvent e) {
|
||||
if(e.getEntityType() != EntityType.PLAYER)
|
||||
if(!e.getEntityType().isAlive())
|
||||
return;
|
||||
|
||||
Player p = (Player) e.getEntity();
|
||||
LivingEntity p = (LivingEntity) e.getEntity();
|
||||
if(isNotSent(p))
|
||||
return;
|
||||
|
||||
|
@ -204,7 +204,7 @@ public interface Recorder {
|
||||
write(0x0a, e.getEntityId(), start, offHand);
|
||||
}
|
||||
|
||||
default void damageAnimation(Player p) {
|
||||
default void damageAnimation(LivingEntity p) {
|
||||
write(0x0b, p.getEntityId());
|
||||
}
|
||||
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren