Class AutoPlaceEnvironment


  • public class AutoPlaceEnvironment
    extends java.lang.Object
    Represent the environment in which autoplace of a single element took place.
    • Method Detail

      • getSource

        public IItemSource getSource()
        From where survival autoplace will drain resources.
      • getChatter

        public java.util.function.Consumer<IChatComponent> getChatter()
        send error messages here. Caller will choose an appropriate way to forward it to player if the other fallbacks also fails.
      • isContainedInPiece

        public boolean isContainedInPiece​(int offsetA,
                                          int offsetB,
                                          int offsetC)
        Test if given location is contained within the current piece.
        Parameters:
        offsetA - offset in A direction relative to current element
        offsetB - offset in B direction relative to current element
        offsetC - offset in C direction relative to current element
        Returns:
        true if contained, false otherwise.
      • withSource

        public AutoPlaceEnvironment withSource​(IItemSource source)
        Return a new instance with source modified to given value.
        Parameters:
        source - new source
        Returns:
        new instance
      • withActor

        public AutoPlaceEnvironment withActor​(EntityPlayer actor)
        Return a new instance with actor modified to given value.
        Parameters:
        actor - new actor
        Returns:
        new instance
      • withChatter

        public AutoPlaceEnvironment withChatter​(java.util.function.Consumer<IChatComponent> chatter)
        Return a new instance with chatter modified to given value.
        Parameters:
        chatter - new chatter
        Returns:
        new instance