Search in sources :

Example 61 with Entity

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);
}
Also used : Entity(net.minecraft.server.v1_10_R1.Entity) NBTTagCompound(net.minecraft.server.v1_10_R1.NBTTagCompound) PacketPlayOutEntityHeadRotation(net.minecraft.server.v1_10_R1.PacketPlayOutEntityHeadRotation) CraftPlayer(org.bukkit.craftbukkit.v1_10_R1.entity.CraftPlayer) CraftWorld(org.bukkit.craftbukkit.v1_10_R1.CraftWorld) World(net.minecraft.server.v1_10_R1.World) CraftWorld(org.bukkit.craftbukkit.v1_10_R1.CraftWorld)

Example 62 with Entity

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);
}
Also used : Entity(net.minecraft.server.v1_11_R1.Entity) NBTTagCompound(net.minecraft.server.v1_11_R1.NBTTagCompound) PacketPlayOutEntityHeadRotation(net.minecraft.server.v1_11_R1.PacketPlayOutEntityHeadRotation) CraftPlayer(org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer) World(net.minecraft.server.v1_11_R1.World) CraftWorld(org.bukkit.craftbukkit.v1_11_R1.CraftWorld) CraftWorld(org.bukkit.craftbukkit.v1_11_R1.CraftWorld)

Example 63 with Entity

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;
}
Also used : CollectionLoader(io.jmix.ui.model.CollectionLoader) ValueSource(io.jmix.ui.component.data.ValueSource) ThemeClassNames(io.jmix.ui.theme.ThemeClassNames) CollectionContainer(io.jmix.ui.model.CollectionContainer) Date(java.util.Date) Collection(java.util.Collection) Autowired(org.springframework.beans.factory.annotation.Autowired) ContainerDataGridItems(io.jmix.ui.component.data.datagrid.ContainerDataGridItems) ExcelExportAction(io.jmix.uiexport.action.ExcelExportAction) Notifications(io.jmix.ui.Notifications) JmixIcon(io.jmix.ui.icon.JmixIcon) DateUtils(org.apache.commons.lang3.time.DateUtils) UiComponents(io.jmix.ui.UiComponents) Icons(io.jmix.ui.icon.Icons) io.jmix.ui.screen(io.jmix.ui.screen) ui.ex1.entity(ui.ex1.entity) Map(java.util.Map) BaseAction(io.jmix.ui.action.BaseAction) Named(javax.inject.Named) io.jmix.ui.component(io.jmix.ui.component) BaseAction(io.jmix.ui.action.BaseAction)

Example 64 with Entity

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());
}
Also used : Entity(org.hypertrace.entity.data.service.v1.Entity)

Example 65 with Entity

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);
    }
}
Also used : RequestContext(org.hypertrace.core.grpcutils.context.RequestContext) EnrichedSpanUtils(org.hypertrace.traceenricher.enrichedspan.constants.utils.EnrichedSpanUtils) EntityConstants(org.hypertrace.entity.service.constants.EntityConstants) BackendInfo(org.hypertrace.traceenricher.enrichment.enrichers.resolver.backend.BackendInfo) AttributeValueCreator(org.hypertrace.core.datamodel.shared.trace.AttributeValueCreator) LoggerFactory(org.slf4j.LoggerFactory) HashMap(java.util.HashMap) StringUtils(org.apache.commons.lang3.StringUtils) LinkedHashMap(java.util.LinkedHashMap) StructuredTraceGraph(org.hypertrace.core.datamodel.shared.StructuredTraceGraph) Pair(org.apache.commons.lang3.tuple.Pair) BackendType(org.hypertrace.traceenricher.enrichment.enrichers.BackendType) AttributeValue(org.hypertrace.entity.data.service.v1.AttributeValue) Map(java.util.Map) BackendProvider(org.hypertrace.traceenricher.enrichment.enrichers.backend.provider.BackendProvider) EnrichedSpanConstants(org.hypertrace.traceenricher.enrichedspan.constants.EnrichedSpanConstants) Entity(org.hypertrace.entity.data.service.v1.Entity) HexUtils(org.hypertrace.core.datamodel.shared.HexUtils) SpanAttributeUtils(org.hypertrace.core.datamodel.shared.SpanAttributeUtils) Backend(org.hypertrace.traceenricher.enrichedspan.constants.v1.Backend) EntityType(org.hypertrace.entity.v1.entitytype.EntityType) Nullable(javax.annotation.Nullable) StructuredTrace(org.hypertrace.core.datamodel.StructuredTrace) Logger(org.slf4j.Logger) SpanSemanticConventionUtils(org.hypertrace.semantic.convention.utils.span.SpanSemanticConventionUtils) Config(com.typesafe.config.Config) AbstractTraceEnricher(org.hypertrace.traceenricher.enrichment.AbstractTraceEnricher) BackendAttribute(org.hypertrace.entity.constants.v1.BackendAttribute) EnricherUtil(org.hypertrace.traceenricher.util.EnricherUtil) Event(org.hypertrace.core.datamodel.Event) EdsClient(org.hypertrace.entity.data.service.client.EdsClient) ClientRegistry(org.hypertrace.traceenricher.enrichment.clients.ClientRegistry) EntityCache(org.hypertrace.traceenricher.enrichment.enrichers.cache.EntityCache) ExecutionException(java.util.concurrent.ExecutionException) List(java.util.List) EntityAvroConverter(org.hypertrace.traceenricher.util.EntityAvroConverter) Optional(java.util.Optional) VisibleForTesting(com.google.common.annotations.VisibleForTesting) Collections(java.util.Collections) Joiner(com.google.common.base.Joiner) Builder(org.hypertrace.entity.data.service.v1.Entity.Builder) StructuredTraceGraph(org.hypertrace.core.datamodel.shared.StructuredTraceGraph) ExecutionException(java.util.concurrent.ExecutionException)

Aggregations

Entity (org.hypertrace.entity.data.service.v1.Entity)110 LivingEntity (org.bukkit.entity.LivingEntity)95 Test (org.junit.jupiter.api.Test)95 SkinnableEntity (net.citizensnpcs.npc.skin.SkinnableEntity)88 net.minecraft.world.entity (net.minecraft.world.entity)40 org.bukkit.entity (org.bukkit.entity)40 Entity (com.google.datastore.v1.Entity)33 ArrayList (java.util.ArrayList)33 Location (org.bukkit.Location)33 EnrichedEntity (org.hypertrace.entity.data.service.v1.EnrichedEntity)32 Event (org.hypertrace.core.datamodel.Event)27 AttributeValue (org.hypertrace.core.datamodel.AttributeValue)22 BackendInfo (org.hypertrace.traceenricher.enrichment.enrichers.resolver.backend.BackendInfo)21 Mob (net.minecraft.world.entity.Mob)20 NPCHolder (net.citizensnpcs.npc.ai.NPCHolder)18 Entity (net.minecraft.server.v1_8_R3.Entity)18 AnnotateVideoProgress (com.google.cloud.videointelligence.v1.AnnotateVideoProgress)17 AnnotateVideoRequest (com.google.cloud.videointelligence.v1.AnnotateVideoRequest)17 AnnotateVideoResponse (com.google.cloud.videointelligence.v1.AnnotateVideoResponse)17 Entity (com.google.cloud.videointelligence.v1.Entity)17