Fix path preview rendering in 1.15

This commit is contained in:
Jonas Herzig
2020-04-01 14:27:54 +02:00
parent b11b9db548
commit 4116a3a7c9
3 changed files with 48 additions and 9 deletions

View File

@@ -3,15 +3,31 @@ package com.replaymod.core.events;
import de.johni0702.minecraft.gui.utils.Event;
//#if MC>=11500
//$$ import net.minecraft.client.util.math.MatrixStack;
//#endif
public interface PostRenderWorldCallback {
Event<PostRenderWorldCallback> EVENT = Event.create((listeners) ->
//#if MC>=11500
//$$ (MatrixStack matrixStack) -> {
//#else
() -> {
//#endif
for (PostRenderWorldCallback listener : listeners) {
listener.postRenderWorld();
listener.postRenderWorld(
//#if MC>=11500
//$$ matrixStack
//#endif
);
}
}
);
void postRenderWorld();
void postRenderWorld(
//#if MC>=11500
//$$ MatrixStack matrixStack
//#endif
);
}
//#endif

View File

@@ -30,7 +30,11 @@ public class MixinGameRenderer {
//$$ MatrixStack matrixStack,
//#endif
CallbackInfo ci) {
PostRenderWorldCallback.EVENT.invoker().postRenderWorld();
PostRenderWorldCallback.EVENT.invoker().postRenderWorld(
//#if MC>=11500
//$$ matrixStack
//#endif
);
}
@Inject(method = "renderHand", at = @At("HEAD"), cancellable = true)