SteamWar/FightSystem
Archiviert
13
1
Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2024-01-28 22:44:09 +01:00
Ursprung f130af5465
Commit c622e8b4f6
4 geänderte Dateien mit 10 neuen und 7 gelöschten Zeilen

Datei anzeigen

@ -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);
}
});
}

Datei anzeigen

@ -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

Datei anzeigen

@ -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;

Datei anzeigen

@ -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());
}