RKB00005 - Glease/RKB GitHub Wiki

Actually these are something I discovered during the research. May come in handy later.

  1. ASMModParser is badly named. Probably ASMModClassFileParser. It's constructed on a per jar enrty basis.
  2. CoreModManager has many confusing variable names. They are just legacy issues. If you find yourself lost, just imagine you are facing a pre 1.6 mc then you will understand what it stands for before and now.
  3. IFMLLoadingPlugin may have an annotation named @DependsOn which is not functioning. The fml record them, store it somewhere, and that's all. That data is hidden in a public field of private class. TODO this still need more verification.
  4. ./config/fmlModState.properties may lets you specific some states of a mod. Code at Loader::disableRequestedMods
  5. Many interface/classes implicitly require you to have a public no arg constructor. Namely IClassTransformer, TileEntity, IModGuiFactory, Packet, StructureComponent, StructureStart, ModContainer, proxies defined in @SidedProxy, IFMLCallHook, IMessageHandler, ITweaker, IFMLLoadingPlugin. There are more to discover, just search for Class::newInstance usage in forgeSrc.jar.
  6. If you are ever using ModContainer::registerBus, you should notice this is not a fml event bus but a guava event bus, so don't use @SubscribeEvent or @EventHandler. guava eventbus don't know what they are.
  7. CapabilityManager uses Function<Capability<?>, Object> as callback functor, but they actually should be Consumer<Capability<?>>. Neither is its return value used, nor it ever return something other than null.
  8. Optimizing minecraft mods are usually: 1. don't do unnecessary thing 2. iterate over less data 3. stop O(n^2) from happening.

Not minecraft/forge stuff:

  1. Scala self type is actually sort of self type assertion, that is, it asserts itself to be such a type. For example

    trait Foo {}

    trait Bar { foo: Foo =>}

    this means Bar expect implementing class also mixin/implement/extend Foo. This is sometimes to used for DI, sort of werido. It doesn't seems to be DI actually.

  2. Scala seems has no generic methods. It has polymorphic methods instead. They seems to be identical.

⚠️ **GitHub.com Fallback** ⚠️