Java 类cpw.mods.fml.common.eventhandler.EventBus 实例源码

项目:bit-client    文件:Dispatcher.java   
private int getBusID(EventBus a) {
    try {
        Field declaredField = EventBus.class.getDeclaredField("busID");
        declaredField.setAccessible(true);
        return declaredField.getInt(a);
    } catch (Exception ex) {
        return 0;
    }
}
项目:TRHS_Club_Mod_2016    文件:FMLClientHandler.java   
@Override
public void fireNetRegistrationEvent(EventBus bus, NetworkManager manager, Set<String> channelSet, String channel, Side side)
{
    if (side == Side.CLIENT)
    {
        waitForPlayClient();
        bus.post(new FMLNetworkEvent.CustomPacketRegistrationEvent<NetHandlerPlayClient>(manager, channelSet, channel, side, NetHandlerPlayClient.class));
    }
    else
    {
        bus.post(new FMLNetworkEvent.CustomPacketRegistrationEvent<NetHandlerPlayServer>(manager, channelSet, channel, side, NetHandlerPlayServer.class));
    }
}
项目:CauldronGit    文件:FMLClientHandler.java   
@Override
public void fireNetRegistrationEvent(EventBus bus, NetworkManager manager, Set<String> channelSet, String channel, Side side)
{
    if (side == Side.CLIENT)
    {
        waitForPlayClient();
        bus.post(new FMLNetworkEvent.CustomPacketRegistrationEvent<NetHandlerPlayClient>(manager, channelSet, channel, side, NetHandlerPlayClient.class));
    }
    else
    {
        bus.post(new FMLNetworkEvent.CustomPacketRegistrationEvent<NetHandlerPlayServer>(manager, channelSet, channel, side, NetHandlerPlayServer.class));
    }
}
项目:ThaumicEnergistics    文件:MEItemAspectBridgeContainer.java   
/**
 * Constructs a pseudo container that TC can use to 'see' the items in the
 * ME network.
 *
 * @param inventorySize
 * @throws Exception
 * When the TC rendering code can not be found, the bridge will not
 * construct.
 */
public MEItemAspectBridgeContainer( final int inventorySize ) throws Exception
{
    // Create the inventory
    this.internalInventory = new TheInternalInventory( "TC Inventory Bridge", inventorySize, 1 );

    // Have we hooked to TC's event handler?
    if( thaumcraftClientEvents.get() == null )
    {
        // Access the listenerOwners field
        Field loField = EventBus.class.getDeclaredField( "listenerOwners" );
        loField.setAccessible( true );

        // Get the owners
        Map<Object, ModContainer> owners = (Map<Object, ModContainer>)loField.get( FMLCommonHandler.instance().bus() );

        // Attempt to locate TC's event handler
        for( Entry<Object, ModContainer> set : owners.entrySet() )
        {
            Object Owner = set.getKey();

            if( Owner instanceof thaumcraft.client.lib.ClientTickEventsFML )
            {
                thaumcraftClientEvents = new WeakReference<ClientTickEventsFML>( (ClientTickEventsFML)Owner );
                break;
            }
        }

        // Get rid of the references, cause I'm paranoid.
        owners = null;
        loField = null;

        // Did we locate it?
        if( thaumcraftClientEvents == null )
        {
            throw new Exception( "Unable to find TC event handler" );
        }
    }

}
项目:Cauldron    文件:FMLClientHandler.java   
@Override
public void fireNetRegistrationEvent(EventBus bus, NetworkManager manager, Set<String> channelSet, String channel, Side side)
{
    if (side == Side.CLIENT)
    {
        waitForPlayClient();
        bus.post(new FMLNetworkEvent.CustomPacketRegistrationEvent<NetHandlerPlayClient>(manager, channelSet, channel, side, NetHandlerPlayClient.class));
    }
    else
    {
        bus.post(new FMLNetworkEvent.CustomPacketRegistrationEvent<NetHandlerPlayServer>(manager, channelSet, channel, side, NetHandlerPlayServer.class));
    }
}
项目:Cauldron    文件:FMLClientHandler.java   
@Override
public void fireNetRegistrationEvent(EventBus bus, NetworkManager manager, Set<String> channelSet, String channel, Side side)
{
    if (side == Side.CLIENT)
    {
        waitForPlayClient();
        bus.post(new FMLNetworkEvent.CustomPacketRegistrationEvent<NetHandlerPlayClient>(manager, channelSet, channel, side, NetHandlerPlayClient.class));
    }
    else
    {
        bus.post(new FMLNetworkEvent.CustomPacketRegistrationEvent<NetHandlerPlayServer>(manager, channelSet, channel, side, NetHandlerPlayServer.class));
    }
}
项目:Cauldron    文件:FMLClientHandler.java   
@Override
public void fireNetRegistrationEvent(EventBus bus, NetworkManager manager, Set<String> channelSet, String channel, Side side)
{
    if (side == Side.CLIENT)
    {
        waitForPlayClient();
        bus.post(new FMLNetworkEvent.CustomPacketRegistrationEvent<NetHandlerPlayClient>(manager, channelSet, channel, side, NetHandlerPlayClient.class));
    }
    else
    {
        bus.post(new FMLNetworkEvent.CustomPacketRegistrationEvent<NetHandlerPlayServer>(manager, channelSet, channel, side, NetHandlerPlayServer.class));
    }
}
项目:bit-client    文件:Dispatcher.java   
public void register(IEventListener listener, EventBus bus, Class<? extends Event> clazz) {
    try {
        clazz.newInstance().getListenerList().register(getBusID(bus), EventPriority.NORMAL, listener);
    } catch (Exception e) {
    }
}
项目:bit-client    文件:Dispatcher.java   
public void unregister(IEventListener listener, EventBus bus, Class<? extends Event> clazz) {
    try {
        clazz.newInstance().getListenerList().unregister(getBusID(bus), listener);
    } catch (Exception e) {
    }
}
项目:TRHS_Club_Mod_2016    文件:FMLServerHandler.java   
@Override
public void fireNetRegistrationEvent(EventBus bus, NetworkManager manager, Set<String> channelSet, String channel, Side side)
{
    bus.post(new FMLNetworkEvent.CustomPacketRegistrationEvent<NetHandlerPlayServer>(manager, channelSet, channel, side, NetHandlerPlayServer.class));
}
项目:TRHS_Club_Mod_2016    文件:FMLEventChannel.java   
FMLEventChannel(String name)
{
    this.channels = NetworkRegistry.INSTANCE.newChannel(name, new NetworkEventFiringHandler(this));
    this.eventBus = new EventBus();
}
项目:CauldronGit    文件:FMLServerHandler.java   
@Override
public void fireNetRegistrationEvent(EventBus bus, NetworkManager manager, Set<String> channelSet, String channel, Side side)
{
    bus.post(new FMLNetworkEvent.CustomPacketRegistrationEvent<NetHandlerPlayServer>(manager, channelSet, channel, side, NetHandlerPlayServer.class));
}
项目:CauldronGit    文件:FMLEventChannel.java   
FMLEventChannel(String name)
{
    this.channels = NetworkRegistry.INSTANCE.newChannel(name, new NetworkEventFiringHandler(this));
    this.eventBus = new EventBus();
}
项目:EnderCore    文件:Handlers.java   
private HandlerType(String eventIdentifier, EventBus bus) {
  this.eventIdentifier = eventIdentifier;
  this.bus = bus;
}
项目:KoreSample    文件:ForgeEventListener.java   
public void listen(EventBus eventBus)
{
    eventBus.register(this);
}
项目:RobotPlates    文件:ClientProxy.java   
@Override
public void registerEventHandlers(EventBus bus) {
    MinecraftForge.EVENT_BUS.register(DrawBlockHighlightEventHandler.getInstance());
}
项目:KoreSample    文件:ForgeEventListener.java   
public void listen(EventBus eventBus)
{
    eventBus.register(this);
}
项目:Cauldron    文件:FMLServerHandler.java   
@Override
public void fireNetRegistrationEvent(EventBus bus, NetworkManager manager, Set<String> channelSet, String channel, Side side)
{
    bus.post(new FMLNetworkEvent.CustomPacketRegistrationEvent<NetHandlerPlayServer>(manager, channelSet, channel, side, NetHandlerPlayServer.class));
}
项目:Cauldron    文件:FMLEventChannel.java   
FMLEventChannel(String name)
{
    this.channels = NetworkRegistry.INSTANCE.newChannel(name, new NetworkEventFiringHandler(this));
    this.eventBus = new EventBus();
}
项目:Cauldron    文件:FMLServerHandler.java   
@Override
public void fireNetRegistrationEvent(EventBus bus, NetworkManager manager, Set<String> channelSet, String channel, Side side)
{
    bus.post(new FMLNetworkEvent.CustomPacketRegistrationEvent<NetHandlerPlayServer>(manager, channelSet, channel, side, NetHandlerPlayServer.class));
}
项目:Cauldron    文件:FMLEventChannel.java   
FMLEventChannel(String name)
{
    this.channels = NetworkRegistry.INSTANCE.newChannel(name, new NetworkEventFiringHandler(this));
    this.eventBus = new EventBus();
}
项目:Cauldron    文件:FMLServerHandler.java   
@Override
public void fireNetRegistrationEvent(EventBus bus, NetworkManager manager, Set<String> channelSet, String channel, Side side)
{
    bus.post(new FMLNetworkEvent.CustomPacketRegistrationEvent<NetHandlerPlayServer>(manager, channelSet, channel, side, NetHandlerPlayServer.class));
}
项目:Cauldron    文件:FMLEventChannel.java   
FMLEventChannel(String name)
{
    this.channels = NetworkRegistry.INSTANCE.newChannel(name, new NetworkEventFiringHandler(this));
    this.eventBus = new EventBus();
}
项目:TRHS_Club_Mod_2016    文件:FMLCommonHandler.java   
/**
 * The FML event bus. Subscribe here for FML related events
 *
 * @return the event bus
 */
public EventBus bus()
{
    return eventBus;
}
项目:CauldronGit    文件:FMLCommonHandler.java   
/**
 * The FML event bus. Subscribe here for FML related events
 *
 * @return the event bus
 */
public EventBus bus()
{
    return eventBus;
}
项目:RobotPlates    文件:ServerProxy.java   
@Override
public void registerEventHandlers(EventBus bus) {


    bus.register(TickEventHandler.getInstance());
}
项目:Cauldron    文件:FMLCommonHandler.java   
/**
 * The FML event bus. Subscribe here for FML related events
 *
 * @return the event bus
 */
public EventBus bus()
{
    return eventBus;
}
项目:Cauldron    文件:FMLCommonHandler.java   
/**
 * The FML event bus. Subscribe here for FML related events
 *
 * @return the event bus
 */
public EventBus bus()
{
    return eventBus;
}
项目:Cauldron    文件:FMLCommonHandler.java   
/**
 * The FML event bus. Subscribe here for FML related events
 *
 * @return the event bus
 */
public EventBus bus()
{
    return eventBus;
}
项目:TRHS_Club_Mod_2016    文件:IFMLSidedHandler.java   
void fireNetRegistrationEvent(EventBus bus, NetworkManager manager, Set<String> channelSet, String channel, Side side);
项目:CauldronGit    文件:IFMLSidedHandler.java   
void fireNetRegistrationEvent(EventBus bus, NetworkManager manager, Set<String> channelSet, String channel, Side side);
项目:RobotPlates    文件:IProxy.java   
void registerEventHandlers(EventBus bus);
项目:Cauldron    文件:IFMLSidedHandler.java   
void fireNetRegistrationEvent(EventBus bus, NetworkManager manager, Set<String> channelSet, String channel, Side side);
项目:Cauldron    文件:IFMLSidedHandler.java   
void fireNetRegistrationEvent(EventBus bus, NetworkManager manager, Set<String> channelSet, String channel, Side side);
项目:Cauldron    文件:IFMLSidedHandler.java   
void fireNetRegistrationEvent(EventBus bus, NetworkManager manager, Set<String> channelSet, String channel, Side side);