mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 11:09:42 +00:00
Fix Rendering Glitches
This commit is contained in:
1 parent
08728efcdd
commit
abc34b3f6f
7 files changed
+71
-42
No files matched your search
@@ -6,6 +6,8 @@ import kamkeel.npcs.controllers.data.ability.data.energy.EnergyDisplayData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.energy.EnergyLifespanData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.energy.EnergyLightningData;
|
||||
import kamkeel.npcs.controllers.data.ability.data.energy.EnergyTrajectoryData;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -103,6 +105,13 @@ public class EntityAbilityLaser extends EntityEnergyProjectile {
|
||||
this.endZ = z;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isInRangeToRenderDist(double distance) {
|
||||
double range = Math.max(128.0D, currentLength * 2.0D + 64.0D);
|
||||
return distance < range * range;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateRotation() {
|
||||
// Laser doesn't rotate
|
||||
@@ -179,7 +188,13 @@ public class EntityAbilityLaser extends EntityEnergyProjectile {
|
||||
*/
|
||||
private void updateLaserOriginAndDirection() {
|
||||
Entity owner = getOwnerEntity();
|
||||
if (owner == null || !(owner instanceof EntityLivingBase)) return;
|
||||
if (owner == null || !(owner instanceof EntityLivingBase)) {
|
||||
// On client, fall back to entity tracker interpolation when owner not loaded
|
||||
if (worldObj != null && worldObj.isRemote) {
|
||||
handleClientInterpolation();
|
||||
}
|
||||
return;
|
||||
}
|
||||
EntityLivingBase livingOwner = (EntityLivingBase) owner;
|
||||
|
||||
// Use owner look vector (head/eye aim) for direction updates so hit logic matches visuals.
|
||||
|
||||
Reference in new issue
Block a user