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();
-2
View File
@@ -21,7 +21,6 @@ package appeng.me.cache;
import java.util.HashMap;
import java.util.PriorityQueue;
import appeng.helpers.Reflected;
import com.google.common.base.Preconditions;
import net.minecraft.crash.CrashReport;
@@ -47,7 +46,6 @@ public class TickManagerCache implements ITickManager {
private long currentTick = 0;
@Reflected
public TickManagerCache(@SuppressWarnings("unused") final IGrid g) {
}