Search in sources :

Example 71 with Entity

use of net.minecraft.server.v1_16_R3.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_9_R2.Entity) NBTTagCompound(net.minecraft.server.v1_9_R2.NBTTagCompound) PacketPlayOutEntityHeadRotation(net.minecraft.server.v1_9_R2.PacketPlayOutEntityHeadRotation) CraftPlayer(org.bukkit.craftbukkit.v1_9_R2.entity.CraftPlayer) CraftWorld(org.bukkit.craftbukkit.v1_9_R2.CraftWorld) World(net.minecraft.server.v1_9_R2.World) CraftWorld(org.bukkit.craftbukkit.v1_9_R2.CraftWorld)

Example 72 with Entity

use of net.minecraft.server.v1_16_R3.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 73 with Entity

use of net.minecraft.server.v1_16_R3.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 74 with Entity

use of net.minecraft.server.v1_16_R3.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 75 with Entity

use of net.minecraft.server.v1_16_R3.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)

Aggregations

Entity (org.hypertrace.entity.data.service.v1.Entity)110 LivingEntity (org.bukkit.entity.LivingEntity)96 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 ArrayList (java.util.ArrayList)36 Location (org.bukkit.Location)36 Entity (com.google.datastore.v1.Entity)33 EnrichedEntity (org.hypertrace.entity.data.service.v1.EnrichedEntity)32 Event (org.hypertrace.core.datamodel.Event)27 Player (org.bukkit.entity.Player)23 AttributeValue (org.hypertrace.core.datamodel.AttributeValue)22 CraftEntity (org.bukkit.craftbukkit.v1_16_R3.entity.CraftEntity)21 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 CraftPlayer (org.bukkit.craftbukkit.v1_16_R3.entity.CraftPlayer)18 AnnotateVideoProgress (com.google.cloud.videointelligence.v1.AnnotateVideoProgress)17