Java 类cpw.mods.fml.common.network.IGuiHandler 实例源码

项目:ExtraUtilities    文件:ExtraUtils.java   
public void init(final FMLInitializationEvent event) {
    NetworkRegistry.INSTANCE.registerGuiHandler((Object)ExtraUtilsMod.instance, (IGuiHandler)new GuiHandler());
    if (Loader.isModLoaded("ForgeMultipart")) {
        this.FMPRegisterPassThroughInterfaces();
    }
    ExtraUtilsMod.proxy.registerEventHandler();
    ExtraUtilsMod.proxy.registerRenderInformation();
    if (Loader.isModLoaded("ThermalExpansion")) {
        TE4IMC.addIntegration();
    }
    if (Loader.isModLoaded("MineFactoryReloaded")) {
        MFRIntegration.registerMFRIntegration();
    }
    for (final ILoading loader : this.loaders) {
        loader.init();
    }
    EE3Integration.finalRegister();
}
项目:EnderIOAddons    文件:GuiIds.java   
static private int nextID() {

    try {
      Field field = EnderIO.guiHandler.getClass().getDeclaredField("guiHandlers");
      field.setAccessible(true);
      Map<Integer, IGuiHandler> guiHandlers = (Map<Integer, IGuiHandler>) field.get(EnderIO.guiHandler);

      while (++lastId > 0) {
        if (!guiHandlers.containsKey(lastId)) {
          return lastId;
        }
      }

    } catch (Exception e) {
      throw new RuntimeException(e);
    }

    return -1;
  }
项目:ForestryLegacy    文件:GuiHandler.java   
@Override
public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {

    if (id < GuiId.values().length) {
        switch (GuiId.values()[id]) {

        case SolderingIronGUI:
            return new GuiSolderingIron(player.inventory, new SolderingInventory());

        default:
            for (IGuiHandler handler : PluginManager.guiHandlers) {
                Object element = handler.getClientGuiElement(id, player, world, x, y, z);
                if (element != null)
                    return element;
            }

            return null;
        }
    }

    return null;
}
项目:ForestryLegacy    文件:GuiHandler.java   
@Override
public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {

    if (id < GuiId.values().length) {
        switch (GuiId.values()[id]) {

        case SolderingIronGUI:
            return new ContainerSolderingIron(player.inventory, new SolderingInventory());

        default:
            for (IGuiHandler handler : PluginManager.guiHandlers) {
                Object element = handler.getServerGuiElement(id, player, world, x, y, z);
                if (element != null)
                    return element;
            }

            return null;

        }
    }

    return null;
}
项目:PneumaticCraft    文件:ThirdPartyManager.java   
@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z){
    for(IThirdParty thirdParty : thirdPartyMods) {
        if(thirdParty instanceof IGuiHandler) {
            Object obj = ((IGuiHandler)thirdParty).getServerGuiElement(ID, player, world, x, y, z);
            if(obj != null) return obj;
        }
    }
    return null;
}
项目:PneumaticCraft    文件:ThirdPartyManager.java   
@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z){
    for(IThirdParty thirdParty : thirdPartyMods) {
        if(thirdParty instanceof IGuiHandler) {
            Object obj = ((IGuiHandler)thirdParty).getClientGuiElement(ID, player, world, x, y, z);
            if(obj != null) return obj;
        }
    }
    return null;
}
项目:RorysMod    文件:Register.java   
public static void registerGUI(IGuiHandler handler) {
    NetworkRegistry.INSTANCE.registerGuiHandler(RorysMod.instance, handler);
}
项目:RorysMod    文件:Register.java   
public static void registerGUI(Object mod, IGuiHandler handler) {
    NetworkRegistry.INSTANCE.registerGuiHandler(mod, handler);
}
项目:LambdaLib    文件:GuiHandlerRegistration.java   
public int addHandler(IGuiHandler handler) {
    subHandlers.add(handler);
    return subHandlers.size() - 1;
}
项目:LambdaLib    文件:GuiHandlerBase.java   
IGuiHandler getHandler() {
    return guiHandler;
}
项目:DynamicLib    文件:DynamicClientProxy.java   
@Override
public IGuiHandler wrapHandler(IGuiHandler modSpecificHandler) {
    return new ClientGuiHandler(modSpecificHandler);
}
项目:DynamicLib    文件:DynamicServerProxy.java   
@Override
public IGuiHandler wrapHandler(IGuiHandler modSpecificHandler) {
    return new CommonGuiHandler(modSpecificHandler);
}
项目:DynamicLib    文件:CommonGuiHandler.java   
public CommonGuiHandler(IGuiHandler wrappedHandler) {
    this.wrappedHandler = wrappedHandler;
}
项目:DynamicLib    文件:ClientGuiHandler.java   
public ClientGuiHandler(IGuiHandler wrappedHandler) {
    super (wrappedHandler);
}
项目:ForestryLegacy    文件:PluginPropolisPipe.java   
@Override
public IGuiHandler getGuiHandler() {
    return new GuiHandlerPipes();
}
项目:ForestryLegacy    文件:PluginForestryFarming.java   
@Override
public IGuiHandler getGuiHandler() {
    return new GuiHandlerFarming();
}
项目:ForestryLegacy    文件:PluginForestryArboriculture.java   
@Override
public IGuiHandler getGuiHandler() {
    return new GuiHandlerArboriculture();
}
项目:ForestryLegacy    文件:PluginForestryCultivation.java   
@Override
public IGuiHandler getGuiHandler() {
    return new GuiHandlerCultivation();
}
项目:ForestryLegacy    文件:PluginForestryFood.java   
@Override
public IGuiHandler getGuiHandler() {
    return new GuiHandlerFood();
}
项目:ForestryLegacy    文件:PluginForestryMail.java   
@Override
public IGuiHandler getGuiHandler() {
    return new GuiHandlerMail();
}
项目:ForestryLegacy    文件:PluginForestryFactory.java   
@Override
public IGuiHandler getGuiHandler() {
    return new GuiHandlerFactory();
}
项目:ForestryLegacy    文件:PluginForestryApiculture.java   
@Override
public IGuiHandler getGuiHandler() {
    return new GuiHandlerApiculture();
}
项目:ForestryLegacy    文件:PluginEE.java   
@Override
public IGuiHandler getGuiHandler() {
    return null;
}
项目:ForestryLegacy    文件:PluginForestryEnergy.java   
@Override
public IGuiHandler getGuiHandler() {
    return new GuiHandlerEnergy();
}
项目:ForestryLegacy    文件:PluginForestryStorage.java   
@Override
public IGuiHandler getGuiHandler() {
    return new GuiHandlerStorage();
}
项目:ForestryLegacy    文件:PluginForestryCore.java   
@Override
public IGuiHandler getGuiHandler() {
    return null;
}
项目:ForestryLegacy    文件:PluginBuildCraft.java   
@Override
public IGuiHandler getGuiHandler() {
    return null;
}
项目:ForestryLegacy    文件:PluginIC2.java   
@Override
public IGuiHandler getGuiHandler() {
    return null;
}
项目:ForestryLegacy    文件:PluginManager.java   
public static void addPlugin(ClassLoader classLoader, String pluginName, String packageName) {

        if (pluginName.equals("PluginManager.class") || pluginName.equals("PluginInfo.class"))
            return;

        String pluginClassName = packageName.replace(".class", "");

        try {

            Class<?> pluginClass = classLoader.loadClass(pluginClassName);
            if (pluginClass != null) {

                Class<?> clz = pluginClass;
                boolean isPlugin = false;
                do {
                    for(Class<?> i : clz.getInterfaces()) {
                        if(i == IPlugin.class) {
                            isPlugin = true;
                            break;
                        }
                    }

                    clz = clz.getSuperclass();
                } while(clz != null && !isPlugin);

                if(!isPlugin)
                    return;

                IPlugin plugin = (IPlugin) pluginClass.newInstance();
                if (plugin != null) {

                    Proxies.log.fine("Found plugin for " + plugin.getDescription());

                    plugins.add(plugin);

                    IGuiHandler guiHandler = plugin.getGuiHandler();
                    if (guiHandler != null) {
                        guiHandlers.add(guiHandler);
                    }

                    IPacketHandler packetHandler = plugin.getPacketHandler();
                    if (packetHandler != null) {
                        packetHandlers.add(packetHandler);
                    }

                    IPickupHandler pickupHandler = plugin.getPickupHandler();
                    if (pickupHandler != null) {
                        pickupHandlers.add(pickupHandler);
                    }

                    ISaveEventHandler saveHandler = plugin.getSaveEventHandler();
                    if (saveHandler != null) {
                        saveEventHandlers.add(saveHandler);
                    }

                    IResupplyHandler resupplyHandler = plugin.getResupplyHandler();
                    if (resupplyHandler != null) {
                        resupplyHandlers.add(resupplyHandler);
                    }

                    IOreDictionaryHandler dictionaryHandler = plugin.getDictionaryHandler();
                    if (dictionaryHandler != null) {
                        dictionaryHandlers.add(dictionaryHandler);
                    }
                }
            }

        } catch (Exception ex) {
            //ex.printStackTrace();
        }
    }
项目:Framez    文件:GuiHandlerWrapper.java   
public GuiHandlerWrapper(IGuiHandler handler) {

        this.handler = handler;
    }
项目:DynamicLib    文件:IDynamicProxy.java   
IGuiHandler wrapHandler(IGuiHandler modSpecificHandler);
项目:ForestryLegacy    文件:PluginFarmCraftory.java   
@Override public IGuiHandler getGuiHandler() { return null; }
项目:ForestryLegacy    文件:IPlugin.java   
public IGuiHandler getGuiHandler();