ModuleRendering remove order calculation, add get/set init priority
@@ -76,6 +76,10 @@ public void initialise(Class clazz, int modulePriority) {
worldRenderer = context.get(WorldRenderer.class);
}
+ public Name getProvidingModule() {
+ return this.providingModule;
+ }
+
public void initialise(Class clazz) {
this.initialise(clazz, initializationPriority);
}
@@ -89,19 +93,10 @@ public int getInitPriority() {
return initializationPriority;
}
- public void setInitPriorit(int initPriority) {
+ public void setInitPriority(int initPriority) {
initializationPriority = initPriority;
}
- private List<ModuleRendering> calculateModuleOrder(ArrayList<ModuleRendering> activeRenderingModules) {
- // Inplace sorted copy of activeRenderingModules
- List<ModuleRendering> orderedRenderingModuleList = activeRenderingModules.stream()
- .sorted(Comparator.comparing(ModuleRendering::getInitPriority)) // sort ascending by initializationPriority attribute
- .collect(Collectors.toList()); //convert stream to List again
-
- return orderedRenderingModuleList;
- }
-
protected void setProvidingModule(Class implementingClass) {
ModuleManager moduleManager = context.get(ModuleManager.class);
this.providingModule = moduleManager.getEnvironment().getModuleProviding(implementingClass);
