Class SpellGlyphData

java.lang.Object
net.minecraft.world.level.saveddata.SavedData
com.binaris.wizardry.content.data.SpellGlyphData

public class SpellGlyphData extends net.minecraft.world.level.saveddata.SavedData
This class is responsible for storing and managing the random names and descriptions assigned to spell glyphs, this is when the player don't know what a spell does and they have to identify it first, all the scrolls/books showing that spell will then have the same random name/description. The names and descriptions are generated randomly when the world is first created and saved to disk.

Note that this data is stored per-world, not per-player, so all players in the same world will see the same random names/descriptions for spell glyphs.

  • Field Details

  • Constructor Details

    • SpellGlyphData

      public SpellGlyphData()
  • Method Details

    • get

      public static SpellGlyphData get(net.minecraft.server.level.ServerLevel world)
      Retrieves the SpellGlyphData instance for the given world, creating and populating it if it doesn't already exist. This also ensures that all registered spells have entries in the data, adding any that are missing (for example, due to addons being installed or spells being renamed).
      Parameters:
      world - The server level to get the SpellGlyphData for.
      Returns:
      The SpellGlyphData instance for the given world.
    • getGlyphNameFormatted

      public static net.minecraft.network.chat.Component getGlyphNameFormatted(Spell spell, SpellGlyphData data)
    • getGlyphName

      public static String getGlyphName(Spell spell, SpellGlyphData data)
    • getGlyphDescription

      public static String getGlyphDescription(Spell spell, SpellGlyphData data)
    • getGlyphName

      public static String getGlyphName(Spell spell, net.minecraft.server.level.ServerLevel world)
    • getGlyphDescription

      public static String getGlyphDescription(Spell spell, net.minecraft.server.level.ServerLevel world)
    • load

      public static SpellGlyphData load(net.minecraft.nbt.CompoundTag nbt)
    • onServerLevelLoad

      public static void onServerLevelLoad(EBServerLevelLoadEvent event)
    • generateGlyphNames

      public void generateGlyphNames(net.minecraft.world.level.Level world)
    • sync

      public void sync(net.minecraft.server.level.ServerPlayer player)
    • save

      @NotNull public @NotNull net.minecraft.nbt.CompoundTag save(@NotNull @NotNull net.minecraft.nbt.CompoundTag nbt)
      Specified by:
      save in class net.minecraft.world.level.saveddata.SavedData