Esempio n. 1
0
 /**
  * Helper method for {@link #findHandlers(Class)}. Looks up only registered handlers and adds them
  * to the end of the given list.
  *
  * @param clazz
  * @param result
  */
 private void findRegisteredHandlers(Class<?> clazz, List<IHandler> result) {
   for (IHandler handler : handlers) {
     if (handler.canHandle(clazz)) {
       result.add(handler);
     }
   }
   final Registry thisParent = parent;
   if (thisParent != null) {
     thisParent.findRegisteredHandlers(clazz, result);
   }
 }
Esempio n. 2
0
  static {
    // TODO: move to an eioa registry
    GLOBAL_REGISTRY.register(new HandleStash());
    GLOBAL_REGISTRY.register(new HandleStatCollector());
    GLOBAL_REGISTRY.register(new HandleNotifSet());

    // TODO: move to an eio registry
    GLOBAL_REGISTRY.register(new HandleSmartTank());
    GLOBAL_REGISTRY.register(new HandleIMachineRecipe());

    // TODO: move to an ec registry
    GLOBAL_REGISTRY.register(new HandleBlockCoord());

    // Java primitives
    GLOBAL_REGISTRY.register(new HandleFloat());
    GLOBAL_REGISTRY.register(new HandleInteger());
    GLOBAL_REGISTRY.register(new HandleBoolean());
    GLOBAL_REGISTRY.register(new HandleFloatArray());
    GLOBAL_REGISTRY.register(new HandleEnum());

    // Forge basic types
    GLOBAL_REGISTRY.register(new HandleFluidStack());
    GLOBAL_REGISTRY.register(new HandleFluid());

    // Minecraft basic types
    GLOBAL_REGISTRY.register(new HandleItemStack());
    GLOBAL_REGISTRY.register(new HandleItem());

    // Annotated objects
    GLOBAL_REGISTRY.register(new HandleStorable());
  }