Search in sources :

Example 51 with Entity

use of com.google.cloud.videointelligence.v1p2beta1.Entity in project KomanJava by dpsclem.

the class Map method CreateRandomMap.

public static Map CreateRandomMap() {
    var table = new Cell[Map.MapWidth][Map.MapHeight];
    for (int i = 0; i < Map.MapWidth; i++) {
        for (int j = 0; j < Map.MapHeight; j++) {
            if (ThreadLocalRandom.current().nextInt(1, 11) == 1)
                table[i][j] = new Cell(CellMaterial.Wall, i, j);
            else
                table[i][j] = new Cell(CellMaterial.Floor, i, j);
        }
    }
    var randomMap = new Map(table);
    randomMap.addItemOnMap(new Item("key", 10, "file:resources/graphics/sprite/key.png"), 3, 3);
    randomMap.addItemOnMap(new Item("pioche", 10, "file:resources/graphics/sprite/pioche.png"), 3, 5);
    randomMap.addItemOnMap(new Usable("moneybag", 0, false, UsableType.MONEYBAG, null, 15, "file:resources/graphics/sprite/moneybag.png"), 8, 2);
    randomMap.addEntityOnMap(new Entity(2, 2, EntityStatus.INACTIVE, EntityType.MONSTER, "file:resources/graphics/sprite/monster1.gif"));
    return randomMap;
}
Also used : Item(Item) Entity(Entity)

Example 52 with Entity

use of com.google.cloud.videointelligence.v1p2beta1.Entity in project KomanJava by dpsclem.

the class Map method UpdateWithRandomMap.

public void UpdateWithRandomMap() {
    table = new Cell[Map.MapWidth][Map.MapHeight];
    for (int i = 0; i < Map.MapWidth; i++) {
        for (int j = 0; j < Map.MapHeight; j++) {
            if (ThreadLocalRandom.current().nextInt(1, 11) == 1)
                table[i][j] = new Cell(CellMaterial.Wall, i, j);
            else
                table[i][j] = new Cell(CellMaterial.Floor, i, j);
        }
    }
    this.addItemOnMap(new Item("key", 10, "file:resources/graphics/sprite/key.png"), 3, 3);
    this.addItemOnMap(new Item("pioche", 10, "file:resources/graphics/sprite/pioche.png"), 3, 5);
    this.addItemOnMap(new Item("coin", 10, "file:resources/graphics/sprite/moneybag.png"), 8, 5);
    this.addEntityOnMap(new Entity(5, 5, EntityStatus.INACTIVE, EntityType.MONSTER, "file:resources/graphics/sprite/monster1.gif"));
}
Also used : Item(Item) Entity(Entity)

Example 53 with Entity

use of com.google.cloud.videointelligence.v1p2beta1.Entity in project grpc-gcp-java by GoogleCloudPlatform.

the class DataStoreChecksumClient method simpleLookup.

private static void simpleLookup(DatastoreBlockingStub stub, String projectId) {
    PathElement pathElement = PathElement.newBuilder().setKind("Person").setName("weiranf").build();
    Key key = Key.newBuilder().addPath(pathElement).build();
    LookupRequest lookupRequest = LookupRequest.newBuilder().setProjectId(projectId).addKeys(key).build();
    LookupResponse lookupResponse = stub.lookup(lookupRequest);
    if (lookupResponse.getFoundCount() > 0) {
        System.out.println("ENTITY FOUND:");
        Entity entity = lookupResponse.getFound(0).getEntity();
        Map<String, Value> map = entity.getPropertiesMap();
        for (Map.Entry<String, Value> entry : map.entrySet()) {
            System.out.printf("%s => %s\n", entry.getKey(), entry.getValue().getStringValue());
        }
    } else {
        System.out.println("NO ENTITY FOUND!");
    }
}
Also used : Entity(com.google.datastore.v1.Entity) PathElement(com.google.datastore.v1.Key.PathElement) Value(com.google.datastore.v1.Value) LookupResponse(com.google.datastore.v1.LookupResponse) Map(java.util.Map) Key(com.google.datastore.v1.Key) LookupRequest(com.google.datastore.v1.LookupRequest)

Example 54 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_12_R1.Entity) NBTTagCompound(net.minecraft.server.v1_12_R1.NBTTagCompound) PacketPlayOutEntityHeadRotation(net.minecraft.server.v1_12_R1.PacketPlayOutEntityHeadRotation) CraftPlayer(org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer) World(net.minecraft.server.v1_12_R1.World) CraftWorld(org.bukkit.craftbukkit.v1_12_R1.CraftWorld) CraftWorld(org.bukkit.craftbukkit.v1_12_R1.CraftWorld)

Example 55 with Entity

use of com.google.cloud.videointelligence.v1p2beta1.Entity in project SilkSpawners by timbru31.

the class NMSHandler method spawnEntity.

@SuppressWarnings("resource")
@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_13_R2.Entity) NBTTagCompound(net.minecraft.server.v1_13_R2.NBTTagCompound) PacketPlayOutEntityHeadRotation(net.minecraft.server.v1_13_R2.PacketPlayOutEntityHeadRotation) CraftPlayer(org.bukkit.craftbukkit.v1_13_R2.entity.CraftPlayer) CraftWorld(org.bukkit.craftbukkit.v1_13_R2.CraftWorld) World(net.minecraft.server.v1_13_R2.World) CraftWorld(org.bukkit.craftbukkit.v1_13_R2.CraftWorld)

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