Class FitsAPortal

java.lang.Object
com.hypixel.hytale.builtin.portals.utils.posqueries.predicates.FitsAPortal
All Implemented Interfaces:
PositionPredicate

public class FitsAPortal extends Object implements PositionPredicate
A position predicate that checks if a portal can fit at a given point in the world.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The highest y offset the check reads.
    static final int
    The lowest y offset the check reads.
    static final int
    The horizontal reach of the check, in blocks, on either side of the point.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    check(World world, org.joml.Vector3d point)
    Determines if a portal can fit at the given point, reading only the sections already in memory.
    checkAsync(World world, org.joml.Vector3d point)
    Determines if a portal can fit at the given point, loading any section the check needs and does not find in memory.
    boolean
    test(World world, org.joml.Vector3d point)
    Determines if the condition is met at the specified point in the given world.

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • RADIUS_XZ

      public static final int RADIUS_XZ
      The horizontal reach of the check, in blocks, on either side of the point.
      See Also:
    • MIN_Y_OFFSET

      public static final int MIN_Y_OFFSET
      The lowest y offset the check reads. Blocks below the point must be solid.
      See Also:
    • MAX_Y_OFFSET

      public static final int MAX_Y_OFFSET
      The highest y offset the check reads. Blocks at and above the point must be empty.
      See Also:
  • Constructor Details

    • FitsAPortal

      public FitsAPortal()
  • Method Details

    • test

      public boolean test(@Nonnull World world, @Nonnull org.joml.Vector3d point)
      Description copied from interface: PositionPredicate
      Determines if the condition is met at the specified point in the given world.
      Specified by:
      test in interface PositionPredicate
      Parameters:
      world - The world to test the condition in.
      point - The point to test the condition at.
      Returns:
      true if the condition is met, false otherwise.
    • check

      public static boolean check(@Nonnull World world, @Nonnull org.joml.Vector3d point)
      Determines if a portal can fit at the given point, reading only the sections already in memory. A position whose section is absent is rejected rather than loaded.
      Parameters:
      world - The world to check in.
      point - The point to check.
      Returns:
      true if a portal can fit at the given point, false otherwise.
    • checkAsync

      @Nonnull public static CompletableFuture<Boolean> checkAsync(@Nonnull World world, @Nonnull org.joml.Vector3d point)
      Determines if a portal can fit at the given point, loading any section the check needs and does not find in memory.
      Parameters:
      world - The world to check in.
      point - The point to check.
      Returns:
      a future completing with true if a portal can fit at the given point.