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


Java Entity.isSneaking方法代碼示例

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


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

示例1: onLanded

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
/**
 * Called when an Entity lands on this Block. This method *must* update motionY because the entity will not do that
 * on its own
 */
public void onLanded(World worldIn, Entity entityIn)
{
    if (entityIn.isSneaking())
    {
        super.onLanded(worldIn, entityIn);
    }
    else if (entityIn.motionY < 0.0D)
    {
        entityIn.motionY = -entityIn.motionY;

        if (!(entityIn instanceof EntityLivingBase))
        {
            entityIn.motionY *= 0.8D;
        }
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:21,代碼來源:BlockSlime.java

示例2: setRotationAngles

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
/**
 * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
 * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
 * "far" arms and legs can swing at most.
 */
public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity entityIn)
{
    super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, entityIn);
    copyModelAngles(this.bipedLeftLeg, this.bipedLeftLegwear);
    copyModelAngles(this.bipedRightLeg, this.bipedRightLegwear);
    copyModelAngles(this.bipedLeftArm, this.bipedLeftArmwear);
    copyModelAngles(this.bipedRightArm, this.bipedRightArmwear);
    copyModelAngles(this.bipedBody, this.bipedBodyWear);

    if (entityIn.isSneaking())
    {
        this.bipedCape.rotationPointY = 2.0F;
    }
    else
    {
        this.bipedCape.rotationPointY = 0.0F;
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:24,代碼來源:ModelPlayer.java

示例3: onEntityCollidedWithBlock

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
@Override
public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity entity) {
	if (state.getValue(AXIS)!=EnumFacing.Axis.Y) return; //Only vertical axles are also firepoles
	if (entity instanceof EntityItem) return; //Items can't use firepoles
	
	if (entity.isSneaking()) {
		entity.motionY = 0.08; //Stop, but also counteract EntityLivingBase-applied microgravity
	} else if (entity.motionY<-0.40) {
		entity.motionY = -0.40;
	}
	entity.fallDistance = 0.0f;
}
 
開發者ID:elytra,項目名稱:Thermionics,代碼行數:13,代碼來源:BlockAxle.java

示例4: onEntityWalk

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
/**
 * Triggered whenever an entity collides with this block (enters into the block)
 */
public void onEntityWalk(World worldIn, BlockPos pos, Entity entityIn)
{
    if (Math.abs(entityIn.motionY) < 0.1D && !entityIn.isSneaking())
    {
        double d0 = 0.4D + Math.abs(entityIn.motionY) * 0.2D;
        entityIn.motionX *= d0;
        entityIn.motionZ *= d0;
    }

    super.onEntityWalk(worldIn, pos, entityIn);
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:15,代碼來源:BlockSlime.java

示例5: onFallenUpon

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
/**
 * Block's chance to react to a living entity falling on it.
 */
public void onFallenUpon(World worldIn, BlockPos pos, Entity entityIn, float fallDistance)
{
    if (entityIn.isSneaking())
    {
        super.onFallenUpon(worldIn, pos, entityIn, fallDistance);
    }
    else
    {
        entityIn.fall(fallDistance, 0.0F);
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:15,代碼來源:BlockSlime.java

示例6: onFallenUpon

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
@Override
public void onFallenUpon(World world, int x, int y, int z, Entity entity, float fallDistance) {
	if (!entity.isSneaking()) {
		entity.fallDistance = 0;
		if (entity.motionY < 0)
			entity.getEntityData().setDouble(Reference.MOD_ID + ":slime", -entity.motionY);
	}
}
 
開發者ID:jm-organization,項目名稱:connor41-etfuturum2,代碼行數:9,代碼來源:SlimeBlock.java

示例7: onEntityCollidedWithBlock

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
/**
 * Triggered whenever an entity collides with this block (enters into the block)
 */
public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, Entity entityIn)
{
    if (Math.abs(entityIn.motionY) < 0.1D && !entityIn.isSneaking())
    {
        double d0 = 0.4D + Math.abs(entityIn.motionY) * 0.2D;
        entityIn.motionX *= d0;
        entityIn.motionZ *= d0;
    }

    super.onEntityCollidedWithBlock(worldIn, pos, entityIn);
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:15,代碼來源:BlockSlime.java

示例8: onLanded

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
/**
 * Called when an Entity lands on this Block. This method *must* update motionY because the entity will not do that
 * on its own
 */
public void onLanded(World worldIn, Entity entityIn)
{
    if (entityIn.isSneaking())
    {
        super.onLanded(worldIn, entityIn);
    }
    else if (entityIn.motionY < 0.0D)
    {
        entityIn.motionY = -entityIn.motionY;
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:16,代碼來源:BlockSlime.java

示例9: render

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
/**
 * Sets the models various rotation angles then renders the model.
 */
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
    super.render(entityIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
    GlStateManager.pushMatrix();

    if (this.isChild)
    {
        float f = 2.0F;
        GlStateManager.scale(0.5F, 0.5F, 0.5F);
        GlStateManager.translate(0.0F, 24.0F * scale, 0.0F);
        this.bipedLeftLegwear.render(scale);
        this.bipedRightLegwear.render(scale);
        this.bipedLeftArmwear.render(scale);
        this.bipedRightArmwear.render(scale);
        this.bipedBodyWear.render(scale);
    }
    else
    {
        if (entityIn.isSneaking())
        {
            GlStateManager.translate(0.0F, 0.2F, 0.0F);
        }

        this.bipedLeftLegwear.render(scale);
        this.bipedRightLegwear.render(scale);
        this.bipedLeftArmwear.render(scale);
        this.bipedRightArmwear.render(scale);
        this.bipedBodyWear.render(scale);
    }

    GlStateManager.popMatrix();
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:36,代碼來源:ModelPlayer.java

示例10: onEntityCollidedWithBlock

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
@Override
public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity entity) {
	if (entity instanceof EntityItem) return;
	
	if (entity.isCollidedHorizontally) {
		entity.motionY = 0.35;
	} else if (entity.isSneaking()) {
		entity.motionY = 0.08; //Stop, but also counteract EntityLivingBase-applied microgravity
	} else if (entity.motionY<-0.20) {
		entity.motionY = -0.20;
	}
	entity.fallDistance = 0.0f;
}
 
開發者ID:elytra,項目名稱:Thermionics,代碼行數:14,代碼來源:BlockScaffold.java

示例11: onEntityCollidedWithBlock

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
@Override
public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity entity) {
	if (entity instanceof EntityItem) return;
	if (entity.isCollidedHorizontally) {
		entity.motionY = 0.35;
	} else if (entity.isSneaking()) {
		entity.motionY = 0.08; //Stop, but also counteract EntityLivingBase-applied microgravity
	} else if (entity.motionY<-0.20) {
		entity.motionY = -0.20;
	}
	entity.fallDistance = 0.0f;
}
 
開發者ID:elytra,項目名稱:Thermionics,代碼行數:13,代碼來源:BlockScaffoldCable.java

示例12: render

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
/**
 * Sets the models various rotation angles then renders the model.
 */
public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale)
{
    super.render(entityIn, p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale);
    GlStateManager.pushMatrix();

    if (this.isChild)
    {
        float f = 2.0F;
        GlStateManager.scale(1.0F / f, 1.0F / f, 1.0F / f);
        GlStateManager.translate(0.0F, 24.0F * scale, 0.0F);
        this.standRightSide.render(scale);
        this.standLeftSide.render(scale);
        this.standWaist.render(scale);
        this.standBase.render(scale);
    }
    else
    {
        if (entityIn.isSneaking())
        {
            GlStateManager.translate(0.0F, 0.2F, 0.0F);
        }

        this.standRightSide.render(scale);
        this.standLeftSide.render(scale);
        this.standWaist.render(scale);
        this.standBase.render(scale);
    }

    GlStateManager.popMatrix();
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:34,代碼來源:ModelArmorStand.java

示例13: render

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
/**
 * Sets the models various rotation angles then renders the model.
 */
public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale)
{
    super.render(entityIn, p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale);
    GlStateManager.pushMatrix();

    if (this.isChild)
    {
        float f = 2.0F;
        GlStateManager.scale(1.0F / f, 1.0F / f, 1.0F / f);
        GlStateManager.translate(0.0F, 24.0F * scale, 0.0F);
        this.bipedLeftLegwear.render(scale);
        this.bipedRightLegwear.render(scale);
        this.bipedLeftArmwear.render(scale);
        this.bipedRightArmwear.render(scale);
        this.bipedBodyWear.render(scale);
    }
    else
    {
        if (entityIn.isSneaking())
        {
            GlStateManager.translate(0.0F, 0.2F, 0.0F);
        }

        this.bipedLeftLegwear.render(scale);
        this.bipedRightLegwear.render(scale);
        this.bipedLeftArmwear.render(scale);
        this.bipedRightArmwear.render(scale);
        this.bipedBodyWear.render(scale);
    }

    GlStateManager.popMatrix();
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:36,代碼來源:ModelPlayer.java

示例14: render

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
@Override
    public void render(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
        this.isSneak = entity.isSneaking();
        this.isRiding = entity.isRiding();
//        if (entity instanceof EntityLivingBase) {
//            this.isChild = ((EntityLivingBase) entity).isChild();
//            this.rightArmPose = (((EntityLivingBase) entity).getHeldItem(EnumHand.MAIN_HAND) != null ? ArmPose.BOW_AND_ARROW : ArmPose.EMPTY);
//            // TODO possibly check if it can be completely removed? 1.9 thing
//        }

        this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entity);
        if (this.isChild) {
            float f6 = 2.0F;
            GlStateManager.pushMatrix();
            GlStateManager.scale(1.5F / f6, 1.5F / f6, 1.5F / f6);
            GlStateManager.translate(0.0F, 16.0F * scale, 0.0F);
            GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
            GlStateManager.enableBlend();
            this.bipedHead.render(scale);
            GlStateManager.disableBlend();
            GlStateManager.popMatrix();
            GlStateManager.pushMatrix();
            GlStateManager.scale(1.0F / f6, 1.0F / f6, 1.0F / f6);
            GlStateManager.translate(0.0F, 24.0F * scale, 0.0F);
            this.bipedBody.render(scale);
            this.bipedRightArm.render(scale);
            this.bipedLeftArm.render(scale);
            this.bipedRightLeg.render(scale);
            this.bipedLeftLeg.render(scale);
            GlStateManager.popMatrix();
        } else {
            GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
            GlStateManager.enableBlend();
            this.bipedHead.render(scale);
            GlStateManager.disableBlend();
            this.bipedBody.render(scale);
            this.bipedRightArm.render(scale);
            this.bipedLeftArm.render(scale);
            this.bipedRightLeg.render(scale);
            this.bipedLeftLeg.render(scale);
        }
    }
 
開發者ID:McJty,項目名稱:needtobreath,代碼行數:43,代碼來源:InformationGlassesModel.java

示例15: renderTag

import net.minecraft.entity.Entity; //導入方法依賴的package包/類
private void renderTag(Entity entity, double x, double y, double z) {
    String name = entity.getName();
    if(Wrapper.getFriends().isFriend(name)) {
    	name = "\2479" + name;
    }
    if (entity instanceof EntityLivingBase) {
    name = name + " \247a" + ((double)Math.round((((EntityLivingBase) entity).getHealth() * 100) / 100) / 2);
    }
    
    for(Friend friend: Wrapper.getFriends().friendsList) {
    	name.replace(friend.getName(), friend.getAlias());
    }
    float var13 = 1.6F;
    float var14 = (float) (0.016666668F * (Wrapper.getPlayer().getDistanceToEntity(entity)) / 2);
    GL11.glPushMatrix();
    GL11.glTranslatef((float) x, (float) y + entity.height + 0.5F, (float) z);
    GL11.glNormal3f(0.0F, 1.0F, 0.0F);
    GL11.glRotatef(-RenderManager.playerViewY, 0.0F, 1.0F, 0.0F);
    GL11.glRotatef(RenderManager.playerViewX, 1.0F, 0.0F, 0.0F);
    GL11.glScalef(-var14, -var14, var14);
    GL11.glDepthMask(false);
    GL11.glDisable(GL11.GL_LIGHTING);
    Tessellator var15 = Tessellator.getInstance();
    VertexBuffer vertexbuffer = var15.getBuffer();
    int var16 = (int) -Wrapper.getPlayer().getDistanceToEntity(entity) / (int) var13;
    if (entity.isSneaking()) {
        var16 += 4;
    } else if (var16 < -14) {
        var16 = -14;
    }

    GL11.glDisable(GL11.GL_TEXTURE_2D);
    int var17 = Fonts.roboto18.getStringWidth(name) / 2;
    RenderUtils.drawBorderedRect(-var17 - 2, var16, var17 + 2, 11 + var16, 0.5F, 0xFF000000, 0x80000000);

    Fonts.roboto18.drawStringWithShadow(name, -var17, var16, 0xFFFFFF);
    
    Wrapper.getMinecraft().entityRenderer.disableLightmap();
    GL11.glLineWidth(1.0F);
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glEnable(GL11.GL_DEPTH_TEST);
    GL11.glDepthMask(true);
    
    GL11.glPopMatrix();
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:49,代碼來源:Nametags.java


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