SteamWar/BauSystem2.0
Archiviert
12
0

Add tinyprotocol
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2021-10-12 21:28:05 +02:00
Ursprung 1786f6c311
Commit 94be6998d2

Datei anzeigen

@ -53,18 +53,18 @@ public class DetonatorListener implements Listener {
public DetonatorListener() { public DetonatorListener() {
ProtocolAPI.setIncomingHandler(useEntity, (player, o) -> { ProtocolAPI.setIncomingHandler(useEntity, (player, o) -> {
List<AbstractDetonatorEntity> entities = new ArrayList<>(Detonator.getDetoEntities(player)); List<AbstractDetonatorEntity> entities = Detonator.getDetoEntities(player);
if (entities.isEmpty()) { if (entities.isEmpty()) {
return o; return o;
} }
int entityId = entityIdFieldAccessor.get(o); int entityId = entityIdFieldAccessor.get(o);
entities.removeIf(abstractDetonatorEntity -> abstractDetonatorEntity.getId() != entityId); AbstractDetonatorEntity entity = entities.stream().filter(abstractDetonatorEntity -> abstractDetonatorEntity.getId() == entityId).findFirst().orElse(null);
if (entities.isEmpty()) { if (entity == null) {
return o; return o;
} }
AbstractDetonatorEntity entity = entities.get(0);
Location location = entity.getBukkitEntity().getLocation().getBlock().getLocation(); Location location = entity.getBukkitEntity().getLocation().getBlock().getLocation();
addLocationToDetonator(location, player); addLocationToDetonator(location, player);
HAS_UPDATED.add(player); HAS_UPDATED.add(player);