Class PortalManager

java.lang.Object
tech.anonymoushacker1279.openportals.portal.PortalManager

public class PortalManager extends Object
  • Constructor Details

    • PortalManager

      public PortalManager()
  • Method Details

    • addPortal

      public void addPortal(net.minecraft.world.level.block.Block frameBlock, PortalLink link)
      Add a portal frame and link to the manager.
      Parameters:
      frameBlock - the portal frame block
      link - the portal link
    • populateDimensions

      public void populateDimensions(Set<net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level>> registryKeys)
      Populate the dimension map. Set on server start via NeoEventSubscriber.onServerStart(ServerStartedEvent).
      Parameters:
      registryKeys - the set of dimension registry keys
    • isRegisteredFrameBlock

      public boolean isRegisteredFrameBlock(net.minecraft.world.level.block.state.BlockState blockState)
      Check if a block state is a registered portal frame block.
      Parameters:
      blockState - the block state to check
      Returns:
      true if registered, false otherwise
    • getPortalLinkFromBase

      @Nullable public @Nullable PortalLink getPortalLinkFromBase(net.minecraft.world.level.block.Block baseBlock)
      Get the portal link associated with a base block.
      Parameters:
      baseBlock - the base block
      Returns:
      the portal link, or null if not found
    • getDimensionKey

      public net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> getDimensionKey(net.minecraft.resources.Identifier dimensionId)
      Get the dimension key for a given dimension identifier.
      Parameters:
      dimensionId - the dimension identifier
      Returns:
      the dimension key, or null if not found
    • getStorage

      @Nullable public @Nullable PortalLinkingStorage getStorage()
      Get the portal linking storage. This should only be null if the server has not started yet.
      Returns:
      the portal linking storage, or null if not set
    • setStorage

      public void setStorage(PortalLinkingStorage storage)
      Set the portal linking storage. Set on server start via NeoEventSubscriber.onServerStart(ServerStartedEvent).
      Parameters:
      storage - the portal linking storage