The Great Renamening of 2020
This commit is contained in:
+6
-6
@@ -83,8 +83,8 @@ import appeng.crafting.CraftingWatcher;
|
||||
import appeng.me.cluster.implementations.CraftingCPUCluster;
|
||||
import appeng.me.helpers.BaseActionSource;
|
||||
import appeng.me.helpers.GenericInterestManager;
|
||||
import appeng.tile.crafting.TileCraftingStorageTile;
|
||||
import appeng.tile.crafting.TileCraftingTile;
|
||||
import appeng.tile.crafting.CraftingStorageTileEntity;
|
||||
import appeng.tile.crafting.CraftingTileEntity;
|
||||
|
||||
public class CraftingGridCache
|
||||
implements ICraftingGrid, ICraftingProviderHelper, ICellProvider, IMEInventoryHandler<IAEItemStack> {
|
||||
@@ -163,7 +163,7 @@ public class CraftingGridCache
|
||||
}
|
||||
}
|
||||
|
||||
if (machine instanceof TileCraftingTile) {
|
||||
if (machine instanceof CraftingTileEntity) {
|
||||
this.updateList = true;
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ public class CraftingGridCache
|
||||
}
|
||||
}
|
||||
|
||||
if (machine instanceof TileCraftingTile) {
|
||||
if (machine instanceof CraftingTileEntity) {
|
||||
this.updateList = true;
|
||||
}
|
||||
|
||||
@@ -264,8 +264,8 @@ public class CraftingGridCache
|
||||
private void updateCPUClusters() {
|
||||
this.craftingCPUClusters.clear();
|
||||
|
||||
for (final IGridNode cst : this.grid.getMachines(TileCraftingStorageTile.class)) {
|
||||
final TileCraftingStorageTile tile = (TileCraftingStorageTile) cst.getMachine();
|
||||
for (final IGridNode cst : this.grid.getMachines(CraftingStorageTileEntity.class)) {
|
||||
final CraftingStorageTileEntity tile = (CraftingStorageTileEntity) cst.getMachine();
|
||||
final CraftingCPUCluster cluster = (CraftingCPUCluster) tile.getCluster();
|
||||
if (cluster != null) {
|
||||
this.craftingCPUClusters.add(cluster);
|
||||
|
||||
+22
-22
@@ -36,16 +36,16 @@ import appeng.api.networking.events.MENetworkPowerStatusChange;
|
||||
import appeng.api.networking.ticking.ITickManager;
|
||||
import appeng.core.AELog;
|
||||
import appeng.me.cache.helpers.TunnelCollection;
|
||||
import appeng.parts.p2p.PartP2PTunnel;
|
||||
import appeng.parts.p2p.PartP2PTunnelME;
|
||||
import appeng.parts.p2p.P2PTunnelPart;
|
||||
import appeng.parts.p2p.MEP2PTunnelPart;
|
||||
|
||||
public class P2PCache implements IGridCache {
|
||||
private static final TunnelCollection<PartP2PTunnel> NULL_COLLECTION = new TunnelCollection<PartP2PTunnel>(null,
|
||||
private static final TunnelCollection<P2PTunnelPart> NULL_COLLECTION = new TunnelCollection<P2PTunnelPart>(null,
|
||||
null);
|
||||
|
||||
private final IGrid myGrid;
|
||||
private final HashMap<Short, PartP2PTunnel> inputs = new HashMap<>();
|
||||
private final Multimap<Short, PartP2PTunnel> outputs = LinkedHashMultimap.create();
|
||||
private final HashMap<Short, P2PTunnelPart> inputs = new HashMap<>();
|
||||
private final Multimap<Short, P2PTunnelPart> outputs = LinkedHashMultimap.create();
|
||||
private final Random frequencyGenerator;
|
||||
|
||||
public P2PCache(final IGrid g) {
|
||||
@@ -56,8 +56,8 @@ public class P2PCache implements IGridCache {
|
||||
@MENetworkEventSubscribe
|
||||
public void bootComplete(final MENetworkBootingStatusChange bootStatus) {
|
||||
final ITickManager tm = this.myGrid.getCache(ITickManager.class);
|
||||
for (final PartP2PTunnel me : this.inputs.values()) {
|
||||
if (me instanceof PartP2PTunnelME) {
|
||||
for (final P2PTunnelPart me : this.inputs.values()) {
|
||||
if (me instanceof MEP2PTunnelPart) {
|
||||
tm.wakeDevice(me.getGridNode());
|
||||
}
|
||||
}
|
||||
@@ -66,8 +66,8 @@ public class P2PCache implements IGridCache {
|
||||
@MENetworkEventSubscribe
|
||||
public void bootComplete(final MENetworkPowerStatusChange power) {
|
||||
final ITickManager tm = this.myGrid.getCache(ITickManager.class);
|
||||
for (final PartP2PTunnel me : this.inputs.values()) {
|
||||
if (me instanceof PartP2PTunnelME) {
|
||||
for (final P2PTunnelPart me : this.inputs.values()) {
|
||||
if (me instanceof MEP2PTunnelPart) {
|
||||
tm.wakeDevice(me.getGridNode());
|
||||
}
|
||||
}
|
||||
@@ -80,14 +80,14 @@ public class P2PCache implements IGridCache {
|
||||
|
||||
@Override
|
||||
public void removeNode(final IGridNode node, final IGridHost machine) {
|
||||
if (machine instanceof PartP2PTunnel) {
|
||||
if (machine instanceof PartP2PTunnelME) {
|
||||
if (machine instanceof P2PTunnelPart) {
|
||||
if (machine instanceof MEP2PTunnelPart) {
|
||||
if (!node.hasFlag(GridFlags.REQUIRE_CHANNEL)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
final PartP2PTunnel t = (PartP2PTunnel) machine;
|
||||
final P2PTunnelPart t = (P2PTunnelPart) machine;
|
||||
// AELog.info( "rmv-" + (t.output ? "output: " : "input: ") + t.freq );
|
||||
|
||||
if (t.isOutput()) {
|
||||
@@ -102,14 +102,14 @@ public class P2PCache implements IGridCache {
|
||||
|
||||
@Override
|
||||
public void addNode(final IGridNode node, final IGridHost machine) {
|
||||
if (machine instanceof PartP2PTunnel) {
|
||||
if (machine instanceof PartP2PTunnelME) {
|
||||
if (machine instanceof P2PTunnelPart) {
|
||||
if (machine instanceof MEP2PTunnelPart) {
|
||||
if (!node.hasFlag(GridFlags.REQUIRE_CHANNEL)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
final PartP2PTunnel t = (PartP2PTunnel) machine;
|
||||
final P2PTunnelPart t = (P2PTunnelPart) machine;
|
||||
// AELog.info( "add-" + (t.output ? "output: " : "input: ") + t.freq );
|
||||
|
||||
if (t.isOutput()) {
|
||||
@@ -138,14 +138,14 @@ public class P2PCache implements IGridCache {
|
||||
}
|
||||
|
||||
private void updateTunnel(final short freq, final boolean updateOutputs, final boolean configChange) {
|
||||
for (final PartP2PTunnel p : this.outputs.get(freq)) {
|
||||
for (final P2PTunnelPart p : this.outputs.get(freq)) {
|
||||
if (configChange) {
|
||||
p.onTunnelConfigChange();
|
||||
}
|
||||
p.onTunnelNetworkChange();
|
||||
}
|
||||
|
||||
final PartP2PTunnel in = this.inputs.get(freq);
|
||||
final P2PTunnelPart in = this.inputs.get(freq);
|
||||
if (in != null) {
|
||||
if (configChange) {
|
||||
in.onTunnelConfigChange();
|
||||
@@ -154,7 +154,7 @@ public class P2PCache implements IGridCache {
|
||||
}
|
||||
}
|
||||
|
||||
public void updateFreq(final PartP2PTunnel t, final short newFrequency) {
|
||||
public void updateFreq(final P2PTunnelPart t, final short newFrequency) {
|
||||
if (this.outputs.containsValue(t)) {
|
||||
this.outputs.remove(t.getFrequency(), t);
|
||||
}
|
||||
@@ -192,14 +192,14 @@ public class P2PCache implements IGridCache {
|
||||
return newFrequency;
|
||||
}
|
||||
|
||||
public TunnelCollection<PartP2PTunnel> getOutputs(final short freq, final Class<? extends PartP2PTunnel> c) {
|
||||
final PartP2PTunnel in = this.inputs.get(freq);
|
||||
public TunnelCollection<P2PTunnelPart> getOutputs(final short freq, final Class<? extends P2PTunnelPart> c) {
|
||||
final P2PTunnelPart in = this.inputs.get(freq);
|
||||
|
||||
if (in == null) {
|
||||
return NULL_COLLECTION;
|
||||
}
|
||||
|
||||
final TunnelCollection<PartP2PTunnel> out = this.inputs.get(freq).getCollection(this.outputs.get(freq), c);
|
||||
final TunnelCollection<P2PTunnelPart> out = this.inputs.get(freq).getCollection(this.outputs.get(freq), c);
|
||||
|
||||
if (out == null) {
|
||||
return NULL_COLLECTION;
|
||||
@@ -208,7 +208,7 @@ public class P2PCache implements IGridCache {
|
||||
return out;
|
||||
}
|
||||
|
||||
public PartP2PTunnel getInput(final short freq) {
|
||||
public P2PTunnelPart getInput(final short freq) {
|
||||
return this.inputs.get(freq);
|
||||
}
|
||||
}
|
||||
|
||||
+9
-9
@@ -56,12 +56,12 @@ import appeng.me.pathfinding.ControllerChannelUpdater;
|
||||
import appeng.me.pathfinding.ControllerValidator;
|
||||
import appeng.me.pathfinding.IPathItem;
|
||||
import appeng.me.pathfinding.PathSegment;
|
||||
import appeng.tile.networking.TileController;
|
||||
import appeng.tile.networking.ControllerTileEntity;
|
||||
|
||||
public class PathGridCache implements IPathingGrid {
|
||||
|
||||
private final List<PathSegment> active = new ArrayList<>();
|
||||
private final Set<TileController> controllers = new HashSet<>();
|
||||
private final Set<ControllerTileEntity> controllers = new HashSet<>();
|
||||
private final Set<IGridNode> requireChannels = new HashSet<>();
|
||||
private final Set<IGridNode> blockDense = new HashSet<>();
|
||||
private final IGrid myGrid;
|
||||
@@ -130,11 +130,11 @@ public class PathGridCache implements IPathingGrid {
|
||||
|
||||
// myGrid.getPivot().beginVisit( new AdHocChannelUpdater( 0 )
|
||||
// );
|
||||
for (final IGridNode node : this.myGrid.getMachines(TileController.class)) {
|
||||
for (final IGridNode node : this.myGrid.getMachines(ControllerTileEntity.class)) {
|
||||
closedList.add((IPathItem) node);
|
||||
for (final IGridConnection gcc : node.getConnections()) {
|
||||
final GridConnection gc = (GridConnection) gcc;
|
||||
if (!(gc.getOtherSide(node).getMachine() instanceof TileController)) {
|
||||
if (!(gc.getOtherSide(node).getMachine() instanceof ControllerTileEntity)) {
|
||||
final List<IPathItem> open = new ArrayList<>();
|
||||
closedList.add(gc);
|
||||
open.add(gc);
|
||||
@@ -160,9 +160,9 @@ public class PathGridCache implements IPathingGrid {
|
||||
|
||||
if (this.active.isEmpty() && this.ticksUntilReady <= 0) {
|
||||
if (this.controllerState == ControllerState.CONTROLLER_ONLINE) {
|
||||
final Iterator<TileController> controllerIterator = this.controllers.iterator();
|
||||
final Iterator<ControllerTileEntity> controllerIterator = this.controllers.iterator();
|
||||
if (controllerIterator.hasNext()) {
|
||||
final TileController controller = controllerIterator.next();
|
||||
final ControllerTileEntity controller = controllerIterator.next();
|
||||
controller.getGridNode(AEPartLocation.INTERNAL).beginVisit(new ControllerChannelUpdater());
|
||||
}
|
||||
}
|
||||
@@ -179,7 +179,7 @@ public class PathGridCache implements IPathingGrid {
|
||||
|
||||
@Override
|
||||
public void removeNode(final IGridNode gridNode, final IGridHost machine) {
|
||||
if (machine instanceof TileController) {
|
||||
if (machine instanceof ControllerTileEntity) {
|
||||
this.controllers.remove(machine);
|
||||
this.recalculateControllerNextTick = true;
|
||||
}
|
||||
@@ -199,8 +199,8 @@ public class PathGridCache implements IPathingGrid {
|
||||
|
||||
@Override
|
||||
public void addNode(final IGridNode gridNode, final IGridHost machine) {
|
||||
if (machine instanceof TileController) {
|
||||
this.controllers.add((TileController) machine);
|
||||
if (machine instanceof ControllerTileEntity) {
|
||||
this.controllers.add((ControllerTileEntity) machine);
|
||||
this.recalculateControllerNextTick = true;
|
||||
}
|
||||
|
||||
|
||||
+7
-7
@@ -33,8 +33,8 @@ import appeng.api.util.DimensionalCoord;
|
||||
import appeng.api.util.IReadOnlyCollection;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.me.cluster.implementations.SpatialPylonCluster;
|
||||
import appeng.tile.spatial.TileSpatialIOPort;
|
||||
import appeng.tile.spatial.TileSpatialPylon;
|
||||
import appeng.tile.spatial.SpatialIOPortTileEntity;
|
||||
import appeng.tile.spatial.SpatialPylonTileEntity;
|
||||
|
||||
public class SpatialPylonCache implements ISpatialCache {
|
||||
|
||||
@@ -44,7 +44,7 @@ public class SpatialPylonCache implements ISpatialCache {
|
||||
private DimensionalCoord captureMin;
|
||||
private DimensionalCoord captureMax;
|
||||
private boolean isValid = false;
|
||||
private List<TileSpatialIOPort> ioPorts = new ArrayList<>();
|
||||
private List<SpatialIOPortTileEntity> ioPorts = new ArrayList<>();
|
||||
private HashMap<SpatialPylonCluster, SpatialPylonCluster> clusters = new HashMap<>();
|
||||
|
||||
public SpatialPylonCache(final IGrid g) {
|
||||
@@ -61,14 +61,14 @@ public class SpatialPylonCache implements ISpatialCache {
|
||||
this.clusters = new HashMap<>();
|
||||
this.ioPorts = new ArrayList<>();
|
||||
|
||||
for (final IGridNode gm : grid.getMachines(TileSpatialIOPort.class)) {
|
||||
this.ioPorts.add((TileSpatialIOPort) gm.getMachine());
|
||||
for (final IGridNode gm : grid.getMachines(SpatialIOPortTileEntity.class)) {
|
||||
this.ioPorts.add((SpatialIOPortTileEntity) gm.getMachine());
|
||||
}
|
||||
|
||||
final IReadOnlyCollection<IGridNode> set = grid.getMachines(TileSpatialPylon.class);
|
||||
final IReadOnlyCollection<IGridNode> set = grid.getMachines(SpatialPylonTileEntity.class);
|
||||
for (final IGridNode gm : set) {
|
||||
if (gm.meetsChannelRequirements()) {
|
||||
final SpatialPylonCluster c = ((TileSpatialPylon) gm.getMachine()).getCluster();
|
||||
final SpatialPylonCluster c = ((SpatialPylonTileEntity) gm.getMachine()).getCluster();
|
||||
if (c != null) {
|
||||
this.clusters.put(c, c);
|
||||
}
|
||||
|
||||
+3
-3
@@ -23,17 +23,17 @@ import java.util.HashMap;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.parts.p2p.PartP2PTunnelME;
|
||||
import appeng.parts.p2p.MEP2PTunnelPart;
|
||||
import appeng.util.IWorldCallable;
|
||||
|
||||
public class Connections implements IWorldCallable<Void> {
|
||||
|
||||
private final HashMap<IGridNode, TunnelConnection> connections = new HashMap<>();
|
||||
private final PartP2PTunnelME me;
|
||||
private final MEP2PTunnelPart me;
|
||||
private boolean create = false;
|
||||
private boolean destroy = false;
|
||||
|
||||
public Connections(final PartP2PTunnelME o) {
|
||||
public Connections(final MEP2PTunnelPart o) {
|
||||
this.me = o;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,10 +21,10 @@ package appeng.me.cache.helpers;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
|
||||
import appeng.parts.p2p.PartP2PTunnel;
|
||||
import appeng.parts.p2p.P2PTunnelPart;
|
||||
import appeng.util.iterators.NullIterator;
|
||||
|
||||
public class TunnelCollection<T extends PartP2PTunnel> implements Iterable<T> {
|
||||
public class TunnelCollection<T extends P2PTunnelPart> implements Iterable<T> {
|
||||
|
||||
private final Class clz;
|
||||
private Collection<T> tunnelSources;
|
||||
@@ -50,11 +50,11 @@ public class TunnelCollection<T extends PartP2PTunnel> implements Iterable<T> {
|
||||
return new TunnelIterator<>(this.tunnelSources, this.clz);
|
||||
}
|
||||
|
||||
public boolean matches(final Class<? extends PartP2PTunnel> c) {
|
||||
public boolean matches(final Class<? extends P2PTunnelPart> c) {
|
||||
return this.clz == c;
|
||||
}
|
||||
|
||||
public Class<? extends PartP2PTunnel> getClz() {
|
||||
public Class<? extends P2PTunnelPart> getClz() {
|
||||
return this.clz;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,14 +19,14 @@
|
||||
package appeng.me.cache.helpers;
|
||||
|
||||
import appeng.api.networking.IGridConnection;
|
||||
import appeng.parts.p2p.PartP2PTunnelME;
|
||||
import appeng.parts.p2p.MEP2PTunnelPart;
|
||||
|
||||
public class TunnelConnection {
|
||||
|
||||
private final PartP2PTunnelME tunnel;
|
||||
private final MEP2PTunnelPart tunnel;
|
||||
private final IGridConnection c;
|
||||
|
||||
public TunnelConnection(final PartP2PTunnelME t, final IGridConnection con) {
|
||||
public TunnelConnection(final MEP2PTunnelPart t, final IGridConnection con) {
|
||||
this.tunnel = t;
|
||||
this.c = con;
|
||||
}
|
||||
@@ -35,7 +35,7 @@ public class TunnelConnection {
|
||||
return this.c;
|
||||
}
|
||||
|
||||
public PartP2PTunnelME getTunnel() {
|
||||
public MEP2PTunnelPart getTunnel() {
|
||||
return this.tunnel;
|
||||
}
|
||||
}
|
||||
@@ -21,9 +21,9 @@ package appeng.me.cache.helpers;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
|
||||
import appeng.parts.p2p.PartP2PTunnel;
|
||||
import appeng.parts.p2p.P2PTunnelPart;
|
||||
|
||||
public class TunnelIterator<T extends PartP2PTunnel> implements Iterator<T> {
|
||||
public class TunnelIterator<T extends P2PTunnelPart> implements Iterator<T> {
|
||||
|
||||
private final Iterator<T> wrapped;
|
||||
private final Class targetType;
|
||||
|
||||
Reference in New Issue
Block a user