本文整理汇总了Java中com.creativemd.creativecore.common.packet.CreativeCorePacket类的典型用法代码示例。如果您正苦于以下问题:Java CreativeCorePacket类的具体用法?Java CreativeCorePacket怎么用?Java CreativeCorePacket使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CreativeCorePacket类属于com.creativemd.creativecore.common.packet包,在下文中一共展示了CreativeCorePacket类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Init
import com.creativemd.creativecore.common.packet.CreativeCorePacket; //导入依赖的package包/类
@EventHandler
public void Init(FMLInitializationEvent event)
{
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
initClient();
ServerTick tick = new ServerTick();
MinecraftForge.EVENT_BUS.register(tick);
FMLCommonHandler.instance().bus().register(tick);
GuiHandler.registerGuiHandler(guiID, new HandGuiHandler());
CreativeCorePacket.registerPacket(ConsumeRecipePacket.class, "HCConsume");
CreativeCorePacket.registerPacket(FinishRecipePacket.class, "HCFinishRecipe");
Importer.registerImporter(new VanillaImporter());
if(Loader.isModLoaded("ingameconfigmanager"))
HandCraftConfigLoader.loadConfig();
}
示例2: processCommand
import com.creativemd.creativecore.common.packet.CreativeCorePacket; //导入依赖的package包/类
@Override
public void processCommand(ICommandSender icommandsender, String[] astring) {
List players = MinecraftServer.getServer().getConfigurationManager().playerEntityList;
EntityPlayer player = null;
for (int i = 0; i < players.size(); i++) {
if(((EntityPlayer)players.get(i)).getCommandSenderName().equals(icommandsender.getCommandSenderName()))
player = (EntityPlayer) players.get(i);
}
for (int j = 0; j < ConfigRegistry.systems.size(); j++) {
if(!ConfigRegistry.systems.get(j).needClientUpdate())
{
ArrayList<CreativeCorePacket> packets = SystemPacket.getPackets(j);
for (int i = 0; i < packets.size(); i++) {
PacketHandler.sendPacketToPlayer(packets.get(i), (EntityPlayerMP) player);
}
}
}
CraftingManagerMod.showGui(player, 0, true);
}
示例3: getPackets
import com.creativemd.creativecore.common.packet.CreativeCorePacket; //导入依赖的package包/类
public static ArrayList<CreativeCorePacket> getPackets(int id) {
ArrayList<CreativeCorePacket> packets = new ArrayList<CreativeCorePacket>();
ArrayList<PacketEntry> entries = ConfigRegistry.getConfigFromID(id).getPacketInformation();
ArrayList<PacketEntry> newentries = new ArrayList<PacketEntry>();
boolean first = true;
for (int i = 0; i < entries.size(); i++) {
newentries.add(entries.get(i));
if((i > 0 && (double)i/(double)maxEntriesInPacket == Math.floor((double)i/(double)maxEntriesInPacket)) || i == entries.size()-1)
{
packets.add(new SystemPacket(id, (ArrayList<PacketEntry>)newentries.clone(), first, i == entries.size()-1));
first = false;
newentries.clear();
}
}
return packets;
}
示例4: load
import com.creativemd.creativecore.common.packet.CreativeCorePacket; //导入依赖的package包/类
public static void load(FMLInitializationEvent event)
{
NetworkRegistry.INSTANCE.registerGuiHandler(CraftingManagerMod.instance, new GuiHandler());
MinecraftForge.EVENT_BUS.register(new com.creativemd.craftingmanager.mod.utils.EventHandler());
FMLCommonHandler.instance().bus().register(new com.creativemd.craftingmanager.mod.utils.EventHandler());
CreativeCorePacket.registerPacket(CraftResultPacket.class, "CraftResult");
CreativeCorePacket.registerPacket(GuiPacket.class, "ConfigGui");
CreativeCorePacket.registerPacket(GuiPopupPacket.class, "GuiPopup");
CreativeCorePacket.registerPacket(RecievePacket.class, "RecieveConfig");
CreativeCorePacket.registerPacket(SystemPacket.class, "CSystemUpdate");
//network.registerMessage((Class<? extends IMessageHandler<IMessage, IMessage>>)ReceiveHandler.class, (Class<? extends IMessage>)SystemPacket.class, 0, Side.CLIENT);
CraftingManagerMod.proxy.loadSide();
RecipeSorter.register("craftingmanager:bettershaped", BetterShapedRecipe.class, RecipeSorter.Category.SHAPED, "after:minecraft:shaped before:minecraft:shapeless");
RecipeSorter.register("craftingmanager:bettershapeless", BetterShapelessRecipe.class, RecipeSorter.Category.SHAPELESS, "after:minecraft:shapeless");
//PacketEntry.registerEntry(ArrayPacketEntry.class);
PacketEntry.registerEntry(IntegerPacketEntry.class);
PacketEntry.registerEntry(BooleanPacketEntry.class);
PacketEntry.registerEntry(StringPacketEntry.class);
StringUtils.loadUtils();
//Add Configs
CraftingManagerMod.coreSystem = (CoreSystem) ConfigRegistry.registerConfig(new CoreSystem());
CraftingManagerMod.disableSystem = (DisableSystem) ConfigRegistry.registerConfig(new DisableSystem());
CraftingManagerMod.addedSystem = (AddedSystem) ConfigRegistry.registerConfig(new AddedSystem());
CraftingManagerMod.disableFurnace = (DisableFurnace) ConfigRegistry.registerConfig(new DisableFurnace());
CraftingManagerMod.addFurnace = (AddFurnace) ConfigRegistry.registerConfig(new AddFurnace());
}
示例5: sendUpdateToServer
import com.creativemd.creativecore.common.packet.CreativeCorePacket; //导入依赖的package包/类
public static void sendUpdateToServer()
{
for(int zahl = 0; zahl < ConfigRegistry.systems.size(); zahl++)
{
ArrayList<CreativeCorePacket> packets = SystemPacket.getPackets(zahl);
for (int i = 0; i < packets.size(); i++) {
com.creativemd.craftingmanager.mod.utils.EventHandler.packetrequest.add(new PacketRequest(null, packets.get(i), true));
}
}
com.creativemd.craftingmanager.mod.utils.EventHandler.packetrequest.add(new PacketRequest(null, new RecievePacket(), true));
}
示例6: sendUpdateToAll
import com.creativemd.creativecore.common.packet.CreativeCorePacket; //导入依赖的package包/类
public static void sendUpdateToAll(int systemID)
{
ArrayList<CreativeCorePacket> packets = SystemPacket.getPackets(systemID);
for (int i = 0; i < packets.size(); i++) {
com.creativemd.craftingmanager.mod.utils.EventHandler.packetrequest.add(new PacketRequest(null, packets.get(i), false));
}
}
示例7: sendUpdateToClient
import com.creativemd.creativecore.common.packet.CreativeCorePacket; //导入依赖的package包/类
public static void sendUpdateToClient(EntityPlayer player)
{
for(int zahl = 0; zahl < ConfigRegistry.systems.size(); zahl++)
{
if(ConfigRegistry.systems.get(zahl).needClientUpdate())
{
ArrayList<CreativeCorePacket> packets = SystemPacket.getPackets(zahl);
for (int i = 0; i < packets.size(); i++) {
com.creativemd.craftingmanager.mod.utils.EventHandler.packetrequest.add(new PacketRequest((EntityPlayerMP) player, packets.get(i), false));
}
}
}
com.creativemd.craftingmanager.mod.utils.EventHandler.packetrequest.add(new PacketRequest(player, new RecievePacket(), false));
}
示例8: PacketRequest
import com.creativemd.creativecore.common.packet.CreativeCorePacket; //导入依赖的package包/类
public PacketRequest(EntityPlayer player, CreativeCorePacket packet, boolean toServer)
{
this.player = player;
this.packet = packet;
this.toServer = toServer;
}