当前位置: 首页>>代码示例>>Java>>正文


Java Entity.getEntityId方法代码示例

本文整理汇总了Java中net.minecraft.entity.Entity.getEntityId方法的典型用法代码示例。如果您正苦于以下问题:Java Entity.getEntityId方法的具体用法?Java Entity.getEntityId怎么用?Java Entity.getEntityId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.entity.Entity的用法示例。


在下文中一共展示了Entity.getEntityId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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 limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
    super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
    this.villagerNose.offsetX = 0.0F;
    this.villagerNose.offsetY = 0.0F;
    this.villagerNose.offsetZ = 0.0F;
    float f = 0.01F * (float)(entityIn.getEntityId() % 10);
    this.villagerNose.rotateAngleX = MathHelper.sin((float)entityIn.ticksExisted * f) * 4.5F * 0.017453292F;
    this.villagerNose.rotateAngleY = 0.0F;
    this.villagerNose.rotateAngleZ = MathHelper.cos((float)entityIn.ticksExisted * f) * 2.5F * 0.017453292F;

    if (this.holdingItem)
    {
        this.villagerNose.rotateAngleX = -0.9F;
        this.villagerNose.offsetZ = -0.09375F;
        this.villagerNose.offsetY = 0.1875F;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:24,代码来源:ModelWitch.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);
    this.villagerNose.offsetX = this.villagerNose.offsetY = this.villagerNose.offsetZ = 0.0F;
    float f = 0.01F * (float)(entityIn.getEntityId() % 10);
    this.villagerNose.rotateAngleX = MathHelper.sin((float)entityIn.ticksExisted * f) * 4.5F * (float)Math.PI / 180.0F;
    this.villagerNose.rotateAngleY = 0.0F;
    this.villagerNose.rotateAngleZ = MathHelper.cos((float)entityIn.ticksExisted * f) * 2.5F * (float)Math.PI / 180.0F;

    if (this.field_82900_g)
    {
        this.villagerNose.rotateAngleX = -0.9F;
        this.villagerNose.offsetZ = -0.09375F;
        this.villagerNose.offsetY = 0.1875F;
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:22,代码来源:ModelWitch.java

示例3: CapabilityMessage

import net.minecraft.entity.Entity; //导入方法依赖的package包/类
public CapabilityMessage(Entity entity,boolean sendAll) {
	WeaponsCapability cap = entity.getCapability(TF2weapons.WEAPONS_CAP, null);
	this.entityID = entity.getEntityId();
	this.healTarget = cap.getHealTarget();
	//this.critTime = cap.critTime;
	//this.heads = cap.collectedHeads;
	if(sendAll) {
		this.entries=cap.dataManager.getAll();
	}
	else {
		this.entries=cap.dataManager.getDirty();
	}
	// new Exception().printStackTrace();
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:15,代码来源:TF2Message.java

示例4: S2CPacketSpawnGlobalEntity

import net.minecraft.entity.Entity; //导入方法依赖的package包/类
public S2CPacketSpawnGlobalEntity(Entity entityIn)
{
    this.entityId = entityIn.getEntityId();
    this.x = MathHelper.floor_double(entityIn.posX * 32.0D);
    this.y = MathHelper.floor_double(entityIn.posY * 32.0D);
    this.z = MathHelper.floor_double(entityIn.posZ * 32.0D);

    if (entityIn instanceof EntityLightningBolt)
    {
        this.type = 1;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:13,代码来源:S2CPacketSpawnGlobalEntity.java

示例5: SPacketEntityTeleport

import net.minecraft.entity.Entity; //导入方法依赖的package包/类
public SPacketEntityTeleport(Entity entityIn)
{
    this.entityId = entityIn.getEntityId();
    this.posX = entityIn.posX;
    this.posY = entityIn.posY;
    this.posZ = entityIn.posZ;
    this.yaw = (byte)((int)(entityIn.rotationYaw * 256.0F / 360.0F));
    this.pitch = (byte)((int)(entityIn.rotationPitch * 256.0F / 360.0F));
    this.onGround = entityIn.onGround;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:11,代码来源:SPacketEntityTeleport.java

示例6: S18PacketEntityTeleport

import net.minecraft.entity.Entity; //导入方法依赖的package包/类
public S18PacketEntityTeleport(Entity entityIn)
{
    this.entityId = entityIn.getEntityId();
    this.posX = MathHelper.floor_double(entityIn.posX * 32.0D);
    this.posY = MathHelper.floor_double(entityIn.posY * 32.0D);
    this.posZ = MathHelper.floor_double(entityIn.posZ * 32.0D);
    this.yaw = (byte)((int)(entityIn.rotationYaw * 256.0F / 360.0F));
    this.pitch = (byte)((int)(entityIn.rotationPitch * 256.0F / 360.0F));
    this.onGround = entityIn.onGround;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:11,代码来源:S18PacketEntityTeleport.java

示例7: spawnEntity

import net.minecraft.entity.Entity; //导入方法依赖的package包/类
private void spawnEntity(FMLMessage.EntitySpawnMessage spawnMsg)
{
    ModContainer mc = Loader.instance().getIndexedModList().get(spawnMsg.modId);
    EntityRegistration er = EntityRegistry.instance().lookupModSpawn(mc, spawnMsg.modEntityTypeId);
    if (er == null)
    {
        throw new RuntimeException( "Could not spawn mod entity ModID: " + spawnMsg.modId + " EntityID: " + spawnMsg.modEntityTypeId +
                " at ( " + spawnMsg.rawX + "," + spawnMsg.rawY + ", " + spawnMsg.rawZ + ") Please contact mod author or server admin.");
    }
    WorldClient wc = FMLClientHandler.instance().getWorldClient();
    Class<? extends Entity> cls = er.getEntityClass();
    try
    {
        Entity entity;
        if (er.hasCustomSpawning())
        {
            entity = er.doCustomSpawning(spawnMsg);
        } else
        {
            entity = cls.getConstructor(World.class).newInstance(wc);

            int offset = spawnMsg.entityId - entity.getEntityId();
            entity.setEntityId(spawnMsg.entityId);
            entity.setUniqueId(spawnMsg.entityUUID);
            entity.setLocationAndAngles(spawnMsg.rawX, spawnMsg.rawY, spawnMsg.rawZ, spawnMsg.scaledYaw, spawnMsg.scaledPitch);
            if (entity instanceof EntityLiving)
            {
                ((EntityLiving) entity).rotationYawHead = spawnMsg.scaledHeadYaw;
            }

            Entity parts[] = entity.getParts();
            if (parts != null)
            {
                for (int j = 0; j < parts.length; j++)
                {
                    parts[j].setEntityId(parts[j].getEntityId() + offset);
                }
            }
        }

        EntityTracker.updateServerPosition(entity, spawnMsg.rawX, spawnMsg.rawY, spawnMsg.rawZ);

        EntityPlayerSP clientPlayer = FMLClientHandler.instance().getClientPlayerEntity();
        if (entity instanceof IThrowableEntity)
        {
            Entity thrower = clientPlayer.getEntityId() == spawnMsg.throwerId ? clientPlayer : wc.getEntityByID(spawnMsg.throwerId);
            ((IThrowableEntity) entity).setThrower(thrower);
        }

        if (spawnMsg.dataWatcherList != null)
        {
            entity.getDataManager().setEntryValues(spawnMsg.dataWatcherList);
        }

        if (spawnMsg.throwerId > 0)
        {
            entity.setVelocity(spawnMsg.speedScaledX, spawnMsg.speedScaledY, spawnMsg.speedScaledZ);
        }

        if (entity instanceof IEntityAdditionalSpawnData)
        {
            ((IEntityAdditionalSpawnData) entity).readSpawnData(spawnMsg.dataStream);
        }
        wc.addEntityToWorld(spawnMsg.entityId, entity);
    } catch (Exception e)
    {
        FMLLog.log(Level.ERROR, e, "A severe problem occurred during the spawning of an entity at ( " + spawnMsg.rawX + "," + spawnMsg.rawY + ", " + spawnMsg.rawZ +")");
        throw Throwables.propagate(e);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:71,代码来源:EntitySpawnHandler.java

示例8: S0EPacketSpawnObject

import net.minecraft.entity.Entity; //导入方法依赖的package包/类
public S0EPacketSpawnObject(Entity entityIn, int typeIn, int p_i45166_3_)
{
    this.entityId = entityIn.getEntityId();
    this.x = MathHelper.floor_double(entityIn.posX * 32.0D);
    this.y = MathHelper.floor_double(entityIn.posY * 32.0D);
    this.z = MathHelper.floor_double(entityIn.posZ * 32.0D);
    this.pitch = MathHelper.floor_float(entityIn.rotationPitch * 256.0F / 360.0F);
    this.yaw = MathHelper.floor_float(entityIn.rotationYaw * 256.0F / 360.0F);
    this.type = typeIn;
    this.field_149020_k = p_i45166_3_;

    if (p_i45166_3_ > 0)
    {
        double d0 = entityIn.motionX;
        double d1 = entityIn.motionY;
        double d2 = entityIn.motionZ;
        double d3 = 3.9D;

        if (d0 < -d3)
        {
            d0 = -d3;
        }

        if (d1 < -d3)
        {
            d1 = -d3;
        }

        if (d2 < -d3)
        {
            d2 = -d3;
        }

        if (d0 > d3)
        {
            d0 = d3;
        }

        if (d1 > d3)
        {
            d1 = d3;
        }

        if (d2 > d3)
        {
            d2 = d3;
        }

        this.speedX = (int)(d0 * 8000.0D);
        this.speedY = (int)(d1 * 8000.0D);
        this.speedZ = (int)(d2 * 8000.0D);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:54,代码来源:S0EPacketSpawnObject.java

示例9: S12PacketEntityVelocity

import net.minecraft.entity.Entity; //导入方法依赖的package包/类
public S12PacketEntityVelocity(Entity entityIn)
{
    this(entityIn.getEntityId(), entityIn.motionX, entityIn.motionY, entityIn.motionZ);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:5,代码来源:S12PacketEntityVelocity.java

示例10: C02PacketUseEntity

import net.minecraft.entity.Entity; //导入方法依赖的package包/类
public C02PacketUseEntity(Entity entity, C02PacketUseEntity.Action action)
{
    this.entityId = entity.getEntityId();
    this.action = action;
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:6,代码来源:C02PacketUseEntity.java

示例11: SPacketEntityHeadLook

import net.minecraft.entity.Entity; //导入方法依赖的package包/类
public SPacketEntityHeadLook(Entity entityIn, byte yawIn)
{
    this.entityId = entityIn.getEntityId();
    this.yaw = yawIn;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:6,代码来源:SPacketEntityHeadLook.java

示例12: C0BPacketEntityAction

import net.minecraft.entity.Entity; //导入方法依赖的package包/类
public C0BPacketEntityAction(Entity entity, C0BPacketEntityAction.Action action, int auxData)
{
    this.entityID = entity.getEntityId();
    this.action = action;
    this.auxData = auxData;
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:7,代码来源:C0BPacketEntityAction.java

示例13: isFakeLocalPlayer

import net.minecraft.entity.Entity; //导入方法依赖的package包/类
public static boolean isFakeLocalPlayer(Entity entity) {
    return entity != null && entity.getEntityId() == -100;
}
 
开发者ID:fr1kin,项目名称:ForgeHax,代码行数:4,代码来源:EntityUtils.java

示例14: S19PacketEntityStatus

import net.minecraft.entity.Entity; //导入方法依赖的package包/类
public S19PacketEntityStatus(Entity entityIn, byte opCodeIn)
{
    this.entityId = entityIn.getEntityId();
    this.logicOpcode = opCodeIn;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:6,代码来源:S19PacketEntityStatus.java

示例15: S19PacketEntityHeadLook

import net.minecraft.entity.Entity; //导入方法依赖的package包/类
public S19PacketEntityHeadLook(Entity entityIn, byte p_i45214_2_)
{
    this.entityId = entityIn.getEntityId();
    this.yaw = p_i45214_2_;
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:6,代码来源:S19PacketEntityHeadLook.java


注:本文中的net.minecraft.entity.Entity.getEntityId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。