Enum Class SemiblockTracker

java.lang.Object
java.lang.Enum<SemiblockTracker>
me.desht.pneumaticcraft.common.semiblock.SemiblockTracker
All Implemented Interfaces:
Serializable, Comparable<SemiblockTracker>, Constable

public enum SemiblockTracker extends Enum<SemiblockTracker>
Server side tracker to find the semiblock entities at a given world and blockpos (Note that one blockpos could have up to 7 semiblocks - one non-sided plus six sided semiblocks)
  • Enum Constant Details

  • Method Details

    • values

      public static SemiblockTracker[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SemiblockTracker valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getInstance

      public static SemiblockTracker getInstance()
    • onServerStopping

      public static void onServerStopping(net.minecraftforge.event.server.ServerStoppingEvent event)
    • getSemiblock

      public ISemiBlock getSemiblock(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos)
      Retrieve the semiblock entity at the given world/pos
      Parameters:
      world - the world
      pos - the block
      Returns:
      the entity at the given pos
    • getSemiblock

      public ISemiBlock getSemiblock(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction direction)
      Retrieve the semiblock at the given world/pos/face
      Parameters:
      world - the world
      pos - the blockpos
      direction - face of the blockpos, or null for the block itself
      Returns:
      the entity, or null if none was found, or the blockpos in question isn't loaded
    • getAllSemiblocks

      public Stream<ISemiBlock> getAllSemiblocks(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos)
      Retrieve all the semiblocks at the given position.
      Parameters:
      world - the world
      pos - the blockpos
      Returns:
      a collection of all the semiblocks at the given position
    • getAllSemiblocks

      public Stream<ISemiBlock> getAllSemiblocks(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction offsetDir)
      Retrieve all the semiblocks at the given position. If there's nothing at the given position, try the position offset by one block in the given the direction.
      Parameters:
      world - the world
      pos - the blockpos
      offsetDir - a direction to offset if needed
      Returns:
      a stream of all the semiblocks at the given position
    • clearSemiblock

      public void clearSemiblock(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction direction)
      Clear any record of a semiblock at the given world/pos/face
      Parameters:
      world - the world
      pos - the blockpos
      direction - the side of the block, or null for the block itself
    • putSemiblock

      public boolean putSemiblock(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, ISemiBlock entity)
      Add a semiblock at the given world/pos
      Parameters:
      world - the world
      pos - the blockpos
      entity - the semiblock entity
      Returns:
      true if it was added OK, false if there was already a semiblock there (which is an error)
    • getSemiblocksInArea

      public Stream<ISemiBlock> getSemiblocksInArea(net.minecraft.world.level.Level world, net.minecraft.world.phys.AABB aabb)
      Retrieve all the semiblocks in the given area.
      Parameters:
      world - the world
      aabb - a bounding box which contains all the wanted semiblocks
      Returns:
      a stream of semiblock in the area