コード例 #1
0
 @SideOnly(Side.CLIENT)
 public void deactivateLasers() {
   for (EntityBlock laser : lasers) {
     laser.setDead();
   }
   lasers.clear();
   active = false;
 }
コード例 #2
0
ファイル: TileMarker.java プロジェクト: Nacorpio/BuildCraft
  @Override
  public void destroy() {
    TileMarker markerOrigin = null;

    if (origin.isSet()) {
      markerOrigin = origin.vectO.getMarker(worldObj);

      Origin o = origin;

      if (markerOrigin != null && markerOrigin.lasers != null) {
        for (EntityBlock entity : markerOrigin.lasers) {
          if (entity != null) {
            entity.setDead();
          }
        }
        markerOrigin.lasers = null;
      }

      for (TileWrapper m : o.vect) {
        TileMarker mark = m.getMarker(worldObj);

        if (mark != null) {
          if (mark.lasers != null) {
            for (EntityBlock entity : mark.lasers) {
              if (entity != null) {
                entity.setDead();
              }
            }
            mark.lasers = null;
          }

          if (mark != this) {
            mark.origin = new Origin();
          }
        }
      }

      if (markerOrigin != this && markerOrigin != null) {
        markerOrigin.origin = new Origin();
      }

      for (TileWrapper wrapper : o.vect) {
        TileMarker mark = wrapper.getMarker(worldObj);

        if (mark != null) {
          mark.updateSignals();
        }
      }
      if (markerOrigin != null) {
        markerOrigin.updateSignals();
      }
    }

    if (signals != null) {
      for (EntityBlock block : signals) {
        if (block != null) {
          block.setDead();
        }
      }
    }

    signals = null;

    if (!worldObj.isRemote && markerOrigin != null && markerOrigin != this) {
      markerOrigin.sendNetworkUpdate();
    }
  }