Class RadarStorage

java.lang.Object
net.nullved.pmweatherapi.radar.RadarStorage

public class RadarStorage extends Object
Saves all the radars to a file to be saved and loaded from
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static Map<net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level>,Map<net.minecraft.world.level.ChunkPos,Set<net.minecraft.core.BlockPos>>>
    Reads all radars from a save or server
    For each dimension (net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level>), there is a Map mapping a ChunkPos to all the saved radar's BlockPos's
    protected static Map<net.minecraft.world.level.ChunkPos,Set<net.minecraft.core.BlockPos>>
    readRadarsForDimension(Map<net.minecraft.world.level.ChunkPos,Set<net.minecraft.core.BlockPos>> radarMap, com.google.gson.JsonElement json)
     
    static void
    Saves all radars to data/pmweatherapi/radars.json
    protected static com.google.gson.JsonObject
    saveRadarsForDimension(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension, Radars radars)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RadarStorage

      public RadarStorage()
  • Method Details

    • readAllRadars

      public static Map<net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level>,Map<net.minecraft.world.level.ChunkPos,Set<net.minecraft.core.BlockPos>>> readAllRadars()
      Reads all radars from a save or server
      For each dimension (net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level>), there is a Map mapping a ChunkPos to all the saved radar's BlockPos's
      Returns:
      All saved radars across all dimensions
    • saveAllRadars

      public static void saveAllRadars()
      Saves all radars to data/pmweatherapi/radars.json
    • saveRadarsForDimension

      protected static com.google.gson.JsonObject saveRadarsForDimension(net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension, Radars radars)
    • readRadarsForDimension

      protected static Map<net.minecraft.world.level.ChunkPos,Set<net.minecraft.core.BlockPos>> readRadarsForDimension(Map<net.minecraft.world.level.ChunkPos,Set<net.minecraft.core.BlockPos>> radarMap, com.google.gson.JsonElement json)