本文整理汇总了Java中cpw.mods.fml.common.network.PacketDispatcher.getPacket方法的典型用法代码示例。如果您正苦于以下问题:Java PacketDispatcher.getPacket方法的具体用法?Java PacketDispatcher.getPacket怎么用?Java PacketDispatcher.getPacket使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cpw.mods.fml.common.network.PacketDispatcher
的用法示例。
在下文中一共展示了PacketDispatcher.getPacket方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: makePacket
import cpw.mods.fml.common.network.PacketDispatcher; //导入方法依赖的package包/类
public final Packet makePacket()
{
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeByte( getPacketId() );
write( out );
return PacketDispatcher.getPacket( ModMetadata.CHANNEL_NAME,
out.toByteArray() );
}
示例2: makePacket
import cpw.mods.fml.common.network.PacketDispatcher; //导入方法依赖的package包/类
public final Packet makePacket()
{
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeByte(getPacketId());
write(out);
return PacketDispatcher.getPacket(Reference.CHANNEL_NAME,
out.toByteArray());
}
示例3: makePacket
import cpw.mods.fml.common.network.PacketDispatcher; //导入方法依赖的package包/类
public final Packet makePacket() throws IllegalArgumentException {
if (PaleoPacketHandler.CHANNEL_NAME != null) {
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeByte(getPacketId());
write(out);
return PacketDispatcher.getPacket(PaleoPacketHandler.CHANNEL_NAME,
out.toByteArray());
}
throw new IllegalArgumentException(
"You have to define a channel for the PowerGrid packets first!");
}
示例4: makePacket
import cpw.mods.fml.common.network.PacketDispatcher; //导入方法依赖的package包/类
public final Packet makePacket() {
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeByte(getPacketId());
write(out);
return PacketDispatcher.getPacket(PowerGrid.CHANNEL_NAME,
out.toByteArray());
}
示例5: makePacket
import cpw.mods.fml.common.network.PacketDispatcher; //导入方法依赖的package包/类
public final Packet makePacket()
{
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeByte(getPacketId());
write(out);
return PacketDispatcher.getPacket(CHANNEL, out.toByteArray());
}
示例6: makePacket
import cpw.mods.fml.common.network.PacketDispatcher; //导入方法依赖的package包/类
public final Packet makePacket() {
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeByte(getPacketId());
write(out);
return PacketDispatcher.getPacket(Dota2Items.CHANNEL, out.toByteArray());
}
示例7: makePacket
import cpw.mods.fml.common.network.PacketDispatcher; //导入方法依赖的package包/类
public final Packet makePacket() {
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeByte(getPacketId());
write(out);
return PacketDispatcher.getPacket(CHANNEL, out.toByteArray());
}
示例8: makePacket
import cpw.mods.fml.common.network.PacketDispatcher; //导入方法依赖的package包/类
public final Packet makePacket() {
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeByte(getPacketId());
write(out);
return PacketDispatcher.getPacket(Reference.PACKETCHANNEL_GT, out.toByteArray());
}
示例9: makeNBTPacket
import cpw.mods.fml.common.network.PacketDispatcher; //导入方法依赖的package包/类
public static Packet makeNBTPacket(String channel, NBTTagCompound nbtTagCompound)
{
return PacketDispatcher.getPacket(channel, nbtToByteArray(nbtTagCompound));
}