Search in sources :

Example 1 with EventRender3D

use of dev.hypnotic.event.events.EventRender3D in project Hypnotic-Client by Hypnotic-Development.

the class GameRendererMixin method onRenderWorld.

@Inject(method = "renderWorld", at = @At(value = "INVOKE_STRING", target = "Lnet/minecraft/util/profiler/Profiler;swap(Ljava/lang/String;)V", args = { "ldc=hand" }), locals = LocalCapture.CAPTURE_FAILSOFT)
private void onRenderWorld(float tickDelta, long limitTime, MatrixStack matrices, CallbackInfo info) {
    MinecraftClient mc = MinecraftClient.getInstance();
    if (mc == null || mc.world == null || mc.player == null)
        return;
    mc.getProfiler().push("hypnotic-client_render");
    EventRender3D event = new EventRender3D(matrices, tickDelta, mc.getCameraEntity().getPos().x, mc.getCameraEntity().getPos().y, mc.getCameraEntity().getPos().z);
    event.call();
    RenderSystem.applyModelViewMatrix();
    mc.getProfiler().pop();
}
Also used : MinecraftClient(net.minecraft.client.MinecraftClient) EventRender3D(dev.hypnotic.event.events.EventRender3D) Inject(org.spongepowered.asm.mixin.injection.Inject)

Aggregations

EventRender3D (dev.hypnotic.event.events.EventRender3D)1 MinecraftClient (net.minecraft.client.MinecraftClient)1 Inject (org.spongepowered.asm.mixin.injection.Inject)1