Search in sources :

Example 1 with EntitySpawnS2CPacket

use of net.minecraft.network.packet.s2c.play.EntitySpawnS2CPacket in project Paradise-Lost by devs-immortal.

the class AetherNonLivingEntity method createSpawnPacket.

@Override
public final Packet<?> createSpawnPacket() {
    PacketByteBuf buf = new PacketByteBuf(Unpooled.buffer());
    Identifier id = this.createSpawnPacket(buf);
    for (ServerPlayerEntity playerEntity : ((ServerWorld) this.world).getPlayers()) {
        ServerSidePacketRegistry.INSTANCE.sendToPlayer(playerEntity, id, buf);
    }
    return new EntitySpawnS2CPacket(this);
}
Also used : ServerWorld(net.minecraft.server.world.ServerWorld) Identifier(net.minecraft.util.Identifier) EntitySpawnS2CPacket(net.minecraft.network.packet.s2c.play.EntitySpawnS2CPacket) PacketByteBuf(net.minecraft.network.PacketByteBuf) ServerPlayerEntity(net.minecraft.server.network.ServerPlayerEntity)

Aggregations

PacketByteBuf (net.minecraft.network.PacketByteBuf)1 EntitySpawnS2CPacket (net.minecraft.network.packet.s2c.play.EntitySpawnS2CPacket)1 ServerPlayerEntity (net.minecraft.server.network.ServerPlayerEntity)1 ServerWorld (net.minecraft.server.world.ServerWorld)1 Identifier (net.minecraft.util.Identifier)1