SteamWar/FightSystem
Archiviert
13
1

Fix SpectralCraftArrow-Cast
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2022-04-10 18:58:36 +02:00
Ursprung f0ecbbf427
Commit 72b03aa832
4 geänderte Dateien mit 12 neuen und 9 gelöschten Zeilen

Datei anzeigen

@ -25,6 +25,7 @@ import org.bukkit.Sound;
import org.bukkit.SoundCategory;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.scoreboard.Team;
public class WorldOfColorWrapper12 implements WorldOfColorWrapper {
@ -34,8 +35,10 @@ public class WorldOfColorWrapper12 implements WorldOfColorWrapper {
}
@Override
public boolean isInBlock(Arrow e) {
return e.isInBlock();
public boolean isInBlock(Projectile e) {
if(e instanceof Arrow)
return ((Arrow) e).isInBlock();
return false;
}
@Override

Datei anzeigen

@ -22,8 +22,8 @@ package de.steamwar.fightsystem.utils;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Sound;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.scoreboard.Team;
public class WorldOfColorWrapper8 implements WorldOfColorWrapper {
@ -33,7 +33,7 @@ public class WorldOfColorWrapper8 implements WorldOfColorWrapper {
}
@Override
public boolean isInBlock(Arrow e) {
public boolean isInBlock(Projectile e) {
return false;
}

Datei anzeigen

@ -27,8 +27,8 @@ import de.steamwar.fightsystem.utils.WorldOfColorWrapper;
import org.bukkit.Location;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.projectiles.ProjectileSource;
import org.bukkit.util.Vector;
@ -44,7 +44,7 @@ public class ArrowStopper {
private static final Class<?> entityArrow = Reflection.getClass("{nms.world.entity.projectile}.EntityArrow");
private void run() {
Recording.iterateOverEntities(entityArrow::isInstance, entity -> {
Arrow arrow = (Arrow) entity;
Projectile arrow = (Projectile) entity;
if (invalidEntity(arrow))
return;
@ -88,7 +88,7 @@ public class ArrowStopper {
return Config.HiddenBlocks.contains(block.getType().name().toLowerCase());
}
private boolean invalidEntity(Arrow entity) {
private boolean invalidEntity(Projectile entity) {
Location location = entity.getLocation();
boolean teamFrom = entity.getVelocity().getZ() > 0;
boolean overMid = location.getZ() > Config.SpecSpawn.getZ();

Datei anzeigen

@ -24,15 +24,15 @@ import de.steamwar.fightsystem.FightSystem;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Sound;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.scoreboard.Team;
public interface WorldOfColorWrapper {
WorldOfColorWrapper impl = VersionDependent.getVersionImpl(FightSystem.getPlugin());
void setTeamColor(Team team, ChatColor color);
boolean isInBlock(Arrow e);
boolean isInBlock(Projectile e);
void playSound(Location location, Sound sound, String soundCategory, float volume, float pitch);