copy depth buffer from MC for HUD caching

This commit is contained in:
Pistonight authored and Jason Mitchell committed 2024-01-26 10:34:46 -08:00
1 parent 3ee82e7157
commit 65d9bf8f2f
4 files changed
+51 -54

No files matched your search

@@ -10,6 +10,8 @@ import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import org.joml.Matrix4f;
public class HandRenderer {
@@ -58,7 +60,11 @@ public class HandRenderer {
public boolean isHandTranslucent(InteractionHand hand) {
// TODO: Offhand
// Item item = Minecraft.getMinecraft().thePlayer.getItemBySlot(hand == InteractionHand.OFF_HAND ? EquipmentSlot.OFFHAND : EquipmentSlot.MAINHAND).getItem();
Item item = Minecraft.getMinecraft().thePlayer.getHeldItem().getItem();
ItemStack heldItem = Minecraft.getMinecraft().thePlayer.getHeldItem();
if (heldItem == null) {
return false;
}
Item item = heldItem.getItem();
if (item instanceof ItemBlock itemBlock) {
// TODO: RenderType