Search in sources :

Example 1 with FluidRendererHookContainer

use of net.fabricmc.fabric.impl.client.render.fluid.FluidRendererHookContainer in project fabric by FabricMC.

the class MixinFluidRenderer method tesselate.

@Inject(at = @At("HEAD"), method = "tesselate", cancellable = true)
public void tesselate(ExtendedBlockView view, BlockPos pos, BufferBuilder bufferBuilder, FluidState state, CallbackInfoReturnable<Boolean> info) {
    FluidRendererHookContainer ctr = fabric_renderHandler.get();
    FluidRenderHandler handler = FluidRenderHandlerRegistryImpl.INSTANCE.getOverride(state.getFluid());
    if (handler == null) {
        return;
    }
    /* ActionResult hResult = handler.tesselate(view, pos, bufferBuilder, state);
        if (hResult != ActionResult.PASS) {
            info.setReturnValue(hResult == ActionResult.SUCCESS);
            return;
        } */
    ctr.view = view;
    ctr.pos = pos;
    ctr.state = state;
    ctr.handler = handler;
}
Also used : FluidRendererHookContainer(net.fabricmc.fabric.impl.client.render.fluid.FluidRendererHookContainer) FluidRenderHandler(net.fabricmc.fabric.api.client.render.fluid.v1.FluidRenderHandler) Inject(org.spongepowered.asm.mixin.injection.Inject)

Aggregations

FluidRenderHandler (net.fabricmc.fabric.api.client.render.fluid.v1.FluidRenderHandler)1 FluidRendererHookContainer (net.fabricmc.fabric.impl.client.render.fluid.FluidRendererHookContainer)1 Inject (org.spongepowered.asm.mixin.injection.Inject)1