Class ColonyStoryListener

java.lang.Object
net.minecraft.server.packs.resources.SimplePreparableReloadListener<Map<net.minecraft.resources.ResourceLocation,com.google.gson.JsonElement>>
net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener
com.minecolonies.core.event.ColonyStoryListener
All Implemented Interfaces:
net.minecraft.server.packs.resources.PreparableReloadListener

public class ColonyStoryListener extends net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener
Loads and listens to colony story changes.
  • Field Details

    • ABANDONED_COLONY_NAME

      public static final net.minecraft.resources.ResourceLocation ABANDONED_COLONY_NAME
      Names for abandoned colonies.
    • ABANDONED_COLONY_STORY

      public static final net.minecraft.resources.ResourceLocation ABANDONED_COLONY_STORY
      Stories for abandoned colonies.
    • SUPPLY_CAMP_STORY

      public static final net.minecraft.resources.ResourceLocation SUPPLY_CAMP_STORY
      Stories for supply camps.
    • SUPPLY_SHIP_STORY

      public static final net.minecraft.resources.ResourceLocation SUPPLY_SHIP_STORY
      Stories for supply ships.
    • abandonedColonyNames

      public static Set<ColonyStoryListener.StoryText> abandonedColonyNames
      List of story and lore elements loaded from data.
    • abandonedColonyStories

      public static Set<ColonyStoryListener.StoryText> abandonedColonyStories
    • supplyShipStories

      public static Set<ColonyStoryListener.StoryText> supplyShipStories
    • supplyCampStories

      public static Set<ColonyStoryListener.StoryText> supplyCampStories
  • Constructor Details

    • ColonyStoryListener

      public ColonyStoryListener()
      Create a new listener.
  • Method Details

    • modInitClient

      public static void modInitClient(net.minecraftforge.client.event.RegisterClientReloadListenersEvent event)
    • pickRandom

      public static String pickRandom(Collection<ColonyStoryListener.StoryText> stories, net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome> biome, Random rng)
      Pick a random entry from the given set of story texts.
      Parameters:
      stories - the set of story texts to pick from.
      biome - biomes to filter the stories against.
      rng - random number source.
      Returns:
      one of the stories, at random.
    • apply

      protected void apply(Map<net.minecraft.resources.ResourceLocation,com.google.gson.JsonElement> jsonElementMap, @NotNull @NotNull net.minecraft.server.packs.resources.ResourceManager resourceManager, @NotNull @NotNull net.minecraft.util.profiling.ProfilerFiller profiler)
      Specified by:
      apply in class net.minecraft.server.packs.resources.SimplePreparableReloadListener<Map<net.minecraft.resources.ResourceLocation,com.google.gson.JsonElement>>