Package com.ldtteam.structurize.util
Class ScanToolData
java.lang.Object
com.ldtteam.structurize.util.ScanToolData
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.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull ScanToolData.SlotGets the currently selected slotintGets the currently selected slot number@NotNull net.minecraft.nbt.CompoundTagGets the internal tag used to store data.voidmoveTo(int slot) Moves to the specified slot numbervoidnextSlot()Moves to the next slot, wrapping back to the start if neededvoidprevSlot()Moves to the previous slot, wrapping to the end if neededvoidsetCurrentSlotData(@Nullable ScanToolData.Slot data) Saves the specified data in the current slot
-
Field Details
-
NUM_SLOTS
public static final int NUM_SLOTSThe 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
Gets the currently selected slot- Returns:
- the slot data for the current slot
-
setCurrentSlotData
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
-