Class O2Book
java.lang.Object
net.pottercraft.ollivanders2.book.O2Book
- Direct Known Subclasses:
A_BEGINNERS_GUIDE_TO_TRANSFIGURATION,ACHIEVEMENTS_IN_CHARMING,ADVANCED_FIREWORKS,ADVANCED_POTION_MAKING,ADVANCED_TRANSFIGURATION,BASIC_FIREWORKS,BASIC_HEXES,BOOK_OF_POTIONS,BREAK_WITH_A_BANSHEE,CHADWICKS_CHARMS_VOLUME_1,CHARMING_COLORS,CONFRONTING_THE_FACELESS,CURSES_AND_COUNTERCURSES,DE_MEDICINA_PRAECEPTA,DEFENSE_AGAINST_THE_DARK_ARTS,ESSENTIAL_DARK_ARTS,EXTREME_INCANTATIONS,FANTASTIC_BEASTS,FOR_THE_GREATER_GOOD,GADDING_WITH_GHOULS,HARMONIOUS_CONNECTIONS,HOLIDAYS_WITH_HAGS,INTERMEDIATE_TRANSFIGURATION,JINXES_FOR_THE_JINXED,MAGICAL_DRAFTS_AND_POTIONS,MAGICK_MOSTE_EVILE,MODERN_MAGICAL_TRANSPORTATION,MOSTE_POTENTE_POTIONS,NUMEROLOGY_AND_GRAMMATICA,OMENS_ORACLES_AND_THE_GOAT,POTION_OPUSCULE,PRACTICAL_DEFENSIVE_MAGIC,QUINTESSENCE_A_QUEST,SECRETS_OF_THE_DARKEST_ART,SECRETS_OF_WANDLORE,STANDARD_BOOK_OF_SPELLS_GRADE_1,STANDARD_BOOK_OF_SPELLS_GRADE_2,STANDARD_BOOK_OF_SPELLS_GRADE_3,STANDARD_BOOK_OF_SPELLS_GRADE_4,STANDARD_BOOK_OF_SPELLS_GRADE_5,STANDARD_BOOK_OF_SPELLS_GRADE_6,STANDARD_BOOK_OF_SPELLS_GRADE_7,TETRABIBLIOS,THE_DARK_FORCES,THE_HEALERS_HELPMATE,TRAVELS_WITH_TROLLS,UNFOGGING_THE_FUTURE,VOYAGES_WITH_VAMPIRES,WANDERINGS_WITH_WEREWOLVES,YEAR_WITH_A_YETI
Super class for all Ollivanders2 books.
Book limits:
- Title - 32 characters
- Pages - 50
- Lines per page - 14
- Characters per page - 256 (newlines count as 2 characters)
- Characters per line - 16-18 depending on the exact characters
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected O2BookTypeThe type of book defining its author, title, and magic branchstatic org.bukkit.NamespacedKeyNamespace key for NBT tag - potionsstatic org.bukkit.NamespacedKeyNamespace key for NBT tag - spellsstatic org.bukkit.NamespacedKeyNamespace key for NBT tag - book typeprotected Ollivanders2Callback to the pluginprotected ArrayList<O2PotionType> Potions in bookprotected ArrayList<O2SpellType> Spells in book -
Constructor Summary
ConstructorsConstructorDescriptionO2Book(@NotNull Ollivanders2 plugin) Constructor that initializes a new book instance. -
Method Summary
Modifier and TypeMethodDescription@NotNull StringThe author for this book.@NotNull org.bukkit.inventory.ItemStackGet the book item for this book@NotNull O2MagicBranchThe branch for this book.intGet the number of potions in this book.intGet the number of spells in this book.@NotNull StringGet the short title for this book@NotNull StringgetTitle()Get the title for this book.
-
Field Details
-
bookType
The type of book defining its author, title, and magic branch -
o2BookTypeKey
public static org.bukkit.NamespacedKey o2BookTypeKeyNamespace key for NBT tag - book type -
o2BookSpellsKey
public static org.bukkit.NamespacedKey o2BookSpellsKeyNamespace key for NBT tag - spells -
o2BookPotionsKey
public static org.bukkit.NamespacedKey o2BookPotionsKeyNamespace key for NBT tag - potions -
p
Callback to the plugin -
spells
Spells in book -
potions
Potions in book
-
-
Constructor Details
-
O2Book
Constructor that initializes a new book instance.Initializes the book type to STANDARD_BOOK_OF_SPELLS_GRADE_1, empty opening and closing pages, empty spell and potion lists, and creates the required NamespacedKeys for NBT data storage. The actual book item is created lazily on the first call to
getBookItem().- Parameters:
plugin- a callback to the Ollivanders2 plugin instance
-
-
Method Details
-
getBookItem
@NotNull public @NotNull org.bukkit.inventory.ItemStack getBookItem()Get the book item for this book- Returns:
- the book item
-
getTitle
Get the title for this book.- Returns:
- title
-
getShortTitle
Get the short title for this book- Returns:
- short title for this book
-
getAuthor
The author for this book.- Returns:
- author
-
getBranch
The branch for this book.- Returns:
- branch
-
getNumberOfSpells
public int getNumberOfSpells()Get the number of spells in this book.- Returns:
- number of spells
-
getNumberOfPotions
public int getNumberOfPotions()Get the number of potions in this book.- Returns:
- number of potions
-