use of com.google.cloud.videointelligence.v1p2beta1.Entity in project SilkSpawners by timbru31.
the class NMSHandler method spawnEntity.
@Override
public void spawnEntity(final org.bukkit.World w, final String entityID, final double x, final double y, final double z, final Player player) {
final NBTTagCompound tag = new NBTTagCompound();
tag.setString("id", entityID);
final World world = ((CraftWorld) w).getHandle();
final Entity entity = EntityTypes.a(tag, world);
if (entity == null) {
Bukkit.getLogger().warning("[SilkSpawners] Failed to spawn, falling through. You should report this (entity == null)!");
return;
}
final float yaw = world.random.nextFloat() * (-180 - 180) + 180;
entity.setPositionRotation(x, y, z, yaw, 0);
world.addEntity(entity, SpawnReason.SPAWNER_EGG);
final PacketPlayOutEntityHeadRotation rotation = new PacketPlayOutEntityHeadRotation(entity, (byte) yaw);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(rotation);
}
use of com.google.cloud.videointelligence.v1p2beta1.Entity in project SilkSpawners by timbru31.
the class NMSHandler method spawnEntity.
@Override
public void spawnEntity(final org.bukkit.World w, final String entityID, final double x, final double y, final double z, final Player player) {
final NBTTagCompound tag = new NBTTagCompound();
tag.setString("id", entityID);
final World world = ((CraftWorld) w).getHandle();
final Entity entity = EntityTypes.a(tag, world);
if (entity == null) {
Bukkit.getLogger().warning("[SilkSpawners] Failed to spawn, falling through. You should report this (entity == null)!");
return;
}
final float yaw = world.random.nextFloat() * (-180 - 180) + 180;
entity.setPositionRotation(x, y, z, yaw, 0);
world.addEntity(entity, SpawnReason.SPAWNER_EGG);
final PacketPlayOutEntityHeadRotation rotation = new PacketPlayOutEntityHeadRotation(entity, (byte) yaw);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(rotation);
}
use of com.google.cloud.videointelligence.v1p2beta1.Entity in project jmix-docs by jmix-framework.
the class DataGridScreen method createCloseButton.
// end::details-generator[]
// tag::create-close-button[]
protected Component createCloseButton(Customer entity) {
Button closeButton = uiComponents.create(Button.class);
closeButton.setIcon("font-icon:TIMES");
BaseAction closeAction = new BaseAction("closeAction").withHandler(actionPerformedEvent -> detailsGrid.setDetailsVisible(entity, false)).withCaption("");
closeButton.setAction(closeAction);
return closeButton;
}
use of com.google.cloud.videointelligence.v1p2beta1.Entity in project hypertrace-ingester by hypertrace.
the class AbstractBackendEntityEnricher method decorateWithBackendEntity.
private void decorateWithBackendEntity(BackendInfo backendInfo, Event event, StructuredTrace trace) {
LOGGER.debug("Trying to load or create backend entity: {}, corresponding event: {}", backendInfo.getEntity(), event);
Entity backend = createBackendIfMissing(backendInfo.getEntity());
if (backend == null) {
LOGGER.warn("Failed to upsert backend entity: {}", backendInfo.getEntity());
return;
}
org.hypertrace.core.datamodel.Entity avroEntity = EntityAvroConverter.convertToAvroEntity(backend, true);
if (avroEntity == null) {
LOGGER.warn("Error converting backendEntity:{} to avro", backendInfo.getEntity());
return;
}
addEntity(trace, event, avroEntity);
addEnrichedAttributes(event, getAttributesToEnrich(backend));
addEnrichedAttributes(event, backendInfo.getAttributes());
}
use of com.google.cloud.videointelligence.v1p2beta1.Entity in project hypertrace-ingester by hypertrace.
the class AbstractBackendEntityEnricher method enrichTrace.
// At trace level, based on the next span to identify if a backend entity is actually a service
// entity.
@Override
public void enrichTrace(StructuredTrace trace) {
try {
StructuredTraceGraph structuredTraceGraph = buildGraph(trace);
trace.getEventList().stream().filter(event -> EnrichedSpanUtils.isExitSpan(event) && SpanAttributeUtils.isLeafSpan(structuredTraceGraph, event) && canResolveBackend(structuredTraceGraph, event)).map(event -> Pair.of(event, resolve(event, trace, structuredTraceGraph))).filter(pair -> pair.getRight().isPresent()).filter(pair -> isValidBackendEntity(trace, pair.getLeft(), pair.getRight().get())).forEach(pair -> decorateWithBackendEntity(pair.getRight().get(), pair.getLeft(), trace));
} catch (Exception ex) {
LOGGER.error("An error occurred while enriching backend", ex);
}
}
Aggregations