use of net.minecraft.network.PacketBuffer in project MinecraftForge by MinecraftForge.
the class FMLHandshakeMessage method makeCustomChannelRegistration.
public static FMLProxyPacket makeCustomChannelRegistration(Set<String> channels) {
String salutation = Joiner.on('\0').join(Iterables.concat(Arrays.asList("FML|HS", "FML", "FML|MP"), channels));
FMLProxyPacket proxy = new FMLProxyPacket(new PacketBuffer(Unpooled.wrappedBuffer(salutation.getBytes(Charsets.UTF_8))), "REGISTER");
return proxy;
}
use of net.minecraft.network.PacketBuffer in project MinecraftForge by MinecraftForge.
the class ForgeNetworkTestMod method onPlayerLogin.
@SubscribeEvent
public void onPlayerLogin(PlayerLoggedInEvent e) {
if (channel == null)
return;
PacketBuffer buffer = new PacketBuffer(Unpooled.buffer());
buffer.writeByte(0);
// disconnects vanilla clients in 1.11
channel.sendTo(new FMLProxyPacket(buffer, MOD_ID), (EntityPlayerMP) e.player);
}
use of net.minecraft.network.PacketBuffer in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.
the class PilotControlsMessage method fromBytes.
@Override
public void fromBytes(ByteBuf buf) {
PacketBuffer packetBuf = new PacketBuffer(buf);
airshipUp = packetBuf.readBoolean();
airshipDown = packetBuf.readBoolean();
airshipForward = packetBuf.readBoolean();
airshipBackward = packetBuf.readBoolean();
airshipLeft = packetBuf.readBoolean();
airshipRight = packetBuf.readBoolean();
airshipSprinting = packetBuf.readBoolean();
shipFor = packetBuf.readUuid();
}
use of net.minecraft.network.PacketBuffer in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.
the class PilotControlsMessage method toBytes.
@Override
public void toBytes(ByteBuf buf) {
PacketBuffer packetBuf = new PacketBuffer(buf);
packetBuf.writeBoolean(airshipUp);
packetBuf.writeBoolean(airshipDown);
packetBuf.writeBoolean(airshipForward);
packetBuf.writeBoolean(airshipBackward);
packetBuf.writeBoolean(airshipLeft);
packetBuf.writeBoolean(airshipRight);
packetBuf.writeBoolean(airshipSprinting);
packetBuf.writeUuid(shipFor);
}
use of net.minecraft.network.PacketBuffer in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.
the class SetShipPilotMessage method toBytes.
@Override
public void toBytes(ByteBuf buf) {
PacketBuffer packetBuffer = new PacketBuffer(buf);
packetBuffer.writeUuid(entityUniqueID);
}
Aggregations