コード例 #1
0
  public void removeTile(CrystalNetworkTile te) {
    tiles.remove(PylonFinder.getLocation(te));

    if (te instanceof NotifiedNetworkTile) {
      notifyCache.remove(te);
    }
    for (NotifiedNetworkTile tile : notifyCache) {
      tile.onTileNetworkTopologyChange(te, true);
    }

    if (te instanceof TileEntityCrystalPylon) {
      TileEntityCrystalPylon tile = (TileEntityCrystalPylon) te;
      TileEntityCache<TileEntityCrystalPylon> c = pylons.get(tile.getColor());
      if (c != null) c.remove(tile);
    }
    Collection<CrystalFlow> li = flows.get(te.getWorld().provider.dimensionId);
    Iterator<CrystalFlow> it = li.iterator();
    while (it.hasNext()) {
      CrystalFlow p = it.next();
      if (p.contains(te)) {
        CrystalNetworkLogger.logFlowBreak(p, FlowFail.TILE);
        p.resetTiles();
        p.receiver.onPathBroken(p, FlowFail.TILE);
        it.remove();
      }
    }
    PylonFinder.removePathsWithTile(te);
    WorldCrystalNetworkData.initNetworkData(te.getWorld()).setDirty(true); // was false
    if (te instanceof TileEntityCrystalPylon) {
      PylonLocationData.initNetworkData(te.getWorld()).setDirty(true);
    }
  }
コード例 #2
0
 private void addPylon(TileEntityCrystalPylon te) {
   CrystalElement e = te.getColor();
   TileEntityCache<TileEntityCrystalPylon> c = pylons.get(e);
   if (c == null) {
     c = new TileEntityCache();
     pylons.put(e, c);
   }
   c.put(te);
 }