mirror of
https://github.com/GTNewHorizons/FindIt.git
synced 2026-11-18 23:59:05 +00:00
fix: use renderViewEntity for camera math (#36)
This commit is contained in:
1 parent
5c78cd6e54
commit
fd292e5649
2 files changed
+4
-4
No files matched your search
@@ -6,8 +6,8 @@ import java.util.List;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockChest;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.EntityPlayerSP;
|
||||
import net.minecraft.client.multiplayer.WorldClient;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityChest;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
@@ -44,7 +44,7 @@ public class BlockHighlighter {
|
||||
positions.clear();
|
||||
}
|
||||
|
||||
EntityPlayerSP p = mc.thePlayer;
|
||||
EntityLivingBase p = mc.renderViewEntity != null ? mc.renderViewEntity : mc.thePlayer;
|
||||
double doubleX = p.lastTickPosX + (p.posX - p.lastTickPosX) * event.partialTicks;
|
||||
double doubleY = p.lastTickPosY + (p.posY - p.lastTickPosY) * event.partialTicks;
|
||||
double doubleZ = p.lastTickPosZ + (p.posZ - p.lastTickPosZ) * event.partialTicks;
|
||||
|
||||
@@ -4,9 +4,9 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.EntityPlayerSP;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraftforge.client.event.RenderWorldLastEvent;
|
||||
@@ -40,7 +40,7 @@ public class EntityHighlighter {
|
||||
entityIds.clear();
|
||||
}
|
||||
|
||||
EntityPlayerSP p = mc.thePlayer;
|
||||
EntityLivingBase p = mc.renderViewEntity != null ? mc.renderViewEntity : mc.thePlayer;
|
||||
double doubleX = p.lastTickPosX + (p.posX - p.lastTickPosX) * event.partialTicks;
|
||||
double doubleY = p.lastTickPosY + (p.posY - p.lastTickPosY) * event.partialTicks;
|
||||
double doubleZ = p.lastTickPosZ + (p.posZ - p.lastTickPosZ) * event.partialTicks;
|
||||
|
||||
Reference in new issue
Block a user