當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。