use of net.minecraft.network.PacketByteBuf in project Polymorph by TheIllusiveC4.
the class PolymorphPacketDistributorImpl method sendRecipesListS2C.
@Override
public void sendRecipesListS2C(ServerPlayerEntity pPlayer, SortedSet<RecipePair> pRecipesList, Identifier pSelected) {
PacketByteBuf buf = PacketByteBufs.create();
if (!pRecipesList.isEmpty()) {
buf.writeInt(pRecipesList.size());
for (RecipePair data : pRecipesList) {
buf.writeIdentifier(data.getIdentifier());
buf.writeItemStack(data.getOutput());
}
if (pSelected != null) {
buf.writeIdentifier(pSelected);
}
}
ServerPlayNetworking.send(pPlayer, PolymorphPackets.RECIPES_LIST, buf);
}
use of net.minecraft.network.PacketByteBuf in project SpeedRunIGT by RedLime.
the class TimerPacketHandler method sendInitC2S.
public static void sendInitC2S(long time, RunCategory category) {
if (!SpeedRunOption.getOption(SpeedRunOptions.AUTOMATIC_COOP_MODE))
return;
PacketByteBuf passedData = new PacketByteBuf(Unpooled.buffer());
passedData.writeLong(time);
passedData.writeString(category.getID());
if (client.getNetworkHandler() != null)
client.getNetworkHandler().getConnection().send(new CustomPayloadC2SPacket(PACKET_TIMER_INIT_ID, passedData));
}
use of net.minecraft.network.PacketByteBuf in project BleachHack by BleachDrinker420.
the class PlayerInteractEntityC2SUtils method getEntity.
public static Entity getEntity(PlayerInteractEntityC2SPacket packet) {
PacketByteBuf packetBuf = new PacketByteBuf(Unpooled.buffer());
packet.write(packetBuf);
return MinecraftClient.getInstance().world.getEntityById(packetBuf.readVarInt());
}
use of net.minecraft.network.PacketByteBuf in project Biome-Makeover by Lemonszz.
the class PoltergeistHandler method doParticles.
public static void doParticles(World world, BlockPos pos) {
PacketByteBuf data = new PacketByteBuf(Unpooled.buffer());
data.writeInt(pos.getX());
data.writeInt(pos.getY());
data.writeInt(pos.getZ());
NetworkUtil.serverSendTracking(world, pos, BMNetwork.SPAWN_POLTERGEIGHT_PARTICLE, data);
}
use of net.minecraft.network.PacketByteBuf in project Biome-Makeover by Lemonszz.
the class EffectHelper method doEffect.
public static void doEffect(World world, int effect, BlockPos pos) {
if (world.isClient())
return;
PacketByteBuf buf = PacketByteBufs.create();
buf.writeVarInt(effect);
buf.writeBlockPos(pos);
NetworkUtil.serverSendTracking(world, pos, BMNetwork.BM_EVENT, buf);
}
Aggregations