use of net.minecraft.network.PacketByteBuf in project Polymorph by TheIllusiveC4.
the class PolymorphPacketDistributorImpl method sendPlayerRecipeSelectionC2S.
@Override
public void sendPlayerRecipeSelectionC2S(Identifier pIdentifier) {
PacketByteBuf buf = PacketByteBufs.create();
buf.writeIdentifier(pIdentifier);
ClientPlayNetworking.send(PolymorphPackets.PLAYER_SELECT, buf);
}
use of net.minecraft.network.PacketByteBuf in project Polymorph by TheIllusiveC4.
the class PolymorphPacketDistributorImpl method sendHighlightRecipeS2C.
@Override
public void sendHighlightRecipeS2C(ServerPlayerEntity pPlayer, Identifier pIdentifier) {
PacketByteBuf buf = PacketByteBufs.create();
buf.writeIdentifier(pIdentifier);
ServerPlayNetworking.send(pPlayer, PolymorphPackets.HIGHLIGHT_RECIPE, buf);
}
use of net.minecraft.network.PacketByteBuf in project Polymorph by TheIllusiveC4.
the class RoughlyEnoughItemsModule method selectRecipe.
public static void selectRecipe(Display pRecipeDisplay) {
pRecipeDisplay.getDisplayLocation().ifPresent(recipe -> {
PacketByteBuf buf = PacketByteBufs.create();
buf.writeIdentifier(recipe);
ClientPlayNetworking.send(PolymorphPackets.PLAYER_SELECT, buf);
});
}
use of net.minecraft.network.PacketByteBuf in project SpeedRunIGT by RedLime.
the class TimerPacketHandler method sendCompleteC2S.
/*
Timer complete packets
*/
public static void sendCompleteC2S(InGameTimer timer) {
if (!SpeedRunOption.getOption(SpeedRunOptions.AUTOMATIC_COOP_MODE))
return;
PacketByteBuf passedData = new PacketByteBuf(Unpooled.buffer());
passedData.writeLong(timer.endTime);
if (client.getNetworkHandler() != null)
client.getNetworkHandler().getConnection().send(new CustomPayloadC2SPacket(PACKET_TIMER_COMPLETE_ID, passedData));
}
use of net.minecraft.network.PacketByteBuf in project SpeedRunIGT by RedLime.
the class TimerPacketHandler method sendInitS2C.
public static void sendInitS2C(List<ServerPlayerEntity> players, long startTime, RunCategory category) {
PacketByteBuf passedData = new PacketByteBuf(Unpooled.buffer());
passedData.writeLong(startTime);
passedData.writeString(category.getID());
CustomPayloadS2CPacket s2CPacket = new CustomPayloadS2CPacket(PACKET_TIMER_INIT_ID, passedData);
for (ServerPlayerEntity player : players) {
player.networkHandler.sendPacket(s2CPacket);
}
}
Aggregations