Custom Selection Box

Custom Selection Box

55k Downloads

Please externalize WorldRenderer logic/state

grondag opened this issue ยท 5 comments

commented

private void renderWorldBorder(MatrixStack matrices, float delta, long limitTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightmapTextureManager lightmapTextureManager, Matrix4f matrix4f, CallbackInfo ci) {

Would it be possible to move this logic and the accompanying color/time state to a different class with a public method? This will make it easier for Canvas to invoke it at the appropriate time.

When Canvas is active, WorldRenderer exists but the render method never runs, so until there is an appropriate API in place (still uncertain about the shape of that) it handles compatibility by calling any Mixin hooks it disables if the owning mod is present.

I can do it as-is by munging through the WorldRenderer class with reflection to pull out the necessary method, but will much less brittle if the method is defined externally.

I can pass in any needed parameters currently being shadowed.

commented

Hey guys, original mod developer here ๐Ÿ‘‹ already half-way ported my mod to newest version only to find this fork ๐Ÿ˜
I feel honored by you guys adopting my old baby ๐Ÿ˜‹

Why I'm writing here is because in my port I just used a mixin for LevelRenderer.renderHitOutline and I'm trying to wrap my head around a few things:

  • wouldn't that be the most compatible way? as I suppose it wouldn't be messing with your canvas stuff... @grondag
  • is there a reason you (@shedaniel) chose to use that (was there no such thing in 1.16?)
  • or is it related to the problem I'm having that I don't manage to control rendering (e.g. line thickness, depth test) ?

Also:

  • Did you abandon this mod? (if yes, in favor of BetterBlockOutline?) (i.e. is it worth it to upgrade?)

So many questions ๐Ÿ˜…

commented

Hey @tennox, I believe I did ask you for permission for this fork back in GitLab, but it would be great if you can take on from here as I am no longer maintaining this fork!

The supposed world renderer events weren't available at the time of the port, thus it wasn't used.

I have an in dev wip version using the new events and ported to 1.17, but that wasn't done due to time constraints.

commented

I forgot about you asking back then - but anyways wouldn't have a problem with the permission... Open source ๐Ÿคท

Cool, yeah I think I want to take over, and already started incorporating your code into the architectury template I started, as I want to support forge too & learn the new things that are in town since my time back in the days (quite amazing what's happened. Thanks to you also ;)

Yet I'm still assessing if it's worth to fully go for it as the BetterBlockOutline seems to do most of what I want. But it's rather clunky on the other hand ๐Ÿค”

In any case, I'd be happy for any wip code you throw at me.

If you're up for it, I'm on the quilt&architectury discord:
tennox#3162

commented

This can probably be resolved pretty easily now with Fabric's new world render events.

commented

I did design them with CSB in mind.