Minor refactoring.
Replaced use of reflection with use of functional factory interface (API change).
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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) {
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user