private static void initMessages() {
   wrapper.registerMessage(
       MessageSyncMagicProperty.MessageHandler.class,
       MessageSyncMagicProperty.class,
       SYNC_MAGIC_PROPERTY_ID,
       Side.CLIENT);
   wrapper.registerMessage(
       MessageSetElement.MessageHandler.class,
       MessageSetElement.class,
       SET_ELEMENT_ID,
       Side.SERVER);
   wrapper.registerMessage(
       MessageSetLevel.MessageHandler.class, MessageSetLevel.class, SET_LEVEL_ID, Side.SERVER);
 }
示例#2
0
  @EventHandler
  public void preLoad(FMLPreInitializationEvent event) {
    snw = NetworkRegistry.INSTANCE.newSimpleChannel(modid);
    snw.registerMessage(TimeTravelerPacketHandler.class, Message.class, 0, Side.CLIENT);

    FMLCommonHandler.instance().bus().register(new TTEventHandler());
    FMLCommonHandler.instance().bus().register(new Ticker());
    MinecraftForge.EVENT_BUS.register(new TTEventHandler());
    MinecraftForge.EVENT_BUS.register(new Ticker());
  }
  @Mod.EventHandler
  public static void Init(FMLInitializationEvent event) {
    ForgeChunkManager.setForcedChunkLoadingCallback(
        EstateAgent.instance, new ChunkLoadingCallback());

    CraftingManager.getInstance()
        .addRecipe(
            new ItemStack(ModItems.landbook),
            "aaa",
            "aba",
            "aaa",
            'a',
            new ItemStack(Blocks.dirt),
            'b',
            new ItemStack(Items.book));

    simpleChannel = NetworkRegistry.INSTANCE.newSimpleChannel(References.MODNAME);
    simpleChannel.registerMessage(
        HandlerGeneralServer.class, PacketGeneralServer.class, 1, Side.SERVER);
    simpleChannel.registerMessage(
        HandlerGeneralClient.class, PacketGeneralClient.class, 2, Side.CLIENT);
  }
  @Mod.EventHandler
  public void init(FMLInitializationEvent event) {
    IEContent.init();

    GameRegistry.registerWorldGenerator(new IEWorldGen(), 0);
    MinecraftForge.EVENT_BUS.register(new EventHandler());
    FMLCommonHandler.instance().bus().register(new EventHandler());
    NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy);
    proxy.init();

    Lib.IC2 = Loader.isModLoaded("IC2") && Config.getBoolean("ic2compat");
    Lib.GREG = Loader.isModLoaded("gregtech") && Config.getBoolean("gregtechcompat");
    for (IECompatModule compat : IECompatModule.modules) compat.init();

    packetHandler.registerMessage(
        MessageMineralListSync.Handler.class, MessageMineralListSync.class, 0, Side.CLIENT);
  }
 private static void initMessages() {
   wrapper.registerMessage(
       MessageContainerSeedStorage.MessageHandler.class,
       MessageContainerSeedStorage.class,
       messageContainerSeedStorage_ID,
       Side.SERVER);
   wrapper.registerMessage(
       MessageGuiSeedStorageClearSeed.MessageHandler.class,
       MessageGuiSeedStorageClearSeed.class,
       messageGuiSeedStorageClearSeed_ID,
       Side.SERVER);
   wrapper.registerMessage(
       MessageTileEntitySeedStorage.MessageHandler.class,
       MessageTileEntitySeedStorage.class,
       messageTileEntitySeedStorage_ID,
       Side.CLIENT);
   wrapper.registerMessage(
       MessageSyncMutation.MessageHandler.class,
       MessageSyncMutation.class,
       messageSyncMutation_ID,
       Side.CLIENT);
   wrapper.registerMessage(
       MessageFertiliserApplied.MessageHandler.class,
       MessageFertiliserApplied.class,
       messageFertiliserApplied_ID,
       Side.CLIENT);
   wrapper.registerMessage(
       MessageSyncFluidLevel.MessageHandler.class,
       MessageSyncFluidLevel.class,
       messageSyncFluidlevel_ID,
       Side.CLIENT);
   wrapper.registerMessage(
       MessagePeripheralCheckNeighbours.MessageHandler.class,
       MessagePeripheralCheckNeighbours.class,
       messagePeripheralNeighBourCheck_ID,
       Side.CLIENT);
   wrapper.registerMessage(
       MessageSyncMultiBlock.MessageHandler.class,
       MessageSyncMultiBlock.class,
       messageSyncMultiBlock_ID,
       Side.CLIENT);
 }
  @Mod.EventHandler
  public void init(FMLInitializationEvent event) {
    IEContent.init();

    GameRegistry.registerWorldGenerator(new IEWorldGen(), 0);
    MinecraftForge.EVENT_BUS.register(new EventHandler());
    FMLCommonHandler.instance().bus().register(new EventHandler());
    NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy);
    proxy.init();

    Lib.IC2 = Loader.isModLoaded("IC2") && Config.getBoolean("ic2compat");
    Lib.GREG = Loader.isModLoaded("gregtech") && Config.getBoolean("gregtechcompat");
    Config.setBoolean("ic2Manual", Lib.IC2);
    Config.setBoolean("gregManual", Lib.GREG);
    for (IECompatModule compat : IECompatModule.modules) compat.init();

    int messageId = 0;
    packetHandler.registerMessage(
        MessageMineralListSync.Handler.class,
        MessageMineralListSync.class,
        messageId++,
        Side.CLIENT);
    packetHandler.registerMessage(
        MessageTileSync.Handler.class, MessageTileSync.class, messageId++, Side.SERVER);
    packetHandler.registerMessage(
        MessageSpeedloaderSync.Handler.class,
        MessageSpeedloaderSync.class,
        messageId++,
        Side.CLIENT);
    packetHandler.registerMessage(
        MessageSkyhookSync.Handler.class, MessageSkyhookSync.class, messageId++, Side.CLIENT);
    packetHandler.registerMessage(
        MessageMinecartShaderSync.HandlerServer.class,
        MessageMinecartShaderSync.class,
        messageId++,
        Side.SERVER);
    packetHandler.registerMessage(
        MessageMinecartShaderSync.HandlerClient.class,
        MessageMinecartShaderSync.class,
        messageId++,
        Side.CLIENT);
    packetHandler.registerMessage(
        MessageRequestBlockUpdate.Handler.class,
        MessageRequestBlockUpdate.class,
        messageId++,
        Side.SERVER);
  }
示例#7
0
  public static void registerMessages() {
    INSTANCE = NetworkRegistry.INSTANCE.newSimpleChannel("rftools");

    // Server side
    INSTANCE.registerMessage(
        PacketContentsMonitor.class, PacketContentsMonitor.class, nextID(), Side.SERVER);
    INSTANCE.registerMessage(
        PacketGetAdjacentBlocks.class, PacketGetAdjacentBlocks.class, nextID(), Side.SERVER);
    INSTANCE.registerMessage(
        PacketGetAdjacentTankBlocks.class,
        PacketGetAdjacentTankBlocks.class,
        nextID(),
        Side.SERVER);
    INSTANCE.registerMessage(PacketCrafter.class, PacketCrafter.class, nextID(), Side.SERVER);
    INSTANCE.registerMessage(
        PacketGetInventory.class, PacketGetInventory.class, nextID(), Side.SERVER);
    INSTANCE.registerMessage(
        PacketSearchItems.class, PacketSearchItems.class, nextID(), Side.SERVER);
    INSTANCE.registerMessage(
        PacketGetConnectedBlocks.class, PacketGetConnectedBlocks.class, nextID(), Side.SERVER);
    INSTANCE.registerMessage(
        PacketGetTransmitters.class, PacketGetTransmitters.class, nextID(), Side.SERVER);
    INSTANCE.registerMessage(
        PacketGetReceivers.class, PacketGetReceivers.class, nextID(), Side.SERVER);
    INSTANCE.registerMessage(
        PacketServerCommand.class, PacketServerCommand.class, nextID(), Side.SERVER);
    INSTANCE.registerMessage(
        PacketSetGuiStyle.class, PacketSetGuiStyle.class, nextID(), Side.SERVER);
    INSTANCE.registerMessage(
        PacketRequestIntegerFromServer.class,
        PacketRequestIntegerFromServer.class,
        nextID(),
        Side.SERVER);
    INSTANCE.registerMessage(
        PacketGetAllReceivers.class, PacketGetAllReceivers.class, nextID(), Side.SERVER);
    INSTANCE.registerMessage(
        PacketForceTeleport.class, PacketForceTeleport.class, nextID(), Side.SERVER);
    INSTANCE.registerMessage(PacketGetPlayers.class, PacketGetPlayers.class, nextID(), Side.SERVER);
    INSTANCE.registerMessage(
        PacketGetSecurityInfo.class, PacketGetSecurityInfo.class, nextID(), Side.SERVER);
    INSTANCE.registerMessage(
        PacketGetSecurityName.class, PacketGetSecurityName.class, nextID(), Side.SERVER);
    INSTANCE.registerMessage(PacketGetFilters.class, PacketGetFilters.class, nextID(), Side.SERVER);
    INSTANCE.registerMessage(
        PacketGetDelightingInfo.class, PacketGetDelightingInfo.class, nextID(), Side.SERVER);
    INSTANCE.registerMessage(
        PacketGetChamberInfo.class, PacketGetChamberInfo.class, nextID(), Side.SERVER);
    INSTANCE.registerMessage(
        PacketGetDimensionEnergy.class, PacketGetDimensionEnergy.class, nextID(), Side.SERVER);
    INSTANCE.registerMessage(
        PacketGetDestinationInfo.class, PacketGetDestinationInfo.class, nextID(), Side.SERVER);
    INSTANCE.registerMessage(
        PacketGetCountInfo.class, PacketGetCountInfo.class, nextID(), Side.SERVER);
    INSTANCE.registerMessage(
        PacketGetScreenData.class, PacketGetScreenData.class, nextID(), Side.SERVER);
    INSTANCE.registerMessage(
        PacketModuleUpdate.class, PacketModuleUpdate.class, nextID(), Side.SERVER);
    INSTANCE.registerMessage(
        PacketUpdateNBTItem.class, PacketUpdateNBTItem.class, nextID(), Side.SERVER);
    INSTANCE.registerMessage(
        PacketCycleStorage.class, PacketCycleStorage.class, nextID(), Side.SERVER);
    INSTANCE.registerMessage(PacketCompact.class, PacketCompact.class, nextID(), Side.SERVER);

    // Client side
    INSTANCE.registerMessage(
        PacketInventoryReady.class, PacketInventoryReady.class, nextID(), Side.CLIENT);
    INSTANCE.registerMessage(
        PacketSearchReady.class, PacketSearchReady.class, nextID(), Side.CLIENT);
    INSTANCE.registerMessage(
        PacketAdjacentBlocksReady.class, PacketAdjacentBlocksReady.class, nextID(), Side.CLIENT);
    INSTANCE.registerMessage(
        PacketAdjacentTankBlocksReady.class,
        PacketAdjacentTankBlocksReady.class,
        nextID(),
        Side.CLIENT);
    INSTANCE.registerMessage(
        PacketConnectedBlocksReady.class, PacketConnectedBlocksReady.class, nextID(), Side.CLIENT);
    INSTANCE.registerMessage(
        PacketTransmittersReady.class, PacketTransmittersReady.class, nextID(), Side.CLIENT);
    INSTANCE.registerMessage(
        PacketReceiversReady.class, PacketReceiversReady.class, nextID(), Side.CLIENT);
    INSTANCE.registerMessage(
        PacketIntegerFromServer.class, PacketIntegerFromServer.class, nextID(), Side.CLIENT);
    INSTANCE.registerMessage(
        PacketAllReceiversReady.class, PacketAllReceiversReady.class, nextID(), Side.CLIENT);
    INSTANCE.registerMessage(
        PacketPlayersReady.class, PacketPlayersReady.class, nextID(), Side.CLIENT);
    INSTANCE.registerMessage(
        PacketSecurityInfoReady.class, PacketSecurityInfoReady.class, nextID(), Side.CLIENT);
    INSTANCE.registerMessage(
        PacketSecurityNameReady.class, PacketSecurityNameReady.class, nextID(), Side.CLIENT);
    INSTANCE.registerMessage(
        PacketFiltersReady.class, PacketFiltersReady.class, nextID(), Side.CLIENT);
    INSTANCE.registerMessage(
        PacketDelightingInfoReady.class, PacketDelightingInfoReady.class, nextID(), Side.CLIENT);
    INSTANCE.registerMessage(
        PacketChamberInfoReady.class, PacketChamberInfoReady.class, nextID(), Side.CLIENT);
    INSTANCE.registerMessage(
        PacketSyncDimensionInfoHandler.class, PacketSyncDimensionInfo.class, nextID(), Side.CLIENT);
    INSTANCE.registerMessage(
        PacketCheckDimletConfigHandler.class, PacketCheckDimletConfig.class, nextID(), Side.CLIENT);
    INSTANCE.registerMessage(
        PacketReturnEnergyHandler.class, PacketReturnEnergy.class, nextID(), Side.CLIENT);
    INSTANCE.registerMessage(
        PacketReturnDestinationInfoHandler.class,
        PacketReturnDestinationInfo.class,
        nextID(),
        Side.CLIENT);
    INSTANCE.registerMessage(
        PacketReturnCountInfoHandler.class, PacketReturnCountInfo.class, nextID(), Side.CLIENT);
    INSTANCE.registerMessage(
        PacketReturnScreenDataHandler.class, PacketReturnScreenData.class, nextID(), Side.CLIENT);
    INSTANCE.registerMessage(
        PacketRegisterDimensionsHandler.class,
        PacketRegisterDimensions.class,
        nextID(),
        Side.CLIENT);
    INSTANCE.registerMessage(
        PacketSendBuffsToClientHandler.class, PacketSendBuffsToClient.class, nextID(), Side.CLIENT);
    INSTANCE.registerMessage(
        PacketSendPreferencesToClientHandler.class,
        PacketSendPreferencesToClient.class,
        nextID(),
        Side.CLIENT);
  }
 public static void init() {
   instance.registerMessage(
       RecyclerMessageServer.class, RecyclerMessageServer.class, 0, Side.CLIENT);
 }
 private static void registerMessage(Class packet, Class message) {
   net.registerMessage(packet, message, nextPacketId, Side.CLIENT);
   net.registerMessage(packet, message, nextPacketId, Side.SERVER);
   nextPacketId += 1;
 }