Ejemplo n.º 1
0
 public static BookData getData(String unique) {
   String language = ClientHelper.getLang();
   HashMap<String, BookData> data = books.get(language);
   BookData book = null;
   if (data != null) book = data.get(unique);
   if (book == null) book = getDataInFirstLanguage(unique);
   return book;
 }
Ejemplo n.º 2
0
 public BookData(String unique, String display, List info, int color) {
   this.uniqueName = unique;
   this.displayName = display;
   this.information = info;
   this.color = color;
   this.book = new ArrayList();
   this.book.add(new DesignerCanvas());
   this.language = ClientHelper.getLang();
 }
Ejemplo n.º 3
0
 public static BookData register(BookData data) {
   String language = data.language;
   if (language == null || language.equals("")) language = ClientHelper.getLang();
   HashMap<String, BookData> map = books.get(language);
   if (map == null) map = new HashMap();
   if (map.get(data.uniqueName) != null) return map.get(data.uniqueName);
   data = new BookData(data);
   map.put(data.uniqueName, data);
   books.put(language, map);
   return data;
 }
Ejemplo n.º 4
0
  @Override
  public String getPath() {
    WikiMod mod = getMod();
    WikiTab tab = this;
    String lang = ClientHelper.getLang();

    String dir = getData().getSaveDirectory();
    if (dir.equals("")) {
      return Enchiridion.root
          + File.separator
          + "wiki"
          + File.separator
          + mod.getKey()
          + File.separator
          + tab.getKey()
          + File.separator
          + lang
          + ".json";
    } else {
      String root = Enchiridion.root.getParentFile().getParentFile().getParentFile().toString();
      return root
          + File.separator
          + "src"
          + File.separator
          + "main"
          + File.separator
          + "resources"
          + File.separator
          + "assets"
          + File.separator
          + dir
          + File.separator
          + "wiki"
          + File.separator
          + mod.getKey()
          + File.separator
          + tab.getKey()
          + File.separator
          + lang
          + ".json";
    }
  }
Ejemplo n.º 5
0
 public BookData(BookData data) {
   this.book = new ArrayList(data.book);
   this.uniqueName = data.uniqueName;
   this.color = data.color;
   this.showBackground = data.showBackground;
   this.showArrows = data.showArrows;
   this.showNumber = data.showNumber;
   this.iconPass1 = data.iconPass1;
   this.iconPass2 = data.iconPass2;
   this.iconColorisePass1 = data.iconColorisePass1;
   this.iconColorisePass2 = data.iconColorisePass2;
   this.iconColorPass1 = data.iconColorPass1;
   this.iconColorPass2 = data.iconColorPass2;
   this.language = ClientHelper.getLang();
   this.displayName = data.displayName;
   this.displayInCreative = data.displayInCreative;
   if (data.information != null) {
     this.information = new ArrayList(data.information);
   }
 }
Ejemplo n.º 6
0
 @Override
 public DataTab getData() {
   return WikiData.instance().getTab(getUnlocalized(), ClientHelper.getLang());
 }