當前位置: 首頁>>代碼示例>>Java>>正文


Java ForgeHooks.onLivingJump方法代碼示例

本文整理匯總了Java中net.minecraftforge.common.ForgeHooks.onLivingJump方法的典型用法代碼示例。如果您正苦於以下問題:Java ForgeHooks.onLivingJump方法的具體用法?Java ForgeHooks.onLivingJump怎麽用?Java ForgeHooks.onLivingJump使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraftforge.common.ForgeHooks的用法示例。


在下文中一共展示了ForgeHooks.onLivingJump方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: jump

import net.minecraftforge.common.ForgeHooks; //導入方法依賴的package包/類
@Override
protected void jump()
{
    this.motionY = 0.48D / WorldUtil.getGravityFactor(this);
    if (this.motionY < 0.28D) this.motionY = 0.28D;

    if (this.isPotionActive(Potion.jump))
    {
        this.motionY += (this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F;
    }

    if (this.isSprinting())
    {
        float f = this.rotationYaw * 0.017453292F;
        this.motionX -= MathHelper.sin(f) * 0.2F;
        this.motionZ += MathHelper.cos(f) * 0.2F;
    }

    this.isAirBorne = true;
    ForgeHooks.onLivingJump(this);
}
 
開發者ID:4Space,項目名稱:4Space-5,代碼行數:22,代碼來源:EntitySlimeling.java

示例2: jump

import net.minecraftforge.common.ForgeHooks; //導入方法依賴的package包/類
@Override
protected void jump()
{
    this.motionY = 0.52D / WorldUtil.getGravityFactor(this);
    if (this.motionY < 0.26D) this.motionY = 0.26D;

    if (this.isPotionActive(Potion.jump))
    {
        this.motionY += (this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F;
    }

    if (this.isSprinting())
    {
        float f = this.rotationYaw * 0.017453292F;
        this.motionX -= MathHelper.sin(f) * 0.2F;
        this.motionZ += MathHelper.cos(f) * 0.2F;
    }

    this.isAirBorne = true;
    ForgeHooks.onLivingJump(this);
}
 
開發者ID:4Space,項目名稱:4Space-5,代碼行數:22,代碼來源:EntityEvolvedSpider.java

示例3: jump

import net.minecraftforge.common.ForgeHooks; //導入方法依賴的package包/類
@Override
protected void jump()
{
    this.motionY = 0.45D / WorldUtil.getGravityFactor(this);
    if (this.motionY < 0.22D) this.motionY = 0.22D;

    if (this.isPotionActive(Potion.jump))
    {
        this.motionY += (this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F;
    }

    if (this.isSprinting())
    {
        float f = this.rotationYaw * 0.017453292F;
        this.motionX -= MathHelper.sin(f) * 0.2F;
        this.motionZ += MathHelper.cos(f) * 0.2F;
    }

    this.isAirBorne = true;
    ForgeHooks.onLivingJump(this);
}
 
開發者ID:4Space,項目名稱:4Space-5,代碼行數:22,代碼來源:EntityEvolvedCreeper.java

示例4: jump

import net.minecraftforge.common.ForgeHooks; //導入方法依賴的package包/類
@Override
protected void jump()
{
    this.motionY = 0.48D / WorldUtil.getGravityFactor(this);
    if (this.motionY < 0.24D) this.motionY = 0.24D;

    if (this.isPotionActive(Potion.jump))
    {
        this.motionY += (this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F;
    }

    if (this.isSprinting())
    {
        float f = this.rotationYaw * 0.017453292F;
        this.motionX -= MathHelper.sin(f) * 0.2F;
        this.motionZ += MathHelper.cos(f) * 0.2F;
    }

    this.isAirBorne = true;
    ForgeHooks.onLivingJump(this);
}
 
開發者ID:4Space,項目名稱:4Space-5,代碼行數:22,代碼來源:EntityEvolvedZombie.java

示例5: jump

import net.minecraftforge.common.ForgeHooks; //導入方法依賴的package包/類
@Override
protected void jump()
{
    this.motionY = 0.45D / WorldUtil.getGravityFactor(this);
    if (this.motionY < 0.24D) this.motionY = 0.24D;

    if (this.isPotionActive(Potion.jump))
    {
        this.motionY += (this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F;
    }

    if (this.isSprinting())
    {
        float f = this.rotationYaw * 0.017453292F;
        this.motionX -= MathHelper.sin(f) * 0.2F;
        this.motionZ += MathHelper.cos(f) * 0.2F;
    }

    this.isAirBorne = true;
    ForgeHooks.onLivingJump(this);
}
 
開發者ID:4Space,項目名稱:4Space-5,代碼行數:22,代碼來源:EntityEvolvedSkeleton.java

示例6: collideWithEntity

import net.minecraftforge.common.ForgeHooks; //導入方法依賴的package包/類
@Override
public void collideWithEntity(Entity entity) {
    super.collideWithEntity(entity);
    if (!(entity instanceof EntitySteelSheep)) {
        if (entity instanceof EntityLivingBase) {
            ((EntityLivingBase)entity).attackEntityFrom(steelSheep,0.5F);
            ((EntityLivingBase)entity).motionY = 0.41999998688697815D;

            if (((EntityLivingBase)entity).isPotionActive(Potion.jump))
            {
                ((EntityLivingBase)entity).motionY += (double)((float)(((EntityLivingBase)entity).getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F);
            }

            if (((EntityLivingBase)entity).isSprinting())
            {
                float f = ((EntityLivingBase)entity).rotationYaw * 0.017453292F;
                ((EntityLivingBase)entity).motionX -= (double)(MathHelper.sin(f) * 0.2F);
                ((EntityLivingBase)entity).motionZ += (double)(MathHelper.cos(f) * 0.2F);
            }

            ((EntityLivingBase)entity).isAirBorne = true;
            ForgeHooks.onLivingJump(((EntityLivingBase)entity));
        }
    }
}
 
開發者ID:Mitchellbrine,項目名稱:SteelSheep,代碼行數:26,代碼來源:EntitySteelSheep.java

示例7: jump

import net.minecraftforge.common.ForgeHooks; //導入方法依賴的package包/類
@Override
public void jump()
{
	float jumpHeight = isTitan ? 1.5F : 1.0F;
	this.motionY = 0.41999998688697815D * jumpHeight;

       if (this.isPotionActive(Potion.jump))
       {
           this.motionY += (double)((float)(this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F);
       }

       if (this.isSprinting())
       {
           float f = this.rotationYaw * 0.017453292F;
           this.motionX -= (double)(MathHelper.sin(f) * 0.2F);
           this.motionZ += (double)(MathHelper.cos(f) * 0.2F);
       }

       this.isAirBorne = true;
       ForgeHooks.onLivingJump(this);
}
 
開發者ID:TheAwesomeGem,項目名稱:MineFantasy,代碼行數:22,代碼來源:EntityMinotaur.java

示例8: jump

import net.minecraftforge.common.ForgeHooks; //導入方法依賴的package包/類
protected void jump()
{
    this.motionY = 0.41999998688697815D;

    if (this.isPotionActive(Potion.jump))
    {
        this.motionY += (double)((float)(this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F);
    }

    if (this.isSprinting())
    {
        float f = this.rotationYaw * 0.017453292F;
        this.motionX -= (double)(MathHelper.sin(f) * 0.2F);
        this.motionZ += (double)(MathHelper.cos(f) * 0.2F);
    }

    this.isAirBorne = true;
    ForgeHooks.onLivingJump(this);
}
 
開發者ID:xtrafrancyz,項目名稱:Cauldron,代碼行數:20,代碼來源:EntityLivingBase.java

示例9: jump

import net.minecraftforge.common.ForgeHooks; //導入方法依賴的package包/類
/**
 * Causes this entity to do an upwards motion (jumping).
 */
protected void jump()
{
    this.motionY = 0.41999998688697815D;

    if (this.isPotionActive(Potion.jump))
    {
        this.motionY += (double)((float)(this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F);
    }

    if (this.isSprinting())
    {
        float f = this.rotationYaw * 0.017453292F;
        this.motionX -= (double)(MathHelper.sin(f) * 0.2F);
        this.motionZ += (double)(MathHelper.cos(f) * 0.2F);
    }

    this.isAirBorne = true;
    ForgeHooks.onLivingJump(this);
}
 
開發者ID:HATB0T,項目名稱:RuneCraftery,代碼行數:23,代碼來源:EntityLivingBase.java

示例10: jump

import net.minecraftforge.common.ForgeHooks; //導入方法依賴的package包/類
protected void jump() {
	this.motionY = 0.4199999868869782D;
	if (isPotionActive(Potion.jump)) {
		this.motionY += (getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F;
	}
	if (isSprinting()) {
		float f = this.rotationYaw * 0.01745329F;
		this.motionX -= MathHelper.sin(f) * 0.2F;
		this.motionZ += MathHelper.cos(f) * 0.2F;
	}
	this.isAirBorne = true;
	ForgeHooks.onLivingJump(this);
}
 
開發者ID:4Space,項目名稱:4Space-5,代碼行數:14,代碼來源:EntityLivingBase.java

示例11: jump

import net.minecraftforge.common.ForgeHooks; //導入方法依賴的package包/類
/**
    * Causes this entity to do an upwards motion (jumping).
    */
   @Override
protected void jump() {
       this.motionY = 0.84F + this.getSlimeSize() * 0.1F;
       this.isAirBorne = true;
       ForgeHooks.onLivingJump(this);
   }
 
開發者ID:sblectric,項目名稱:LightningCraft,代碼行數:10,代碼來源:EntityUnderworldSlime.java


注:本文中的net.minecraftforge.common.ForgeHooks.onLivingJump方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。