aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/client
AgeCommit message (Collapse)Author
2024-10-21Import pollution mixins from hodgepodge (#3395)Alexdoru
Co-authored-by: Martin Robertz <dream-master@gmx.net> Co-authored-by: boubou19 <miisterunknown@gmail.com>
2024-10-02Cleanup the codebase (#3311)Alexdoru
Co-authored-by: boubou19 <miisterunknown@gmail.com>
2024-09-19Infinite Spraycan Additions (#3226)querns
Co-authored-by: Caedis <Caedis@users.noreply.github.com>
2024-09-12Merge config categories (#3152)boubou19
Co-authored-by: miozune <miozune@gmail.com> Co-authored-by: Martin Robertz <dream-master@gmx.net>
2024-09-08Adds Infinite Spray Can, left click event for item behaviors (#3085)querns
Co-authored-by: Martin Robertz <dream-master@gmx.net> Co-authored-by: boubou19 <miisterunknown@gmail.com>
2024-09-02The Great Renaming (#3014)NotAPenguin
* move kekztech to a single root dir * move detrav to a single root dir * move gtnh-lanthanides to a single root dir * move tectech and delete some gross reflection in gt++ * remove more reflection inside gt5u * delete more reflection in gt++ * fix imports * move bartworks and bwcrossmod * fix proxies * move galactigreg and ggfab * move gtneioreplugin * try to fix gt++ bee loader * apply the rename rules to BW * apply rename rules to bwcrossmod * apply rename rules to detrav scanner mod * apply rename rules to galacticgreg * apply rename rules to ggfab * apply rename rules to goodgenerator * apply rename rules to gtnh-lanthanides * apply rename rules to gt++ * apply rename rules to kekztech * apply rename rules to kubatech * apply rename rules to tectech * apply rename rules to gt apply the rename rules to gt * fix tt import * fix mui hopefully * fix coremod except intergalactic * rename assline recipe class * fix a class name i stumbled on * rename StructureUtility to GTStructureUtility to prevent conflict with structurelib * temporary rename of GTTooltipDataCache to old name * fix gt client/server proxy names
2024-08-27Config/gregtech.cfg (#2939)boubou19
* first pass on config migration * second pass on config migration * removing bad configs * rename config classes and register them * move debug options to its own debug category * migrate pollution * finish migrating general config * removing useless config * finish GregTech.cfg port to GTNHLib * don't accidentally force panic mode in dev env * typo * defaults are now handled by the confg handler * remove dead config * force config save after defaults are being written * stop messing with the GregTech.cfg externally * removing comments * new underground fluid builder and porting default underground fluids to code * move config handlers of gregtech.cfg in their own package * process MachineStats.cfg * yeeted MaterialProperties.cfg * remove unused compat in GTNH * process OverpoweredStuff.cfg * process Other.cfg * ungregify some config variables * remove unused variables * fix Ids.cfg not being populated * delete duplicate printing of MTE IDs in GT5U clients * bump hodgepodge version to get mod phase timers * process Client.cfg * fix bad category naming * registering all the config handlers in gui * bump GTNHLib version * actually only registering client configs * use proper double arrays now * move GT ore mixes to patternbuilders * dead code * fix multifiles config not being handled properly * import class from NHCore * removing reflection * use enums for registration * yeet config for Asteroid dimensions * remove unused since 2015 enum entry * todo * rework oremix enums * imported dimension data in enums * convert old dirty predicate into proper one * hook gagreg onto the OreMixes enum * finally nuke worldgen.ore.mix config category! * hook gagreg small ores onto the SmallOres enum * imported dim values in enum * fix dirty work around in vm predicate * yeet unused classes * hook GT stones to GTStones enum * yeet all the remaining booleans in the worldgen category * port endasteroids category * port general category * deprecated * yeet unused bw compat * finish worldgen config migration * hardcode config into code * remove not generated config entry * remove Unification.cfg * fix build * migrate oreveins away from config * migrate small ores away from config * delete config parser * forgotten * fix EoH recipe crash in dev * fix GT NEI Ore Plugin config and csv paths * shade opencsv * rewrite csv generator * spotless apply
2024-08-15Electric jukebox (#2827)Raven Szewczyk
* GT music system * Minor fix for some glitches when switching dimensions with P2Ps on both sides * Most features implemented except headphones * Implement wireless headphones * Disable debug mode * Spotless --------- Co-authored-by: Martin Robertz <dream-master@gmx.net>
2023-12-03Refactor RecipeMap (#2345)miozune
* Remove deprecated and unused things * Move recipemap subclasses * Move GT_Recipe_Map to outside and rename to RecipeMap * Move recipemap instances to separated class & remove prepending s * Remove useless GT_Recipe constructors * Always use ModularUI * Rename IGT_RecipeMap -> IRecipeMap * Add RecipeMapBuilder * Remove more deprecated and unused things * Fix RecipeMap type parameters * Use multimap for recipe index * Fix bending recipe error in dev env * Remove mUniqueIdentifier * Update AE2FC * Less edgy texture for NEI recipe background * Add replicator fluid output slot for NEI and machine GUI * Fix fluid fuels not having fuel value in large boilers * Remove GT_RectHandler and NEI_TransferRectHost * Remove RecipeMapHandler * Move NEI energy description from RecipeMapFrontend to Power * Refactor the way to filter fusion recipes * Check restriction for some properties * Remove showVoltageAmperage * Make Power accept GT_Recipe * Fix NPE * Move NEI duration description to Power from Frontend * Directly implement IRecipeProcessingAwareHatch for GT_MetaTileEntity_Hatch_InputBus_ME * Make Power integrated with GT_OverclockCalculator * Rename Power -> OverclockDescriber * Don't modify recipe find logic until postload finishes * Reformat reserved MTE ids * Fix check for too few inputs on recipe addition * Move replicator logic to backend * Stop un-hiding assline recipes * Allow setting custom recipe comparator & implement for fusion * Update AE2FC * Rename getRecipeList and getRecipes -> getRecipeMap * Automatically register recipe catalysts * Cleanup the way to detect recipe collision * Make use of BasicUIProperties for basic machines * Make use of BasicUIProperties for UIHelper * Rename specialHandler -> recipeTransformer * Add way to automatically register handler info * Add recipe category * Add some APIs for addons * Rename blastRecipes -> blastFurnaceRecipes * Remove GT_MetaTileEntity_BasicMachine_GT_Recipe#mSharedTank and #mRequiresFluidForFiltering * Don't require setting duration and EU/t for fuel recipes * Don't require setting EU/t for primitive blast furnace recipes * Revert change to addMultiblockChemicalRecipe * Fix large boiler general desc recipe not being added * Hide duration and EU/t from large boiler * Cleanup recipe stacktrace draw * Extend metadata usage of recipe builder to recipe itself * Implement metadata handling & NEI comparator for PCB factory * Some rename around NEIRecipeInfo * Some toString implementations * Add more APIs for addons & some rename * Infer handler icon from recipe catalyst if one is not set * Also shrink recipe title when OC is not used * Remove rare earth centrifuge recipe * Use metadata for replicator backend * Adjust geothermal generator output slot * Allow having multiple transferrects * Store recipemap reference in backend * Rename vacuumRecipes -> vacuumFreezerRecipes * Add config to tweak visibility of recipe categories * Remove mHideRecyclingRecipes in favor of recipe category config * Fix typo fluidSolidfierRecipes -> fluidSolidifierRecipes * Refactor findRecipe and ProcessingLogic to use Stream * Fix BBF handler icon & remove bronze blast furnace * Add fluent API for findRecipe * Add way to stop adding progressbar * Change arg order for special texture * Avoid overwriting interesting failure with NO_RECIPE * Some changes for FuelBackend * Set space project icon * Remove localization from TT * Remove CNC recipe adder * Move recipe extractor from AE2FC * Minor internal change for ProcessingLogic#applyRecipe * More javadoc on #getAvailableRecipeMaps * Better implementation of #ofSupplier * Move replicator exponent config to GT_Proxy * Remove RC & IC2 macerator handling * Rename StreamUtil -> GT_StreamUtil * Refactor code around RecipeMetadataStorage * Revise #compileRecipe javadoc * Switch extreme diesel recipe loader to downstream recipe map * Optimize #reMap * Rename reload -> reloadNEICache * Minor tweak for drawEnergyInfo * a bit more doc * Adjust recipe catalysts * Add toString implementation for GT_Fluid for debug * Minor revision for OilCrackerBackend * Index replicator recipes by material --------- Co-authored-by: Glease <4586901+Glease@users.noreply.github.com>
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-04Modid work (#1833)boubou19
* add all mods founds in NHCore * depracte old strings * add ars magica 2 * more enum work * use a switch * spotless * more mod id rework * more mod id rework * more mod id rework * should be last * spotless * rename to make more sense * add path attribute * add getResourcePath to enum * spotless
2023-04-01update spotless formatting (#1827)boubou19
2023-04-01Implement Power Logic, Pollution Logic and Processing Logic for MuTEs and ↵BlueWeabo
many other things (#1823) * update bs 2 * fuel consumption and energy implementation. clean up * don't register XD * some clean up * coke oven work * semi-working coke oven somehow i broke the activating of the multiblock * power logic * PowerLogic * clean up, saving loading nbt * small cleanup and pollution * pollution working :P * Energy mostly working, wallsharing * processing logic * fix npe and deregister * review requests * missed one * remove extra 0
2023-03-22Activity Sound (#1811)Maxim
* Added activity sound * Added acitivity sound to DTPF * Added missing annotation * Missed one
2023-03-20Add Insanely & Mega ultimate battery (#1807)GDCloud
* Add items * Add error-tier tooltip * localisation * textures
2023-03-01Add way to register tooltip without using oredict (#1779)miozune
2023-01-30[ci skip] spotlessApply with the new settingsJason Mitchell
2022-12-20Use GTNHLib Tooltip Animation (#1569)glowredman
* Update build.gradle * Extract tooltip animation to API * Use GTNHLib * Delete AnimatedTooltipHandler.java
2022-09-08use stringbuilder in GT_TooltipEventHandler (#1357)Alexdoru
* use stringbuilder in GT_TooltipEventHandler * spotless zzzz
2022-08-27Update buildscript & apply spotless (#1306)Raven Szewczyk
* Update dependencies * Update buildscript, apply spotless
2022-07-31Better Endgame Wireless EU (#1144)Connor-Colenso
* Basis of changes * Adjust voltage tiers to remove OpV * Better textures, move IDs around etc. * Format cleanup * Log level change * Dynamos * More stuff * More OpV purging. * Fixes * Remove wire support. * Textures * IDs * Update hatch/dynamo * New number formatter * Add default method * Add save method on world close * Cleanup old comments/debug * Author * Author * Author * Author * Restructuring of code * Unit tests * More unit tests + cleanup * Fix ID shift + add spares Co-authored-by: GTNH-Colen <54497873+GTNH-Colen@users.noreply.github.com>
2022-01-28Texture tooltips update (#903)Colen
* New circuits * Fix last tier ore dict * Colorfull tier tooltips (#898) * Make Repellator stop slimes spawning (#896) * Add special tooltip handling, requested by Colen Co-authored-by: Alkalus <3060479+draknyte1@users.noreply.github.com> Co-authored-by: glowredman <fredcraft00@gmail.com> * Fixed github shenanigans with new tier colours. * Update A LOT of textures (mostly minor) * Remove extraneous comments. * Remove obsolete comments and update materials.java. * Add tooltips for all batteries in base GT. * Remove test case Co-authored-by: Alkalus <3060479+draknyte1@users.noreply.github.com> Co-authored-by: glowredman <fredcraft00@gmail.com>
2022-01-27Add new circuit tiers (#895)GTNH-Colen
* New circuits * Fix last tier ore dict * Colorfull tier tooltips (#898) * Make Repellator stop slimes spawning (#896) * Add special tooltip handling, requested by Colen Co-authored-by: Alkalus <3060479+draknyte1@users.noreply.github.com> Co-authored-by: glowredman <fredcraft00@gmail.com> Co-authored-by: Alkalus <3060479+draknyte1@users.noreply.github.com> Co-authored-by: glowredman <fredcraft00@gmail.com>
2022-01-06Add in game GUI to configure client preference (#852)Glease
* Add in game GUI to configure client preference * Fix backslash