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() {
ProtocolAPI.setIncomingHandler(useEntity, (player, o) -> {
List<AbstractDetonatorEntity> entities = new ArrayList<>(Detonator.getDetoEntities(player));
List<AbstractDetonatorEntity> entities = Detonator.getDetoEntities(player);
if (entities.isEmpty()) {
return 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;
}
AbstractDetonatorEntity entity = entities.get(0);
Location location = entity.getBukkitEntity().getLocation().getBlock().getLocation();
addLocationToDetonator(location, player);
HAS_UPDATED.add(player);