Class Converter

java.lang.Object
me.neznamy.tab.shared.config.Converter

public class Converter extends Object
Configuration converter that converts configuration files from practically any previous version of TAB to the current format.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    convertAnimationFile(me.neznamy.tab.api.config.ConfigurationFile animations)
    Converts animation file from old format with everything under "animations" key to new format which does not use the redundant key anymore.
    void
    convertToV3(me.neznamy.tab.api.config.ConfigurationFile currentConfig)
    Converts all configuration files from 2.9.2 into new 3.0.0 format and saves a copy of old files into a new "old_configs" folder.
    void
    removeOldOptions(me.neznamy.tab.api.config.ConfigurationFile config)
     

    Methods inherited from class java.lang.Object

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

    • Converter

      public Converter()
  • Method Details

    • convertAnimationFile

      public void convertAnimationFile(me.neznamy.tab.api.config.ConfigurationFile animations)
      Converts animation file from old format with everything under "animations" key to new format which does not use the redundant key anymore.

      The method contains a check if the conversion is necessary, so it is always safe to call this method, even if conversion is not needed.

      This change was made from 2.8.10 -> 2.9.0

      Parameters:
      animations - animation file to convert
    • convertToV3

      public void convertToV3(me.neznamy.tab.api.config.ConfigurationFile currentConfig) throws IOException
      Converts all configuration files from 2.9.2 into new 3.0.0 format and saves a copy of old files into a new "old_configs" folder.
      Parameters:
      currentConfig - currently detected config.yml file
      Throws:
      IOException - if an I/O operation with the files fails
    • removeOldOptions

      public void removeOldOptions(me.neznamy.tab.api.config.ConfigurationFile config)