Search in sources :

Example 26 with ExtendedProperties

use of am2.playerextensions.ExtendedProperties in project ArsMagica2 by Mithion.

the class AMGuiHelper method shiftView.

public static void shiftView(float f) {
    EntityPlayer entity = Minecraft.getMinecraft().thePlayer;
    int viewSet = Minecraft.getMinecraft().gameSettings.thirdPersonView;
    if (viewSet == 0) {
        ExtendedProperties exProps = ExtendedProperties.For(entity);
        if (exProps.getShrinkPct() > 0f) {
            float amt = exProps.getPrevShrinkPct() + (exProps.getShrinkPct() - exProps.getPrevShrinkPct()) * f;
            GL11.glTranslatef(0, 1 * amt, 0);
        }
    }
    float flip = ExtendedProperties.For(entity).getFlipRotation();
    float prevFlip = ExtendedProperties.For(entity).getPrevFlipRotation();
    if (flip > 0) {
        float smoothedFlip = prevFlip + ((flip - prevFlip) * f);
        GL11.glTranslatef(0, (entity.height * (smoothedFlip / 180f)) - 0.1f, 0);
    }
}
Also used : EntityPlayer(net.minecraft.entity.player.EntityPlayer) ExtendedProperties(am2.playerextensions.ExtendedProperties)

Aggregations

ExtendedProperties (am2.playerextensions.ExtendedProperties)26 EntityPlayer (net.minecraft.entity.player.EntityPlayer)16 EntityLivingBase (net.minecraft.entity.EntityLivingBase)10 SubscribeEvent (cpw.mods.fml.common.eventhandler.SubscribeEvent)4 AMVector2 (am2.api.math.AMVector2)3 ItemStack (net.minecraft.item.ItemStack)3 IArmorImbuement (am2.api.items.armor.IArmorImbuement)1 BuffEffectSlowfall (am2.buffs.BuffEffectSlowfall)1 ItemSpellBook (am2.items.ItemSpellBook)1 AMDataWriter (am2.network.AMDataWriter)1 ParticleExpandingCollapsingRingAtPoint (am2.particles.ParticleExpandingCollapsingRingAtPoint)1 AffinityData (am2.playerextensions.AffinityData)1 RiftStorage (am2.playerextensions.RiftStorage)1 SkillData (am2.playerextensions.SkillData)1 Method (java.lang.reflect.Method)1 HashMap (java.util.HashMap)1 Minecraft (net.minecraft.client.Minecraft)1 EntityRenderer (net.minecraft.client.renderer.EntityRenderer)1 IAttributeInstance (net.minecraft.entity.ai.attributes.IAttributeInstance)1 EntityItemFrame (net.minecraft.entity.item.EntityItemFrame)1