MixinGuiIngame.java
1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
* This file is part of LiteLoader.
* Copyright (C) 2012-16 Adam Mummery-Smith
* All Rights Reserved.
*/
package com.mumfrey.liteloader.client.mixin;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.At.Shift;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import com.mumfrey.liteloader.client.LiteLoaderEventBrokerClient;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.GuiIngame;
import net.minecraft.client.gui.GuiNewChat;
@Mixin(GuiIngame.class)
public abstract class MixinGuiIngame extends Gui
{
@Shadow @Final private GuiNewChat persistantChatGUI;
private LiteLoaderEventBrokerClient broker = LiteLoaderEventBrokerClient.getInstance();
@Inject(method = "renderGameOverlay(F)V", at = @At(
value = "INVOKE",
target = "Lnet/minecraft/client/gui/GuiNewChat;drawChat(I)V"
))
private void onRenderChat(float partialTicks, CallbackInfo ci)
{
this.broker.onRenderChat(this.persistantChatGUI, partialTicks);
}
@Inject(method = "renderGameOverlay(F)V", at = @At(
value = "INVOKE",
shift = Shift.AFTER,
target = "Lnet/minecraft/client/gui/GuiNewChat;drawChat(I)V"
))
private void postRenderChat(float partialTicks, CallbackInfo ci)
{
this.broker.postRenderChat(this.persistantChatGUI, partialTicks);
}
}