Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert from ASM to Mixins #2192

Merged
merged 46 commits into from
Jun 20, 2024
Merged

Convert from ASM to Mixins #2192

merged 46 commits into from
Jun 20, 2024

Conversation

ALongStringOfNumbers
Copy link
Contributor

@ALongStringOfNumbers ALongStringOfNumbers commented Nov 24, 2023

What

Converts our ASM in the project to Mixins, for ease of maintainability, and hopefully fixing up some compat.

Mixins and MixinExtras is being pulled from MixinBooter specifically.

A new Package has been created, that being gregtech.mixins and after all ASM has been converted to Mixins, I am planning on moving GregTechLoadingPlugin into this package.

Where applicable, I am just calling the existing Hooks class from the Mixin. Although this can be changed.

For debugging purposes during this conversion, I have the gradle.properties option enableCoreModDebug set to true. This should definitely be set to false before merging. For those interested, this option outputs all transformed classes into run/CLASSLOADER_TEMP, and can be used to compare the code transformed by our ASM and by our Mixins. This does not currently work for inner classes.

  • JEI Transformer: There is currently a Mixin present for replicating the JEI Transformer, although it needs to be tested to ensure that all information is shown in the tooltip, in the same place that it was previously.
  • Concrete Powder Transformer: Works.
  • Layer Custom Head Visitor: Should work fine, Just needs verification (in game and in the debug outputs)
  • Special Armor Apply Transformer: Should work fine, just needs verification
  • Layer Armor Base Transformer: Should work, just needs verification
  • Region Render Cache Builder Transformer: Should work, needs verification
  • Render Chunk Transformer: Does not currently work I believe
  • Entity Renderer Transformer: Needs verification
  • Block Transformer: Should work, needs to be tested with and without CTM, and put in a separate Refmap, so we can queue it if CTM is not loaded
  • World Transformer: (This corresponds to the RenderGlobal Mixin) Should work fine, just needs verification
  • Model CTM Transformer: Needs Implementation
  • Abstract CTM Baked Model Transformer: Needs Implementation
  • Little Tile Transformer: Implemented, needs verification
  • CCL Transformer: Works
  • NuclearCraft Transformer: Considering Removing these, as we broke compat more than what the existing ASM was fixing, so much so that we have to tell people to disable the compat right now
  • Render Item Transformer: Got the Lamps part done. Need to implement durability bars
  • Recipe Repair Transformer: Needs Verification
  • Damage Source Transformer: Implemented, was apparently causing issues though
  • The One Probe Transformer: Implemented, should work. For this one though, we need to check if we actually need this any more, especially after the rewrite of our machine/block harvest levels and tools, and the implementation of our tool classes
  • Minecraft Transformer: Implemented, work fine. It puts the text in a different place than it was with the ASM, which is a pretty minor thing that someone can work on if they want
  • Model Loader Registry Transformer: Implemented, needs verification
  • Enchantment Application Transformer: Needs Implementation, going to be somewhat hard

Potential Compatibility Issues

Should be no compat issues, if everything is working correctly

@ALongStringOfNumbers ALongStringOfNumbers added the type: feature New feature or request label Nov 24, 2023
@ALongStringOfNumbers ALongStringOfNumbers added this to the 2.9 milestone Nov 24, 2023
@IntegerLimit
Copy link
Contributor

Note on the NC Mixin/ASM: We implemented a proper fix in Nomi-Labs. Might want to pull that in to GT. (Made with help from @YoungOnionMC)

Mixin

Logic

Hope this helps!

Copy link
Contributor

@ghzdude ghzdude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

found some issues with RecipeRepairItemMixin:

  • gregtechCEu$matches applies, but passes in the same parameter twice
  • gregtechCEu$getCraftingResultFirst fails to apply
  • gregtechCEu$getCraftingResultSecond fails to apply
  • gregtechCEu$getRemainingItemsInject fails to apply

these mixins seem to apply properly:

  • JEITooltipMixin
  • LayerCustomHeadMixin
  • LayerArmorBaseMixin
  • RegionRenderCacheBuilderMixin
  • RenderChunkMixin
  • EntityRendererMixin
  • AbstractCTMBakedModelMixin
  • CCLDescriptionMixin
  • RenderItemMixin
  • DamageSourceMixin
  • TheOneProbeMixin
  • MinecraftMixin
  • ModelLoaderRegistryMixin

the other mixins that weren't mentioned i haven't tested yet

@TechLord22 TechLord22 merged commit 5ff7cdb into master Jun 20, 2024
3 checks passed
@TechLord22 TechLord22 deleted the alson-to-mixins branch June 20, 2024 00:55
tekcay added a commit to tekcay/GTCEu-tkcy that referenced this pull request Jul 7, 2024
* Remove NuclearCraft ASM (GregTechCEu#2467)

* Update zh_cn.lang (GregTechCEu#2445)

* Allow polarizing block -> magnetic block (GregTechCEu#2469)

* Fusion bloom fix & other bloom effect API modifications (GregTechCEu#2470)

* Inital Vintagium Support (GregTechCEu#2463)

* Fix Ore Dict Ingredients When Changing OreDicts with CT & GS (GregTechCEu#2456)

* Fix the large turbine rotor texture (GregTechCEu#2485)

* Small QoL Bee Update (GregTechCEu#2458)

* Fix excessive packets & re-renders with AEHostable parts (GregTechCEu#2487)

* Allow dynamic hatch placement on Distillation Tower (GregTechCEu#2477)

* Add a faster recipe for drilling fluid with distilled water (GregTechCEu#2484)

* Fix input busses saying "Item Auto-Output Enabled" instead of "Item Auto-Input Enabled" (GregTechCEu#2489)

* fix pyrolyse speed (GregTechCEu#2449)

* Brute-force Fix of RAM Usage Problem When Using Alfheim (GregTechCEu#2475)

* Clean up AEHostable part fix (GregTechCEu#2488)

* Various Cleanroom Improvements (GregTechCEu#2480)

* Updating bees using the new Mutation Condition (GregTechCEu#2486)

* Allow MTEs / recipe map workables to directly control their JEI categories (GregTechCEu#2479)

* Rounds energy displayed by TOP (GregTechCEu#1063)

* dependency updates

* Allow recipe logic to set EU/t and speed discounts (GregTechCEu#2496)

* Convert from ASM to Mixins (GregTechCEu#2192)

* Glass tube recycling (GregTechCEu#2509)

* Improve assembly line laser render (GregTechCEu#2495)

* Dynamically change the direction of the arrow in "Manual IO Mode" to reflect the direction of the "IO Mode" (GregTechCEu#2491)

* Support Creative Mode Pick Block (GregTechCEu#2428)

* Add Polybenzimidazole Block Conversion Recipes (GregTechCEu#2511)

* GroovyScript 1.1.0  (GregTechCEu#2506)

* Update build script version to 1720106721 (GregTechCEu#2503)

* workaround GHA bug for tests workflow

* Fix liquid and gas registry key functions overlapping (GregTechCEu#2514)

* Namespaced MTE Registries (GregTechCEu#2505)

* Split assembler and circuit assembler textures (GregTechCEu#2388)

* bump GHA versions (GregTechCEu#2516)

* Fix failing builds due to Vintagium (GregTechCEu#2519)

* Fix Mixin Warnings About `maxShiftBy` (GregTechCEu#2520)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants