RKB00005 - Glease/RKB GitHub Wiki
Actually these are something I discovered during the research. May come in handy later.
-
ASMModParser
is badly named. ProbablyASMModClassFileParser
. It's constructed on a per jar enrty basis. -
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. -
TODO this still need more verification.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. - ./config/fmlModState.properties may lets you specific some states of a mod. Code at Loader::disableRequestedMods
- 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. - 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. -
CapabilityManager
usesFunction<Capability<?>, Object>
as callback functor, but they actually should beConsumer<Capability<?>>
. Neither is its return value used, nor it ever return something other than null. - 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:
-
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.
-
Scala seems has no generic methods. It has polymorphic methods instead. They seems to be identical.