java.lang.Object
com.minecolonies.core.colony.requestsystem.locations.StaticLocation
All Implemented Interfaces:
ILocation

public class StaticLocation extends Object implements ILocation
Location described by an immutable blockpos and a dimension.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Internal factory class.
  • Constructor Summary

    Constructors
    Constructor
    Description
    StaticLocation(@NotNull net.minecraft.core.BlockPos pos, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    deserialize(net.minecraft.network.FriendlyByteBuf buffer)
    Deserialize the location from the given FriendlyByteBuf
    boolean
     
    @NotNull net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level>
    Method to get the dimension of the location.
    @NotNull net.minecraft.core.BlockPos
    Method to get the location in the dimension
    int
     
    boolean
    Method to check if this location is reachable from the other.
    static void
    serialize(net.minecraft.network.FriendlyByteBuf buffer, StaticLocation location)
    Serialize this location to the given FriendlyByteBuf.
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • StaticLocation

      public StaticLocation(@NotNull @NotNull net.minecraft.core.BlockPos pos, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension)
  • Method Details

    • getInDimensionLocation

      @NotNull public @NotNull net.minecraft.core.BlockPos getInDimensionLocation()
      Method to get the location in the dimension
      Specified by:
      getInDimensionLocation in interface ILocation
      Returns:
      The location.
    • getDimension

      @NotNull public @NotNull net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> getDimension()
      Method to get the dimension of the location.
      Specified by:
      getDimension in interface ILocation
      Returns:
      The dimension of the location.
    • isReachableFromLocation

      public boolean isReachableFromLocation(@NotNull @NotNull ILocation location)
      Method to check if this location is reachable from the other.
      Specified by:
      isReachableFromLocation in interface ILocation
      Parameters:
      location - The check if it is reachable from here.
      Returns:
      True when reachable, false when not.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • serialize

      public static void serialize(net.minecraft.network.FriendlyByteBuf buffer, StaticLocation location)
      Serialize this location to the given FriendlyByteBuf.
      Parameters:
      buffer - the buffer to serialize this location to.
    • deserialize

      public static StaticLocation deserialize(net.minecraft.network.FriendlyByteBuf buffer)
      Deserialize the location from the given FriendlyByteBuf
      Parameters:
      buffer - the buffer to read.
      Returns:
      the deserialized location.