Class ABConnection

java.lang.Object
etithespirit.orimod.aos.ABConnection

public final class ABConnection extends Object
An AB Connection represents a connection between two Light energy "hub" blocks. Hubs are blocks where more than one connection to that block is made, or where that block is functional on its own. It is possible for an AB Connection to be missing a from or to value, if this has occurred, then a line was created but with no endpoint. This can occur to optimize larger assemblies by pre-creating lines such that they can be prepared to add new elements on the fly.
  • Field Details

    • _greedySet

      public static boolean _greedySet
  • Method Details

    • splitAround

      public ABConnection[] splitAround(AbstractLightTile around, boolean isRemoving)
      Splits this line into one or more new lines based on the addition of a segment (forming a T/+ joint) or removal of a segment (splitting the line into pieces). Depending on the context and location in which this split occurs, this may return one line (this) or more. For example, calling split on the end segment will just extend or shrink this line, and cause this method to return itself. Calling split in the middle of a line with removal will return two lines, one will be this up to the point of the split, and the other will be a new line continuing after the gap.
      Parameters:
      around -
      isRemoving -
      Returns:
    • splitAround

      public ABConnection[] splitAround(net.minecraft.world.level.BlockGetter inWorld, net.minecraft.core.BlockPos around, boolean isRemoving)
    • getTileA

      @Nullable public AbstractLightTile getTileA()
      Returns a reference to the first tile of the two in this line.
      Returns:
      a reference to the first tile of the two in this line.
    • getTileB

      @Nullable public AbstractLightTile getTileB()
      Returns a reference to the second tile of the two in this line.
      Returns:
      a reference to the second tile of the two in this line.