aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/enums/MaterialsKevlar.java
AgeCommit message (Collapse)Author
2024-02-06Fix dimethylbenzene names (#2488)GDCloud
add missing 'e'
2023-06-05Code cleanup (#2040)chill
* remove redundant suppressions * prettify commented code * improve comments The integer comment contradicted the code, so I deleted it. * delete commented-out code * update bitwise int flip from XOR to the dedicated tilda operator The flip was a 32-bit XOR, which is an int-flip. That XOR was replaced with an equivalent tilda operator. * convert a field to inline This field was used only once, so put it straight to where it is used. * remove fluid fix since no-one uses Forge version 1355 or earlier * unwrap switches where fitting In some places, we suppress IntelliJ's inspection RedundantLabeledSwitchRuleCodeBlock - we don't want to unwrap some of the suggested cases because we want to keep the consistency in a switch statement for the sake of readability. * fuse "collect" into Stream API * fix javadocs * remove unnecessary public modifiers from an interface Members of an interface are public by default. * move common parts outside of if * suppress OverrideOnly warning in a javadoc * remove unused lock * suppress warnings about unchecked casts These warnings require non-trivial fixes that are yet to arrive. For now, let's suppress them to reduce the warning-bloat. * remove outdated comment * remove final modifier from private methods Because they are private, it is hard to accidentally overwrite them. Therefore, the final modifier is redundant in this case. * refactor getIcon The first 'if' doesn't cover only tMeta == 9 && mConnectedMachineTextures, therefore the second if can be unrolled. The last switch is redundant because all tMeta values are covered by switches, but let's keep SOLID_STEEL as a fallback just in case. * explain what the casings are and why block casings are split * suppress switch-to-if suggestion * remove unnecessary null check The null is handled in doGenerateItem() * address redundant local variables * rename variables in onTick * suppress warning about accessing static member via instance * rephrase exception * rephrase javadoc * address field-can-be-final warnings * remove empty methods * enum cannot inherit, so protected is redundant * remove redundant throws * update imports to be not wildcard * remove unnecessary try-catch * update for loop * remove redundant code in order to use the diamond operator * update instanceof to use pattern variables * replace blank lines with <p> in javadocs * fix dangling javadocs * suppress warning about unreachable methods in javadocs * remove redundant operation * add the descriptions of parameters in javadocs Also fix javadocs along the way. * relax returned type in javadoc That was done in order to make the docs reflect the code more often. Otherwise, people may forget to change the returned type again with another change. * make long conversion explicit Integer multiplication can give a wrong result if one of the parts is not explicitly cast to long. Let's cast one of the parts where applicable. * remove unary plus * simplify unary minus * use addAll instead of forEach,add It was suggested by IntelliJ to replace the iteration with a bulk operation to improve performance. * replace .asList with .singletonList for consistency * simplify toArray calls Explanation from IntelliJ: There are two styles to convert a collection to an array: * A pre-sized array, for example, c.toArray(new String[c.size()]) * An empty array, for example, c.toArray(new String[0]) In older Java versions, using a pre-sized array was recommended, as the reflection call necessary to create an array of proper size was quite slow. However, since late updates of OpenJDK 6, this call was intrinsified, making the performance of the empty array version the same, and sometimes even better, compared to the pre-sized version. Also, passing a pre-sized array is dangerous for a concurrent or synchronized collection as a data race is possible between the size and toArray calls. This may result in extra nulls at the end of the array if the collection was concurrently shrunk during the operation. * split StringBuilder append Explanation by IntelliJ: Reports String concatenation used as the argument to appends. Such calls may profitably be turned into chained append calls on the existing StringBuilder saving the cost of an extra StringBuilder allocation. This inspection ignores compile-time evaluated String concatenations, in which case the conversion would only worsen performance. * annotate overriding methods with @Nonnull where needed The method that was overridden has @Nonnull so the method that is overriding should also have @Nonnull. * remove set adding itself to itself * remove null check because findField either works or blows up cpw.mods.fml.relauncher.ReflectionHelper::findField either returns a non-null value or throws a RuntimeException, so no need to check of null. * remove slot comparison with tInventory.length slot max value is 127 when tInventory.length is set to 256, which results in that the condition is always true and unnecessary. * remove aOutput2 null check As GT_Values.NI is null, there is no need to check aOutput2 for null again * suppress the suggestion to delete tMeta < 13 mConnectedMachineTextures can change, so tMeta range is not guaranteed * remove aCoverVariable % 3 < 2 the if above already limits the result of % 3 to "2", so the condition "less than 2" is always false. * unwrap "if" because bonus is unchanged Unwrap if because even if the bonus is a variable, it hasn't been changed for the past 8 years and is unlikely to be changed in the future. * reformat javadoc * improve ignoring an exception Make them either more clear or concise * fixup fix typo * update deprecated calls of newInstance() * remove testing BaseMetaTileEntity GregTech_API.constructBaseMetaTileEntity() checks the creation by itself, logging and throwing a runtime error if failed. * unwrap hatch-fill for do_SolarSalt To reach this branch, do_coolant needs to be false and we need to still be in the function, which means that do_SolarSalt was set to true in the previous top-tier "if". * remove always-false input-bus checks of MTE PlasmaForge size() is non-negative, and the values it is compared to are final and 0. * length and size are non-negative Therefore, there's no need to check their negativity * aOutput is guaranteed to be positive * tThereWasARecipe is always false when reached in its first occurrence * convert an assert into if Only tStack 2 is checked for null because if it isn't null then tStack1 also isn't null based on the "if" above. Also IntelliJ was sure that tStack is not null for some reason. On a side note, assertions work only either with a specified flag or in debug runs. Therefore, it is dangerous to rely on them. * simplify stone-gravel-cobble if tBlock != Blocks.stone because of the if at the start of the method. for the last else-if, tBlock == Blocks.gravel because of the check slightly above the change. * interDimensional is always true because of the first if * convert an example to javadoc * remove always-false statements * replace referential string equality with equals If we compare strings by "==", we compare references to them, which is not what we usually want. I wasn't sure if String Pool works here, so I played it save with equals(). * use Automatic Resource Management for AutoCloseable ByteBufOutputStream * add todo to swap from sleep to event bus * null is checked by instanceof * merge switch branches * add a TODO to use clamp() * new String declaration is redundant * use getOrDefault for a map * replace StringBuilder with concatenation where fitting Using a StringBuilder to concatenate two string will not make the program faster or more understandable, so I swapped it to concatenation. * remove unnecessary continue * flip if * remove redundant returns * unwrap ifs It's checked at the top "if" that aType == IItemRenderer.ItemRenderType.INVENTORY, so all aType.equals(IItemRenderer.ItemRenderType.INVENTORY below are always true. * remove checking all GT VERSIONs except the API one * remove version check from GT_Mod and delete respective VERSION fields Aside from GregTech_API.VERSION, these fields are not used anywhere in the project, so only GregTech_API.VERSION was kept. The idea and the usage check were done by miozune.
2023-04-10Update spotless config to 0.2.2Raven Szewczyk
2023-04-01update spotless formatting (#1827)boubou19
2023-01-30[ci skip] spotlessApply with the new settingsJason Mitchell
2022-12-29Naphthenic acid (#1589)Martin Robertz
* add burn value for NaphthenicAcid 60k in Semi Fluid generator (cherry picked from commit 3fa145932b64025067e807f4ff900f51029d07bd) * add Naphthenic acid recipes and change a few (cherry picked from commit 8b6b6d72dd79b4549dccd3732ccca6e219dd8ce7) * spotless * fix error (cherry picked from commit db7b322cece6cf151f92ab6aa467bc8e4c84bda8) * Chemical balance fixes Co-authored-by: Pxx500 <81298696+Pxx500@users.noreply.github.com>
2022-08-27Update buildscript & apply spotless (#1306)Raven Szewczyk
* Update dependencies * Update buildscript, apply spotless
2022-07-09Standardization of GT5u Chemical Recipes (#1062)Yang Xizhi
* chemical rebalance 1 item unit = how many atom in it 1 fluid unit = 1b * remove some tiny dust * remove crop tiny dust * Na2S * Acetone chain rework and fix COx * electis balance * Fix cell amount * more fix * acid, rubber and epoxy * no * roast thing * pbi * number wise unnerf roast recipe * uranium, indium, titanium lossless cycle * salts * clay * silicon * derp * corret sodium carbonate chemical formula * revert lossless indium * fix * scheelite * silicon line * ore dust * kevlar line * fix * don't change register name * fix * nerf NaOH electrolysis recipe to match water * fix Co-authored-by: Pnc6lx <2458894429@qq.com> Co-authored-by: Martin Robertz <dream-master@gmx.net> Co-authored-by: miozune <miozune@gmail.com>
2022-06-24Kevlar (#1018)Martin Robertz
* add first recipes for Kevlar Line * merge conflict * add more materials and recipes for kevlar line * fix butanol naming (cherry picked from commit 808c91e2904314f67085c8cce2d579d6ac711bbb) * fix more Kevlar recipes (cherry picked from commit 3688dda0a8d4cd79edd76072d04a59fe4e8b3ca4) * fix more recipes (cherry picked from commit a527b22bd815629372c8dca98e579628b1128d46) * add more Kevlar stuff * add more materials for Kevlar Line * add more Materials and recipes for Kevlar (cherry picked from commit 448083f5c1789cd78cc1dc049c859c3bec4c2485) * Merge branch 'Kevlar' into dev # Conflicts: # src/main/java/gregtech/api/enums/Materials.java * add second maven from ic2 * overseen * add more kevlar materials and recipes * fix naming * fix metal block 9 was not set * fix materials and names (cherry picked from commit 3119d83ba53f43de6163de3f01edd6081f318cd6) * Fix Acetylen Material (cherry picked from commit d379365de519c503a78f68ce5ab2a3de02ff7852) * fix recipes (cherry picked from commit 2e2033773e1aa92224932fc93aaadaeacb83e8ba) * remove Calcium Hydroxide Formula * add ALF3 * make Nitrochlorobenzene backwards compatible fix a lot of recipes (cherry picked from commit ca2a59db88f036649f6d8ff4b5e5565c9da400c9) * add more Kevlar materials fix recipes remove Nitrobenzene 3 and 4 * remove 2 Buten 1,4 Diol fix recipes (cherry picked from commit 811549dc9f4f73e77752d5faef2b6d7243e6e625) * add spinnert Item, Woven and fiber kevlar add more materials add more recipes * fix derp (cherry picked from commit dc1e24753c39c70ad262f7bc2ce70d839a655942) * fix materials id derp (cherry picked from commit c7ba51ad846ae466054fb5e002fa8c634e3dfcad) * fix recipes (cherry picked from commit f8e6e32acaee563d3683b79980459bc464c6e716) * fix more recipe add Kevlar material add fiber and woven kevlar recipes (cherry picked from commit cc99809ea80f616ffe5c22e0d3f189a7b5cd7bdb) * add Spinneret recipe (cherry picked from commit 4db8497380b39edda8a00964613eae3a72cebbcb) * add Bromine add Liquid Kevlar Texture fix recipe add more Kevlar Materials (cherry picked from commit e2f96cb825f5ededaff3989b7e087b51b57a913c) * Fix recipes (cherry picked from commit e4f8d0d33f81f94124b733cbeb975ca0b4a33da2) * fix recipes (cherry picked from commit 7c6b7cdd0fd0720f58993faeaa81dd95d1b3757c) * Add more Kevlar recipes add more Materials (cherry picked from commit 9c35ca47e917fb2ac082ba5077e65001a7ab074a) * add more Materials (cherry picked from commit 12c598fe8784198c996eda3d5e072b829cf33ab8) * fix Kevlar recipes add more recipes * finish kevlar line (cherry picked from commit 39567610956ac02d3001f68851ddeb7e5d63aed7) * fix a few more recipes (cherry picked from commit e28283321ce1670d6684a47c0fd3fd263da8a6cb) * fix recipe (cherry picked from commit df89c96bc826b321f81c1c3af521469decdcff22) * try to add back single block distillation recipes * stupid me :) (cherry picked from commit 7fc6c375605d85b7cc791aa9818174a1cb2f7f59) * fix distillation recipes (cherry picked from commit e2351c4390b632b9e361a19ba03225c82766e455) * fix more recipes (cherry picked from commit 0fefb881e80659d41308dec85c59a114862aaf40) * remove not working texture (cherry picked from commit f70cdbf7e0138ed6cc867153693db527f04a78f8) * fix more recipes (cherry picked from commit 6c45aa36d4176af8f41e64a8758e31618ac56ab9) * rename chemicals (cherry picked from commit 4aa52352319b72bca6ec27ea65aba42bd293bb39) * fix recipes (cherry picked from commit 0885006add9ce78614a4a45cc8ae1d46a5b466d8) * remove unused Kevlar Materials (cherry picked from commit 69525c04a6505ef06e1f7cc6166aaba808b0ba26) * add more Kevlar changes (cherry picked from commit a16f12fe71fa65ce7706b049b5e94602cb676b37) * change Kevlar line a bit (cherry picked from commit b06cdb634125465e073adf1e09f1821b8794d243) * add Rhodium as compat metal (cherry picked from commit cfde983db03efec6d83367cbd5c13887eef6aa67) * fix texture set (cherry picked from commit 7f2f5508acb3613505522db98eef948c8e269892) * add more Kevlar recipes disable Rhodium GT dummy (cherry picked from commit 9389fe086e9d8a4bef92115a9eef8816fdf51c43) * fix recipes (cherry picked from commit 7dd26f59af45619c3cf2045edfb6c38198358cb0) * fix more recipes (cherry picked from commit b407abebd0ce1d5351b770a729d75fb3fc7a0e87) * fix more recipes (cherry picked from commit f2c24ea7fe4a2dfb9a95129d9a0c4b03b70f34d5) * fix kevlar recipes (cherry picked from commit fb9f937b7f31ab9f3f958a0a53772c82f0d55b64) * add chemical Formular (cherry picked from commit 5116ee58132bb1723c318e8f2c20b52f97da3b9d) * fix recipe (cherry picked from commit ce10e89e059946f7020219f2a79397862272d2ab) * fix circuit (cherry picked from commit 0ee7d4535dab0bb1a20665160f11bdf01efd411d) * fix most of the Kevelar recipes retier them remove potassium Nitrate its still Saltpeter (cherry picked from commit 49e1eec47c4c86044ce748d96dc5a11d1db68877) * add back Potassium Nitrate for compt reasons (cherry picked from commit eee82dc1783d40fe4b68d87ee0da646cc4ea5262) * fix more Kevlar recipes (cherry picked from commit aaaf2969da671cf923f7213f71e9c8eb89091e87) * fix name in Kevlar line (cherry picked from commit e7a883254d2c89f289453cdcd67be5dc1fc1c53a) * Lowered EU cost on Wood Tar - Lowered EU/t on the Wood Tar DT recipe from 256 to 224 EU/t (value suggested by Dream). The old value is just a bit too high for an HV Semifluid Generator to power the DT with the Creosote output, which forced lower tier generators and spam. * Removed DT Recipes and Added Alternatives - Removed circuits in DT recipes for the HV Oil and Benzene processing; - Added IV recipes to obtain the new chemicals for the Kevlar line (the Dimethylbenzene isomer and Naphthenic Acid), without changing the setup of players that were previously processing those for their early-mid game purposes. * Revert "Removed DT Recipes and Added Alternatives" This reverts commit 165ad2e4d196b5966af0fe282658f1bea3d579a9. * Revert "Lowered EU cost on Wood Tar" This reverts commit 420d0d5cd530d3e29164c3a9c384d4187a46495a. * fix Copper oxide use old Material Shift ids add melting Point (cherry picked from commit 488d6598513307bb4221bbb50904a32e5a0bd069) * Update GT_Loader_Item_Block_And_Fluid.java * MAchine REcipe code too large Co-authored-by: Glease <4586901+Glease@users.noreply.github.com> Co-authored-by: Steelux8 <steelux7@gmail.com>