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


Java CreativeCorePacket类代码示例

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

示例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);
}
 
开发者ID:CreativeMD,项目名称:CraftingManager,代码行数:22,代码来源:CommandGUI.java

示例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;
}
 
开发者ID:CreativeMD,项目名称:CraftingManager,代码行数:17,代码来源:SystemPacket.java

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

示例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));
}
 
开发者ID:CreativeMD,项目名称:CraftingManager,代码行数:13,代码来源:CraftingMangerExternal.java

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

示例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));
}
 
开发者ID:CreativeMD,项目名称:CraftingManager,代码行数:15,代码来源:CraftingMangerExternal.java

示例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;
}
 
开发者ID:CreativeMD,项目名称:CraftingManager,代码行数:7,代码来源:EventHandler.java


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