Fixed Balloon render on player entities

This commit is contained in:
aidancbrady 2015-06-17 13:53:30 -04:00
parent b9f80c0365
commit c67bbde36a
2 changed files with 10 additions and 5 deletions

View file

@ -44,7 +44,7 @@ public class RenderBalloon extends Render
y -= RenderManager.renderPosY;
z -= RenderManager.renderPosZ;
y += balloon.latchedEntity.height + 1.7F;
y += balloon.getAddedHeight();
}
render(((EntityBalloon)entity).color, x, y, z);

View file

@ -1,16 +1,18 @@
package mekanism.common.entity;
import io.netty.buffer.ByteBuf;
import java.util.UUID;
import mekanism.api.Coord4D;
import mekanism.api.EnumColor;
import mekanism.api.Pos3D;
import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.particle.EntityReddustFX;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
@ -19,8 +21,6 @@ import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import io.netty.buffer.ByteBuf;
public class EntityBalloon extends Entity implements IEntityAdditionalSpawnData
{
public EnumColor color = EnumColor.DARK_BLUE;
@ -212,9 +212,14 @@ public class EntityBalloon extends Entity implements IEntityAdditionalSpawnData
latchedEntity.motionY = 0;
}
setPosition(latchedEntity.posX, latchedEntity.posY + latchedEntity.height + 1.7F, latchedEntity.posZ);
setPosition(latchedEntity.posX, latchedEntity.posY + getAddedHeight(), latchedEntity.posZ);
}
}
public double getAddedHeight()
{
return latchedEntity.height + (latchedEntity instanceof EntityPlayer ? 0F : 1.7F);
}
private int getFloor(EntityLivingBase entity)
{