Minor refactoring.

Replaced use of reflection with use of functional factory interface (API change).
This commit is contained in:
Sebastian Hartte
2020-06-30 18:57:26 +02:00
parent d17f8cec92
commit 8d8d3dd2d7
6 changed files with 89 additions and 44 deletions
+2 -1
View File
@@ -42,7 +42,7 @@ import appeng.util.ReadOnlyCollection;
public class Grid implements IGrid {
private final NetworkEventBus eventBus = new NetworkEventBus();
private final Map<Class<? extends IGridHost>, MachineSet> machines = new HashMap<>();
private final Map<Class<? extends IGridCache>, GridCacheWrapper> caches = new HashMap<>();
private final Map<Class<? extends IGridCache>, GridCacheWrapper> caches;
private GridNode pivot;
private int priority; // how import is this network?
private GridStorage myStorage;
@@ -52,6 +52,7 @@ public class Grid implements IGrid {
final Map<Class<? extends IGridCache>, IGridCache> myCaches = AEApi.instance().registries().gridCache()
.createCacheInstance(this);
this.caches = new HashMap<>(myCaches.size());
for (final Entry<Class<? extends IGridCache>, IGridCache> c : myCaches.entrySet()) {
final Class<? extends IGridCache> key = c.getKey();
final IGridCache value = c.getValue();