(OreDictMaterial aMat, ItemStack aDefaultBook, ItemStack aDefaultLargeBook)
| 763 | } |
| 764 | |
| 765 | public static boolean createMaterialDictionary(OreDictMaterial aMat, ItemStack aDefaultBook, ItemStack aDefaultLargeBook) { |
| 766 | if (aMat == null) return F; |
| 767 | |
| 768 | String tPage = ""; |
| 769 | List<String> tBook = new ArrayListNoNulls<>(); |
| 770 | boolean temp = F; |
| 771 | int tCounter = 0; |
| 772 | |
| 773 | tBook.add("===================\n"+aMat.getLocal()+"\n===================\nID: "+(aMat.mID<0?"NONE":aMat.mID)+"\nMelting: "+aMat.mMeltingPoint+" K\nBoiling: "+aMat.mBoilingPoint+" K\nPlasma: "+aMat.mPlasmaPoint+" K\n===================\nDensity:\n"+(aMat.mGramPerCubicCentimeter == 0 ? "???" : aMat.mGramPerCubicCentimeter)+" g/cm3\n"+aMat.getWeight(U)+" kg/unit\n===================\n"); |
| 774 | |
| 775 | //---------- |
| 776 | |
| 777 | if (aMat.mComponents == null) { |
| 778 | if (aMat.contains(TD.Atomic.ELEMENT)) { |
| 779 | temp = T; |
| 780 | tPage="Atomic Structure:\nProtons: "+aMat.mProtons+"\nElectrons: " + aMat.mElectrons + "\nNeutrons: " + aMat.mNeutrons + "\nMass: "+aMat.mMass+"\n===================\n"; |
| 781 | for (TagData tTag : TD.Atomic.ALL) if (tTag != TD.Atomic.ELEMENT && tTag != TD.Atomic.NONMETAL && aMat.contains(tTag)) tPage += tTag.getLocalisedNameLong() + "\n"; |
| 782 | } |
| 783 | } else { |
| 784 | temp = T; |
| 785 | tPage="Components per "+aMat.mComponents.getCommonDivider() + "\n===================\n"; |
| 786 | for (OreDictMaterialStack tMaterial : aMat.mComponents.getUndividedComponents()) tPage += (tMaterial.mAmount / U)+" "+tMaterial.mMaterial.getLocal()+"\n"; |
| 787 | } |
| 788 | |
| 789 | if (temp) {tBook.add(tPage); temp = F;} |
| 790 | |
| 791 | //---------- |
| 792 | |
| 793 | |
| 794 | if (aMat.mToolTypes > 0) { |
| 795 | tPage="Tool Properties\n===================\n"; |
| 796 | tPage+="Durability:\n"+aMat.mToolDurability; |
| 797 | tPage+="\nQuality:\n"+aMat.mToolQuality; |
| 798 | tPage+="\nSpeed:\n"+aMat.mToolSpeed; |
| 799 | tPage+="\nHandle:\n"+aMat.mHandleMaterial.getLocal()+"\n"; |
| 800 | tBook.add(tPage+"===================\n"); |
| 801 | } |
| 802 | if (!aMat.mEnchantmentTools .isEmpty()) { |
| 803 | tPage = "Tool Enchantments\n===================\n"; |
| 804 | for (ObjectStack<Enchantment> tEnchantment : aMat.mEnchantmentTools ) tPage += tEnchantment.mObject.getTranslatedName((int)tEnchantment.mAmount) + "\n"; |
| 805 | tBook.add(tPage+"===================\n"); |
| 806 | } |
| 807 | if (!aMat.mEnchantmentWeapons.isEmpty()) { |
| 808 | tPage = "Weapon Enchantments\n===================\n"; |
| 809 | for (ObjectStack<Enchantment> tEnchantment : aMat.mEnchantmentWeapons) tPage += tEnchantment.mObject.getTranslatedName((int)tEnchantment.mAmount) + "\n"; |
| 810 | tBook.add(tPage+"===================\n"); |
| 811 | } |
| 812 | if (!aMat.mEnchantmentAmmo .isEmpty()) { |
| 813 | tPage = "Ammo Enchantments\n===================\n"; |
| 814 | for (ObjectStack<Enchantment> tEnchantment : aMat.mEnchantmentAmmo ) tPage += tEnchantment.mObject.getTranslatedName((int)tEnchantment.mAmount) + "\n"; |
| 815 | tBook.add(tPage+"===================\n"); |
| 816 | } |
| 817 | if (!aMat.mEnchantmentRanged .isEmpty()) { |
| 818 | tPage = "Ranged Enchantments\n===================\n"; |
| 819 | for (ObjectStack<Enchantment> tEnchantment : aMat.mEnchantmentRanged ) tPage += tEnchantment.mObject.getTranslatedName((int)tEnchantment.mAmount) + "\n"; |
| 820 | tBook.add(tPage+"===================\n"); |
| 821 | } |
| 822 | if (!aMat.mEnchantmentFishing.isEmpty()) { |
no test coverage detected