Balloons are cool :)
This commit is contained in:
parent
54b4e75bc2
commit
2600f8fe81
4 changed files with 21 additions and 7 deletions
|
@ -44,7 +44,7 @@ public class RenderBalloon extends Render
|
||||||
y -= RenderManager.renderPosY;
|
y -= RenderManager.renderPosY;
|
||||||
z -= RenderManager.renderPosZ;
|
z -= RenderManager.renderPosZ;
|
||||||
|
|
||||||
y += 3;
|
y += (balloon.latchedEntity.height/2) + 2.2F;
|
||||||
}
|
}
|
||||||
|
|
||||||
render(((EntityBalloon)entity).color, x, y, z);
|
render(((EntityBalloon)entity).color, x, y, z);
|
||||||
|
|
|
@ -5,6 +5,7 @@ import mekanism.common.util.MekanismUtils;
|
||||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||||
import net.minecraft.client.renderer.entity.RenderLiving;
|
import net.minecraft.client.renderer.entity.RenderLiving;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
|
@ -68,7 +68,7 @@ public class EntityBalloon extends Entity implements IEntityAdditionalSpawnData
|
||||||
this(entity.worldObj);
|
this(entity.worldObj);
|
||||||
|
|
||||||
latchedEntity = entity;
|
latchedEntity = entity;
|
||||||
setPosition(latchedEntity.posX, latchedEntity.posY + 3F, latchedEntity.posZ);
|
setPosition(latchedEntity.posX, latchedEntity.posY + (latchedEntity.height/2) + 2.2F, latchedEntity.posZ);
|
||||||
|
|
||||||
prevPosX = posX;
|
prevPosX = posX;
|
||||||
prevPosY = posY;
|
prevPosY = posY;
|
||||||
|
@ -198,7 +198,20 @@ public class EntityBalloon extends Entity implements IEntityAdditionalSpawnData
|
||||||
else if(latchedEntity != null && latchedEntity.getHealth() > 0)
|
else if(latchedEntity != null && latchedEntity.getHealth() > 0)
|
||||||
{
|
{
|
||||||
int floor = getFloor(latchedEntity);
|
int floor = getFloor(latchedEntity);
|
||||||
setPosition(posX = latchedEntity.posX, posY = latchedEntity.posY + 3F, posZ = latchedEntity.posZ);
|
|
||||||
|
if(latchedEntity.posY-(floor+1) < -0.1)
|
||||||
|
{
|
||||||
|
latchedEntity.motionY = Math.max(0.04, latchedEntity.motionY*1.015);
|
||||||
|
}
|
||||||
|
else if(latchedEntity.posY-(floor+1) > 0.1)
|
||||||
|
{
|
||||||
|
latchedEntity.motionY = Math.min(-0.04, latchedEntity.motionY*1.015);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
latchedEntity.motionY = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
setPosition(latchedEntity.posX, latchedEntity.posY + (latchedEntity.height/2) + 2.2F, latchedEntity.posZ);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,9 +223,9 @@ public class EntityBalloon extends Entity implements IEntityAdditionalSpawnData
|
||||||
|
|
||||||
for(int i = yPos; i > 0; i--)
|
for(int i = yPos; i > 0; i--)
|
||||||
{
|
{
|
||||||
if(!worldObj.isAirBlock(xPos, i, zPos))
|
if(i < 256 && !worldObj.isAirBlock(xPos, i, zPos))
|
||||||
{
|
{
|
||||||
return i;
|
return i+1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ public class EntityRobit extends EntityCreature implements IInventory, ISustaine
|
||||||
{
|
{
|
||||||
super(world);
|
super(world);
|
||||||
|
|
||||||
setSize(0.5F, 0.5F);
|
setSize(0.3F, 0.3F);
|
||||||
|
|
||||||
getNavigator().setAvoidsWater(true);
|
getNavigator().setAvoidsWater(true);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue