generated from Polyfrost/OneConfigExampleMod
-
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.
- Loading branch information
Showing
16 changed files
with
316 additions
and
167 deletions.
There are no files selected for viewing
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
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
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
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
18 changes: 9 additions & 9 deletions
18
src/main/java/org/polyfrost/polynametag/mixin/GuiInventoryMixin.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 |
---|---|---|
@@ -1,32 +1,32 @@ | ||
package org.polyfrost.polynametag.mixin; | ||
|
||
import cc.polyfrost.oneconfig.libs.universal.UMinecraft; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.gui.inventory.GuiInventory; | ||
import net.minecraft.client.renderer.OpenGlHelper; | ||
import net.minecraft.entity.EntityLivingBase; | ||
import org.polyfrost.polynametag.PolyNametag; | ||
import org.polyfrost.polynametag.config.ModConfig; | ||
import org.polyfrost.polynametag.NametagRenderer; | ||
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; | ||
|
||
@Mixin(GuiInventory.class) | ||
public class GuiInventoryMixin { | ||
|
||
@Inject(method = "drawEntityOnScreen", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/entity/RenderManager;renderEntityWithPosYaw(Lnet/minecraft/entity/Entity;DDDFF)Z")) | ||
private static void start(int posX, int posY, int scale, float mouseX, float mouseY, EntityLivingBase ent, CallbackInfo ci) { | ||
Minecraft.getMinecraft().getRenderManager().playerViewX = 0f; | ||
int i = 15728880; | ||
int j = i % 65536; | ||
int k = i / 65536; | ||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) j, (float) k); | ||
PolyNametag.INSTANCE.setDrawingInventory(true); | ||
int brightness = 15728880; | ||
int x = brightness % 65536; | ||
int y = brightness / 65536; | ||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) x, (float) y); | ||
NametagRenderer.setCurrentlyDrawingInventory(true); | ||
} | ||
|
||
@Inject(method = "drawEntityOnScreen", at = @At("TAIL")) | ||
private static void end(int posX, int posY, int scale, float mouseX, float mouseY, EntityLivingBase ent, CallbackInfo ci) { | ||
PolyNametag.INSTANCE.setDrawingInventory(false); | ||
NametagRenderer.setCurrentlyDrawingInventory(false); | ||
} | ||
|
||
} | ||
|
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
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
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
Oops, something went wrong.