当前位置: 首页>>代码示例>>Java>>正文


Java PacketDispatcher.getPacket方法代码示例

本文整理汇总了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() );
}
 
开发者ID:Maxwolf,项目名称:MC-MineAPI.Java,代码行数:9,代码来源:PacketList.java

示例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());
}
 
开发者ID:PaleoCrafter,项目名称:R0b0ts,代码行数:9,代码来源:PacketBase.java

示例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!");
}
 
开发者ID:PaleoCrafter,项目名称:PaleoMachineFramework,代码行数:12,代码来源:PaleoPacket.java

示例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());
}
 
开发者ID:PaleoCrafter,项目名称:PowerGrid,代码行数:8,代码来源:BasePacket.java

示例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());
}
 
开发者ID:ExtraCells,项目名称:ExtraCells1,代码行数:8,代码来源:AbstractPacket.java

示例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());
}
 
开发者ID:Hunternif,项目名称:Dota2Items,代码行数:7,代码来源:CustomPacket.java

示例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());
}
 
开发者ID:The-TTP-Project,项目名称:ALttC,代码行数:7,代码来源:CentralPacket.java

示例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());
}
 
开发者ID:ZL123,项目名称:GlowTools,代码行数:7,代码来源:GTPacket.java

示例9: makeNBTPacket

import cpw.mods.fml.common.network.PacketDispatcher; //导入方法依赖的package包/类
public static Packet makeNBTPacket(String channel, NBTTagCompound nbtTagCompound)
{
    return PacketDispatcher.getPacket(channel, nbtToByteArray(nbtTagCompound));
}
 
开发者ID:CCM-Modding,项目名称:Nucleum-Omnium,代码行数:5,代码来源:NetworkHelper.java


注:本文中的cpw.mods.fml.common.network.PacketDispatcher.getPacket方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。