Java 类net.minecraftforge.event.entity.player.PlayerFlyableFallEvent 实例源码

项目:Wizardry    文件:EventHandler.java   
@SubscribeEvent
public void onFlyFall(PlayerFlyableFallEvent event) {
    if (event.getEntityPlayer().getEntityWorld().provider.getDimension() == 0) {
        if (event.getEntityPlayer().fallDistance >= ConfigValues.underworldFallDistance) {
            BlockPos location = event.getEntityPlayer().getPosition();
            BlockPos bedrock = PosUtils.checkNeighborBlocksThoroughly(event.getEntity().getEntityWorld(), location, Blocks.BEDROCK);
            if (bedrock != null) {
                if (event.getEntity().getEntityWorld().getBlockState(bedrock).getBlock() == Blocks.BEDROCK) {
                    TeleportUtil.teleportToDimension(event.getEntityPlayer(), Wizardry.underWorld.getId(), 0, 300, 0);
                    ((EntityPlayer) event.getEntity()).addPotionEffect(new PotionEffect(ModPotions.NULLIFY_GRAVITY, 100, 0, true, false));
                    fallResetter.add(event.getEntity().getUniqueID());
                }
            }
        }
    }
}
项目:Cauldron    文件:EntityPlayer.java   
protected void fall(float p_70069_1_)
{
    if (!this.capabilities.allowFlying)
    {
        if (p_70069_1_ >= 2.0F)
        {
            this.addStat(StatList.distanceFallenStat, (int)Math.round((double)p_70069_1_ * 100.0D));
        }

        super.fall(p_70069_1_);
    }
    else
    {
        MinecraftForge.EVENT_BUS.post(new PlayerFlyableFallEvent(this, p_70069_1_));
    }
}
项目:Cauldron    文件:EntityPlayer.java   
protected void fall(float p_70069_1_)
{
    if (!this.capabilities.allowFlying)
    {
        if (p_70069_1_ >= 2.0F)
        {
            this.addStat(StatList.distanceFallenStat, (int)Math.round((double)p_70069_1_ * 100.0D));
        }

        super.fall(p_70069_1_);
    }
    else
    {
        MinecraftForge.EVENT_BUS.post(new PlayerFlyableFallEvent(this, p_70069_1_));
    }
}
项目:RuneCraftery    文件:EntityPlayer.java   
/**
 * Called when the mob is falling. Calculates and applies fall damage.
 */
protected void fall(float par1)
{
    if (!this.capabilities.allowFlying)
    {
        if (par1 >= 2.0F)
        {
            this.addStat(StatList.distanceFallenStat, (int)Math.round((double)par1 * 100.0D));
        }

        super.fall(par1);
    }
    else
    {
        MinecraftForge.EVENT_BUS.post(new PlayerFlyableFallEvent(this, par1));
    }
}
项目:BetterNutritionMod    文件:EntityPlayer.java   
/**
 * Called when the mob is falling. Calculates and applies fall damage.
 */
protected void fall(float par1)
{
    if (!this.capabilities.allowFlying)
    {
        if (par1 >= 2.0F)
        {
            this.addStat(StatList.distanceFallenStat, (int)Math.round((double)par1 * 100.0D));
        }

        super.fall(par1);
    }
    else
    {
        MinecraftForge.EVENT_BUS.post(new PlayerFlyableFallEvent(this, par1));
    }
}
项目:4Space-5    文件:EntityPlayer.java   
protected void fall(float p_70069_1_)
{
    if (!this.capabilities.allowFlying)
    {
        if (p_70069_1_ >= 2.0F) {
            addStat(StatList.distanceFallenStat, (int)Math.round(p_70069_1_ * 100.0D));
        }
        super.fall(p_70069_1_);
    }
    else
    {
        MinecraftForge.EVENT_BUS.post(new PlayerFlyableFallEvent(this, p_70069_1_));
    }
}
项目:4Space-1.7    文件:EntityPlayer.java   
protected void fall(float p_70069_1_)
{
    if (!this.capabilities.allowFlying)
    {
        if (p_70069_1_ >= 2.0F) {
            addStat(StatList.distanceFallenStat, (int)Math.round(p_70069_1_ * 100.0D));
        }
        super.fall(p_70069_1_);
    }
    else
    {
        MinecraftForge.EVENT_BUS.post(new PlayerFlyableFallEvent(this, p_70069_1_));
    }
}
项目:ZeldaSwordSkills    文件:ZSSEntityEvents.java   
@SubscribeEvent
public void onCreativeFall(PlayerFlyableFallEvent event) {
    ZSSPlayerSkills skills = ZSSPlayerSkills.get(event.entityPlayer);
    if (skills.isSkillActive(SkillBase.leapingBlow)) {
        ((LeapingBlow) skills.getPlayerSkill(SkillBase.leapingBlow)).onImpact(event.entityPlayer, event.distance);
    }
}
项目:CustomWorldGen    文件:ForgeEventFactory.java   
public static void onPlayerFall(EntityPlayer player, float distance, float multiplier)
{
    MinecraftForge.EVENT_BUS.post(new PlayerFlyableFallEvent(player, distance, multiplier));
}