use of net.minecraft.network.PacketByteBuf in project Biome-Makeover by Lemonszz.
the class EntityUtil method WriteEntitySpawn.
public static PacketByteBuf WriteEntitySpawn(Entity entity) {
PacketByteBuf buf = new PacketByteBuf(Unpooled.buffer());
buf.writeVarInt(Registry.ENTITY_TYPE.getRawId(entity.getType()));
buf.writeUuid(entity.getUuid());
buf.writeVarInt(entity.getEntityId());
buf.writeDouble(entity.getX());
buf.writeDouble(entity.getY());
buf.writeDouble(entity.getZ());
buf.writeFloat(entity.pitch);
buf.writeFloat(entity.yaw);
return buf;
}
use of net.minecraft.network.PacketByteBuf in project Biome-Makeover by Lemonszz.
the class NetworkUtil method doLightningEntity.
public static void doLightningEntity(World world, LivingEntity entity, int count) {
if (world.isClient)
return;
PacketByteBuf buf = new PacketByteBuf(Unpooled.buffer());
buf.writeInt(entity.getEntityId());
buf.writeInt(count);
serverSendTracking(world, entity.getBlockPos(), BMNetwork.SPAWN_LIGHTNING_ENTITY_PARTICLES, buf);
}
use of net.minecraft.network.PacketByteBuf in project Biome-Makeover by Lemonszz.
the class NetworkUtil method doEntityParticle.
public static void doEntityParticle(World world, ParticleEffect effect, Entity e, int count, float offset) {
if (world.isClient)
return;
PacketByteBuf buf = new PacketByteBuf(Unpooled.buffer());
buf.writeInt(e.getEntityId());
buf.writeInt(Registry.PARTICLE_TYPE.getRawId((ParticleType<?>) effect));
buf.writeInt(count);
buf.writeFloat(offset);
buf.writeDouble(world.random.nextGaussian() * 0.02D);
buf.writeDouble(world.random.nextGaussian() * 0.02D);
buf.writeDouble(world.random.nextGaussian() * 0.02D);
serverSendTracking(world, e.getBlockPos(), BMNetwork.ENTITY_PARTICLE, buf);
}
use of net.minecraft.network.PacketByteBuf in project Biome-Makeover by Lemonszz.
the class NetworkUtil method sendSlideTime.
public static void sendSlideTime(PlayerEntity player, int time) {
if (player.world.isClient())
return;
PacketByteBuf buf = new PacketByteBuf(Unpooled.buffer());
buf.writeVarInt(time);
ServerPlayNetworking.send((ServerPlayerEntity) player, BMNetwork.SET_SLIDE_TIME, buf);
}
use of net.minecraft.network.PacketByteBuf in project Biome-Makeover by Lemonszz.
the class NetworkUtil method doLightningSplash.
public static void doLightningSplash(World world, boolean doBottle, BlockPos pos) {
if (world.isClient)
return;
PacketByteBuf buf = new PacketByteBuf(Unpooled.buffer());
buf.writeBoolean(doBottle);
buf.writeBlockPos(pos);
serverSendTracking(world, pos, BMNetwork.SPAWN_LIGHTNING_BOTTLE_PARTICLES, buf);
}
Aggregations