Class ScanToolData

java.lang.Object
com.ldtteam.structurize.util.ScanToolData

public class ScanToolData extends Object
Data representing a set of scans in the scan tool. This is deliberately lazy and accesses only the parts of the tag you actually ask for.
  • Field Details

    • NUM_SLOTS

      public static final int NUM_SLOTS
      The number of scan slots. We keep 10 so that we can map them to 0-9 keys.
      See Also:
  • Constructor Details

    • ScanToolData

      public ScanToolData(@NotNull @NotNull net.minecraft.nbt.CompoundTag tag)
      Load from a tag
      Parameters:
      tag - the tag
  • Method Details

    • getInternalTag

      @NotNull public @NotNull net.minecraft.nbt.CompoundTag getInternalTag()
      Gets the internal tag used to store data. Don't fiddle with this.
      Returns:
      the tag
    • getCurrentSlotId

      public int getCurrentSlotId()
      Gets the currently selected slot number
      Returns:
      the slot number
    • getCurrentSlotData

      @NotNull public @NotNull ScanToolData.Slot getCurrentSlotData()
      Gets the currently selected slot
      Returns:
      the slot data for the current slot
    • setCurrentSlotData

      public void setCurrentSlotData(@Nullable @Nullable ScanToolData.Slot data)
      Saves the specified data in the current slot
      Parameters:
      data - the new slot data
    • nextSlot

      public void nextSlot()
      Moves to the next slot, wrapping back to the start if needed
    • prevSlot

      public void prevSlot()
      Moves to the previous slot, wrapping to the end if needed
    • moveTo

      public void moveTo(int slot)
      Moves to the specified slot number
      Parameters:
      slot - the new slot number