public static class ItemBookCode.Data
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.util.regex.Pattern |
PATTERN_LINES |
| Constructor and Description |
|---|
Data() |
| Modifier and Type | Method and Description |
|---|---|
void |
addProgram(java.util.List<java.lang.String> code)
Add a new program to the book.
|
java.util.List<java.lang.String> |
getProgram(int index)
Get the code of the program with the specified index.
|
int |
getProgramCount()
Get the number of programs stored in the book.
|
int |
getSelectedProgram()
Get the program currently selected in the book.
|
static ItemBookCode.Data |
loadFromNBT(net.minecraft.nbt.NBTTagCompound nbt)
Load code book data from the specified NBT tag.
|
static ItemBookCode.Data |
loadFromStack(net.minecraft.item.ItemStack stack)
Load code book data from the specified item stack.
|
void |
readFromNBT(net.minecraft.nbt.NBTTagCompound nbt)
Load data from the specified NBT tag.
|
void |
removeProgram(int index)
Remove a program from the book.
|
static void |
saveToStack(net.minecraft.item.ItemStack stack,
ItemBookCode.Data data)
Save the specified code book data to the specified item stack.
|
void |
setProgram(int page,
java.util.List<java.lang.String> code)
Overwrite a program at the specified index.
|
void |
setSelectedProgram(int index)
Set which program is currently selected.
|
void |
writeToNBT(net.minecraft.nbt.NBTTagCompound nbt)
Store the data to the specified NBT tag.
|
public int getSelectedProgram()
public void setSelectedProgram(int index)
index - the new selected index.public int getProgramCount()
public java.util.List<java.lang.String> getProgram(int index)
index - the index of the program to get.public void addProgram(java.util.List<java.lang.String> code)
code - the code of the program to add.public void setProgram(int page,
java.util.List<java.lang.String> code)
page - the index of the program to overwrite.code - the code of the program.public void removeProgram(int index)
index - the index of the program to remove.public void readFromNBT(net.minecraft.nbt.NBTTagCompound nbt)
nbt - the tag to load the data from.public void writeToNBT(net.minecraft.nbt.NBTTagCompound nbt)
nbt - the tag to save the data to.public static ItemBookCode.Data loadFromNBT(net.minecraft.nbt.NBTTagCompound nbt)
nbt - the tag to load the data from.public static ItemBookCode.Data loadFromStack(net.minecraft.item.ItemStack stack)
stack - the item stack to load the data from.public static void saveToStack(net.minecraft.item.ItemStack stack,
ItemBookCode.Data data)
stack - the item stack to save the data to.data - the data to save to the item stack.