Search in sources :

Example 1 with SpawnObjectMessage

use of net.glowstone.net.message.play.entity.SpawnObjectMessage in project Glowstone by GlowstoneMC.

the class GlowFallingBlock method createSpawnMessage.

@Override
public List<Message> createSpawnMessage() {
    double x = location.getX();
    double y = location.getY();
    double z = location.getZ();
    int yaw = Position.getIntYaw(location);
    int pitch = Position.getIntPitch(location);
    // Note the shift amount has changed previously,
    // if block data doesn't appear to work check this value.
    int blockIdData = getBlockId() | getBlockData() << 12;
    return Arrays.asList(new SpawnObjectMessage(id, getUniqueId(), 70, x, y, z, pitch, yaw, blockIdData));
}
Also used : SpawnObjectMessage(net.glowstone.net.message.play.entity.SpawnObjectMessage)

Example 2 with SpawnObjectMessage

use of net.glowstone.net.message.play.entity.SpawnObjectMessage in project Glowstone by GlowstoneMC.

the class GlowFirework method createSpawnMessage.

@Override
public List<Message> createSpawnMessage() {
    double x = location.getX();
    double y = location.getY();
    double z = location.getZ();
    return Arrays.asList(new SpawnObjectMessage(entityId, UUID.randomUUID(), EntityNetworkUtil.getObjectId(EntityType.FIREWORK), x, y, z, 0, 0), new EntityMetadataMessage(entityId, metadata.getEntryList()));
}
Also used : SpawnObjectMessage(net.glowstone.net.message.play.entity.SpawnObjectMessage) EntityMetadataMessage(net.glowstone.net.message.play.entity.EntityMetadataMessage)

Example 3 with SpawnObjectMessage

use of net.glowstone.net.message.play.entity.SpawnObjectMessage in project Glowstone by GlowstoneMC.

the class GlowProjectile method createSpawnMessage.

@Override
public List<Message> createSpawnMessage() {
    double x = location.getX();
    double y = location.getY();
    double z = location.getZ();
    int yaw = Position.getIntYaw(location);
    int pitch = Position.getIntPitch(location);
    return Arrays.asList(new SpawnObjectMessage(entityId, getUniqueId(), getObjectId(), x, y, z, pitch, yaw), new EntityMetadataMessage(entityId, metadata.getEntryList()), new EntityVelocityMessage(entityId, getVelocity()));
}
Also used : SpawnObjectMessage(net.glowstone.net.message.play.entity.SpawnObjectMessage) EntityVelocityMessage(net.glowstone.net.message.play.entity.EntityVelocityMessage) EntityMetadataMessage(net.glowstone.net.message.play.entity.EntityMetadataMessage)

Example 4 with SpawnObjectMessage

use of net.glowstone.net.message.play.entity.SpawnObjectMessage in project Glowstone by GlowstoneMC.

the class GlowArmorStand method createSpawnMessage.

@Override
public List<Message> createSpawnMessage() {
    double x = location.getX();
    double y = location.getY();
    double z = location.getZ();
    int yaw = Position.getIntYaw(location);
    int pitch = Position.getIntPitch(location);
    return Arrays.asList(// TODO: once UUID is documented, actually use the appropriate ID here
    new SpawnObjectMessage(id, UUID.randomUUID(), 78, x, y, z, pitch, yaw), new EntityMetadataMessage(id, metadata.getEntryList()), new EntityEquipmentMessage(id, EntityEquipmentMessage.HELD_ITEM, getItemInHand()), new EntityEquipmentMessage(id, EntityEquipmentMessage.BOOTS_SLOT, getBoots()), new EntityEquipmentMessage(id, EntityEquipmentMessage.LEGGINGS_SLOT, getLeggings()), new EntityEquipmentMessage(id, EntityEquipmentMessage.CHESTPLATE_SLOT, getChestplate()), new EntityEquipmentMessage(id, EntityEquipmentMessage.HELMET_SLOT, getHelmet()));
}
Also used : SpawnObjectMessage(net.glowstone.net.message.play.entity.SpawnObjectMessage) EntityEquipmentMessage(net.glowstone.net.message.play.entity.EntityEquipmentMessage) EntityMetadataMessage(net.glowstone.net.message.play.entity.EntityMetadataMessage)

Example 5 with SpawnObjectMessage

use of net.glowstone.net.message.play.entity.SpawnObjectMessage in project Glowstone by GlowstoneMC.

the class GlowTNTPrimed method createSpawnMessage.

@Override
public List<Message> createSpawnMessage() {
    double x = location.getX();
    double y = location.getY();
    double z = location.getZ();
    int pitch = Position.getIntPitch(location);
    int yaw = Position.getIntYaw(location);
    LinkedList<Message> result = new LinkedList<>();
    result.add(new SpawnObjectMessage(id, getUniqueId(), 50, x, y, z, pitch, yaw));
    return result;
}
Also used : SpawnObjectMessage(net.glowstone.net.message.play.entity.SpawnObjectMessage) Message(com.flowpowered.network.Message) SpawnObjectMessage(net.glowstone.net.message.play.entity.SpawnObjectMessage) LinkedList(java.util.LinkedList)

Aggregations

SpawnObjectMessage (net.glowstone.net.message.play.entity.SpawnObjectMessage)12 EntityMetadataMessage (net.glowstone.net.message.play.entity.EntityMetadataMessage)5 Message (com.flowpowered.network.Message)3 LinkedList (java.util.LinkedList)2 ParticleBuilder (com.destroystokyo.paper.ParticleBuilder)1 UUID (java.util.UUID)1 MetadataMap (net.glowstone.entity.meta.MetadataMap)1 DestroyEntitiesMessage (net.glowstone.net.message.play.entity.DestroyEntitiesMessage)1 EntityEquipmentMessage (net.glowstone.net.message.play.entity.EntityEquipmentMessage)1 EntityVelocityMessage (net.glowstone.net.message.play.entity.EntityVelocityMessage)1 PEInventorySlot (org.dragonet.inventory.PEInventorySlot)1 AddItemEntityPacket (org.dragonet.net.packet.minecraft.AddItemEntityPacket)1 PEPacket (org.dragonet.net.packet.minecraft.PEPacket)1