Skip to content

Conversation

@supsm
Copy link

@supsm supsm commented Nov 4, 2024

Effort to update frex to 1.21.

List of things that need addressing (may not be exhaustive):

  • fabriquilt/src/main/java/io/vram/frex/pastel/mixin/MixinRenderRegionCache.java:135 - RenderRegionCache.isAllEmpty has been removed, do we just remove the mixin?
  • common/src/main/java/io/vram/frex/mixin/MixinModelBakery.java:86 - @Redirect mixin target seems to be incorrect. Also the actual mixin itself is questionable
  • common/src/main/java/io/vram/frex/mixin/MixinModelBakery.java:116 - questionable; ModelBakery.loadModel has been removed (it seems that models are all always loaded during construction now)
  • common/src/main/java/io/vram/frex/base/renderer/mesh/BaseQuadEmitter.java - some methods in VertexConsumer have been removed (including but not limited to endVertex, defaultColor, addVertex/vertex with 14 parameters)
  • common/src/main/java/io/vram/frex/impl/model/ModelProviderRegistryImpl.java:109 - ModelResourceLocation is now a record containing ResourceLocation, rather than a subclass of ResourceLocation.
    • Some ModelProvider<ModelResourceLocation> have been changed to ModelProvider<ResourceLocation> in other parts of the code. Do these need to be changed back to ModelResourceLocation (and ModelProvider T constraint changed?)
  • common/src/main/java/io/vram/frex/pastel/PastelItemRenderContext.java:78 - ItemRenderer.getCompassFoilBufferDirect has been removed
  • Undo the import rearranging and check for style violations. Import rearrangement was done automatically through migrateMappings but I know @spiralhalo doesn't like that :P

@spiralhalo
Copy link
Collaborator

FYI, you can vram-ify the imports by setting this in IntellijIDEA Code Style settings.

import static all other imports
// <blank line>
import java.*
// <blank line>
import javax.*
// <blank line>
import all other imports
// <blank line>
import com.mojang.*
// <blank line>
import net.minecraft.*
// <blank line>
import net.fabricmc.*
// <blank line>
import io.vram.*
// <blank line>
import grondag.*

What does migrateMappings do? I never use it.

@supsm
Copy link
Author

supsm commented Nov 14, 2024

i still haven't figured out how to make intellij work with this 😅
updated from 2021 to 2024 recently, iirc the 2021 one worked but now it just doesn't...

What does migrateMappings do? I never use it.

It's some yarn (i think) thing to change the names of mappings across different versions since sometimes they are renamed. It can also be used to switch from yarn to mojang. I have a gist detailing the steps I took for updating the mappings since it doesn't currently allow changing mojang mapping versions directly for some reason. Sometimes it breaks but it saves me a lot of pointless renaming work

@Kneelawk
Copy link
Contributor

Kneelawk commented Dec 4, 2024

I just wanted to point out that VertexConsumer#endVertex() no longer exists. The way vanilla handles this is by starting a new vertex every time addVertex() is called and just writing directly to the buffer that gets put into the BakedMesh. However, QuadSink implementations cannot work this way, as they have to be both a QuadEmitter and a VertexEmitter (VertexConsumer). This means that you end up having to emit the current quad if the QuadSink was previously being used as a VertexConsumer and is now being used as a QuadEmitter. I handled this simply by flushing vertices (and emitting the previous quad if one was being built by VertexConsumer-specific methods) when any of the QuadEmitter-specific methods were called.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants