Xray Mod (Fabric/Forge)

Xray Mod (Fabric/Forge)

1M Downloads

Xray and Cave Hotkeys not functioning correctly when used with Rubidium.

Gamemassa opened this issue ยท 9 comments

commented

Mod version

2.0.4

Minecraft version

1.19.2

Mod loader

Forge

Description of the issue

When I have both Xray and Rubidium installed, the Xray and Cave hotkeys are not functioning correctly.

Excepted behavior

image

Obtained behavior

image

How to reproduce

No response

Do I want to contribute to fix it?

Maybe

Something else?

No response

commented
commented

I solved, but have poor performance.
we need to mixin Rubidium's class,cause Rubidium replace original render.

@Mixin(value = BlockOcclusionCache.class)
public class MixinRubidiumBlockOcclusionCache {
    @Inject(at = @At("RETURN"), method = "shouldDrawSide", cancellable = true, remap = false)
    public void shouldDrawSide(BlockState state,
                                       BlockGetter reader,
                                       BlockPos pos,
                                       Direction face,
                                       CallbackInfoReturnable<Boolean> ci) {
        XrayMain.getMod().shouldSideBeRendered(state, reader, pos, face, ci);
    }

    private MixinRubidiumBlockOcclusionCache() {
    }
}

BlockOcclusionCache is from Rubidium.

problems:

Chunk are slow to load,

image

Press x and wait for a second. ores also show slowly.
image

I think this way may broke some optimizons, but I can't dig deeper due to my knowledge.

commented

Sorry, the poor performance has cause by my custom logging. After checking my code, it works well.

commented

feel free to open a new pull request if you want a change

commented

still have problem.
I use /gamemode spectator to walk thourhg blocks.
as I stand in a cave.
image
image

it show very less ores.

but if I walk into the blocks (which spectator mode works here)

image
image

it shows many ores.

I think rubidium has remove the block faces that far away from player. So it;s time to dive depper into Rubidium class.

commented

This is not a big problem. Just get close and you can see the ores.
on the other hand, I think it helps player to have a more clear recognize of ores nearby instead of seeing huge amount ores fill in the screen.

commented

https://github.com/gzzchh/xray-reforged/blob/main/src/main/java/fr/atesab/xray/mixins/MixinRubidiumBlockOcclusionCache.java

add this file

https://github.com/gzzchh/xray-reforged/blob/main/src/main/resources/atianxray.mixins.json

then update this json

image

recently i have no time to maintain this mod, but in the future I will check about the Popularity of 1.19.x and 1.20.x then choose one of them for upgrade.

commented

im not the most tech savy, could you point to me where i would insert that coding? i am using 1.19.4 so it might be a little different