示例#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;
 }
示例#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();
 }
 @Override
 public void addTooltip(List list) {
   for (IItemStack stack : stackList) {
     if (stack == null || stack.getItemStack() == null) continue;
     if (EnchiridionAPI.draw.isMouseOver(stack)) {
       list.addAll(stack.getItemStack().getTooltip(ClientHelper.getPlayer(), false));
       break; // Only permit one item to display
     }
   }
 }
示例#4
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;
 }
示例#5
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";
    }
  }
示例#6
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);
   }
 }
示例#7
0
 @Override
 public DataTab getData() {
   return WikiData.instance().getTab(getUnlocalized(), ClientHelper.getLang());
 }