Interface ISchematic

All Known Subinterfaces:
IStaticSchematic
All Known Implementing Classes:
AbstractSchematic, CompositeSchematic, FillSchematic, MaskSchematic, MirroredSchematic, ReplaceSchematic, RotatedSchematic, ShellSchematic, SubstituteSchematic, WallsSchematic

public interface ISchematic
Basic representation of a schematic. Provides the dimensions and the desired state for a given position relative to the origin.
Author:
leijurv
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.world.level.block.state.BlockState
    desiredState(int x, int y, int z, net.minecraft.world.level.block.state.BlockState current, List<net.minecraft.world.level.block.state.BlockState> approxPlaceable)
    Returns the desired block state at a given (X, Y, Z) position relative to the origin (0, 0, 0).
    int
     
    default boolean
    inSchematic(int x, int y, int z, net.minecraft.world.level.block.state.BlockState currentState)
    Does the block at this coordinate matter to the schematic?
    int
     
    default void
    Resets possible caches to avoid wrong behavior when moving the schematic around
    default int
    size(net.minecraft.core.Direction.Axis axis)
     
    int
     
  • Method Details

    • inSchematic

      default boolean inSchematic(int x, int y, int z, net.minecraft.world.level.block.state.BlockState currentState)
      Does the block at this coordinate matter to the schematic?

      Normally just a check for if the coordinate is in the cube.

      However, in the case of something like a map art, anything that's below the level of the map art doesn't matter, so this function should return false in that case. (i.e. it doesn't really have to be air below the art blocks)

      Parameters:
      x - The x position of the block, relative to the origin
      y - The y position of the block, relative to the origin
      z - The z position of the block, relative to the origin
      currentState - The current state of that block in the world, or null
      Returns:
      Whether or not the specified position is within the bounds of this schematic
    • size

      default int size(net.minecraft.core.Direction.Axis axis)
    • desiredState

      net.minecraft.world.level.block.state.BlockState desiredState(int x, int y, int z, net.minecraft.world.level.block.state.BlockState current, List<net.minecraft.world.level.block.state.BlockState> approxPlaceable)
      Returns the desired block state at a given (X, Y, Z) position relative to the origin (0, 0, 0).
      Parameters:
      x - The x position of the block, relative to the origin
      y - The y position of the block, relative to the origin
      z - The z position of the block, relative to the origin
      current - The current state of that block in the world, or null
      approxPlaceable - The list of blockstates estimated to be placeable
      Returns:
      The desired block state at the specified position
    • reset

      default void reset()
      Resets possible caches to avoid wrong behavior when moving the schematic around
    • widthX

      int widthX()
      Returns:
      The width (X axis length) of this schematic
    • heightY

      int heightY()
      Returns:
      The height (Y axis length) of this schematic
    • lengthZ

      int lengthZ()
      Returns:
      The length (Z axis length) of this schematic