-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chat rendering broke in two, overlay message is taking in everything …
…now isn't it huh
- Loading branch information
Showing
4 changed files
with
66 additions
and
11 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
src/main/java/dev/yurisuika/raised/client/gui/RaisedGui.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package dev.yurisuika.raised.client.gui; | ||
|
||
import net.minecraft.client.gui.DrawContext; | ||
|
||
public class RaisedGui { | ||
|
||
public static void start(DrawContext context, int x, int y, int z) { | ||
context.getMatrices().translate(x, -y, +z); | ||
} | ||
|
||
public static void end(DrawContext context, int x, int y, int z) { | ||
context.getMatrices().translate(x, +y, -z); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/main/java/dev/yurisuika/raised/mixin/client/gui/screen/ChatScreenMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package dev.yurisuika.raised.mixin.client.gui.screen; | ||
|
||
import net.minecraft.client.gui.DrawContext; | ||
import net.minecraft.client.gui.screen.ChatScreen; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
import static dev.yurisuika.raised.client.gui.RaisedGui.*; | ||
import static dev.yurisuika.raised.client.option.RaisedConfig.*; | ||
|
||
@Mixin(ChatScreen.class) | ||
public class ChatScreenMixin { | ||
|
||
// CHAT | ||
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/ChatHud;render(Lnet/minecraft/client/gui/DrawContext;IIIZ)V")) | ||
private void startChatTranslate(DrawContext context, int mouseX, int mouseY, float delta, CallbackInfo ci) { | ||
start(context, 0, getSync() ? getHud() : getChat(), 0); | ||
} | ||
|
||
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/ChatHud;render(Lnet/minecraft/client/gui/DrawContext;IIIZ)V", shift = At.Shift.AFTER)) | ||
private void endChatTranslate(DrawContext context, int mouseX, int mouseY, float delta, CallbackInfo ci) { | ||
end(context, 0, getSync() ? getHud() : getChat(), 0); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters