use of net.minecraft.network.PacketBuffer in project Wurst-MC-1.12 by Wurst-Imperium.
the class LogSpammerMod method onEnable.
@Override
public void onEnable() {
random = new Random();
payload = new PacketBuffer(Unpooled.buffer());
byte[] rawPayload = new byte[random.nextInt(128)];
random.nextBytes(rawPayload);
payload.writeBytes(rawPayload);
wurst.events.add(UpdateListener.class, this);
}
use of net.minecraft.network.PacketBuffer in project RFTools by McJty.
the class PacketModuleUpdate method fromBytes.
@Override
public void fromBytes(ByteBuf buf) {
pos = NetworkTools.readPos(buf);
slotIndex = buf.readInt();
PacketBuffer buffer = new PacketBuffer(buf);
try {
tagCompound = buffer.readCompoundTag();
} catch (IOException e) {
Logging.logError("Error updating module", e);
}
}
use of net.minecraft.network.PacketBuffer in project RFTools by McJty.
the class PacketModuleUpdate method toBytes.
@Override
public void toBytes(ByteBuf buf) {
NetworkTools.writePos(buf, pos);
buf.writeInt(slotIndex);
PacketBuffer buffer = new PacketBuffer(buf);
buffer.writeCompoundTag(tagCompound);
}
use of net.minecraft.network.PacketBuffer in project BloodMagic by WayofTime.
the class ItemRouterButtonPacketProcessor method fromBytes.
@Override
public void fromBytes(ByteBuf buffer) {
PacketBuffer buff = new PacketBuffer(buffer);
dimension = buff.readInt();
pos = buff.readBlockPos();
buttonPress = buff.readInt();
}
use of net.minecraft.network.PacketBuffer in project BloodMagic by WayofTime.
the class PlayerFallDistancePacketProcessor method toBytes.
@Override
public void toBytes(ByteBuf buffer) {
PacketBuffer buff = new PacketBuffer(buffer);
buff.writeFloat(fallDistance);
}
Aggregations