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


Java EntityLivingBase.getEntityId方法代码示例

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


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

示例1: S42PacketCombatEvent

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
@SuppressWarnings("incomplete-switch")
public S42PacketCombatEvent(CombatTracker combatTrackerIn, S42PacketCombatEvent.Event combatEventType)
{
    this.eventType = combatEventType;
    EntityLivingBase entitylivingbase = combatTrackerIn.func_94550_c();

    switch (combatEventType)
    {
        case END_COMBAT:
            this.field_179772_d = combatTrackerIn.func_180134_f();
            this.field_179775_c = entitylivingbase == null ? -1 : entitylivingbase.getEntityId();
            break;

        case ENTITY_DIED:
            this.field_179774_b = combatTrackerIn.getFighter().getEntityId();
            this.field_179775_c = entitylivingbase == null ? -1 : entitylivingbase.getEntityId();
            this.deathMessage = combatTrackerIn.getDeathMessage().getUnformattedText();
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:20,代码来源:S42PacketCombatEvent.java

示例2: handleSpawnMob

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
/**
 * Spawns the mob entity at the specified location, with the specified rotation,
 * momentum and type. Updates the entities Datawatchers with the entity metadata
 * specified in the packet
 */
public void handleSpawnMob(S0FPacketSpawnMob packetIn) {
	PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
	double d0 = (double) packetIn.getX() / 32.0D;
	double d1 = (double) packetIn.getY() / 32.0D;
	double d2 = (double) packetIn.getZ() / 32.0D;
	float f = (float) (packetIn.getYaw() * 360) / 256.0F;
	float f1 = (float) (packetIn.getPitch() * 360) / 256.0F;
	EntityLivingBase entitylivingbase = (EntityLivingBase) EntityList.createEntityByID(packetIn.getEntityType(),
			this.gameController.theWorld);
	entitylivingbase.serverPosX = packetIn.getX();
	entitylivingbase.serverPosY = packetIn.getY();
	entitylivingbase.serverPosZ = packetIn.getZ();
	entitylivingbase.renderYawOffset = entitylivingbase.rotationYawHead = (float) (packetIn.getHeadPitch() * 360)
			/ 256.0F;
	Entity[] aentity = entitylivingbase.getParts();

	if (aentity != null) {
		int i = packetIn.getEntityID() - entitylivingbase.getEntityId();

		for (int j = 0; j < aentity.length; ++j) {
			aentity[j].setEntityId(aentity[j].getEntityId() + i);
		}
	}

	entitylivingbase.setEntityId(packetIn.getEntityID());
	entitylivingbase.setPositionAndRotation(d0, d1, d2, f, f1);
	entitylivingbase.motionX = (double) ((float) packetIn.getVelocityX() / 8000.0F);
	entitylivingbase.motionY = (double) ((float) packetIn.getVelocityY() / 8000.0F);
	entitylivingbase.motionZ = (double) ((float) packetIn.getVelocityZ() / 8000.0F);
	this.clientWorldController.addEntityToWorld(packetIn.getEntityID(), entitylivingbase);
	List<DataWatcher.WatchableObject> list = packetIn.func_149027_c();

	if (list != null) {
		entitylivingbase.getDataWatcher().updateWatchedObjectsFromList(list);
	}
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:42,代码来源:NetHandlerPlayClient.java

示例3: handleSpawnMob

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
/**
 * Spawns the mob entity at the specified location, with the specified rotation, momentum and type. Updates the
 * entities Datawatchers with the entity metadata specified in the packet
 */
public void handleSpawnMob(S0FPacketSpawnMob packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    double d0 = (double)packetIn.getX() / 32.0D;
    double d1 = (double)packetIn.getY() / 32.0D;
    double d2 = (double)packetIn.getZ() / 32.0D;
    float f = (float)(packetIn.getYaw() * 360) / 256.0F;
    float f1 = (float)(packetIn.getPitch() * 360) / 256.0F;
    EntityLivingBase entitylivingbase = (EntityLivingBase)EntityList.createEntityByID(packetIn.getEntityType(), this.gameController.theWorld);
    entitylivingbase.serverPosX = packetIn.getX();
    entitylivingbase.serverPosY = packetIn.getY();
    entitylivingbase.serverPosZ = packetIn.getZ();
    entitylivingbase.renderYawOffset = entitylivingbase.rotationYawHead = (float)(packetIn.getHeadPitch() * 360) / 256.0F;
    Entity[] aentity = entitylivingbase.getParts();

    if (aentity != null)
    {
        int i = packetIn.getEntityID() - entitylivingbase.getEntityId();

        for (int j = 0; j < aentity.length; ++j)
        {
            aentity[j].setEntityId(aentity[j].getEntityId() + i);
        }
    }

    entitylivingbase.setEntityId(packetIn.getEntityID());
    entitylivingbase.setPositionAndRotation(d0, d1, d2, f, f1);
    entitylivingbase.motionX = (double)((float)packetIn.getVelocityX() / 8000.0F);
    entitylivingbase.motionY = (double)((float)packetIn.getVelocityY() / 8000.0F);
    entitylivingbase.motionZ = (double)((float)packetIn.getVelocityZ() / 8000.0F);
    this.clientWorldController.addEntityToWorld(packetIn.getEntityID(), entitylivingbase);
    List<DataWatcher.WatchableObject> list = packetIn.func_149027_c();

    if (list != null)
    {
        entitylivingbase.getDataWatcher().updateWatchedObjectsFromList(list);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:43,代码来源:NetHandlerPlayClient.java

示例4: handleServerMessage

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
@Override
public IMessage handleServerMessage(EntityPlayer player, MessageSyncDrops message, MessageContext ctx) {
	if ((player != null) && (message != null) && (ctx != null)) {
		EntityLivingBase en = (EntityLivingBase) player.getEntityWorld().getEntityByID(message.entityId);
		if (en != null) {
			if (player.getEntityId() == en.getEntityId() && en.getEntityWorld() != null && en.hasCapability(Currency.ACCOUNT_DATA, null)) {
				AccountCapability entityData = en.getCapability(Currency.ACCOUNT_DATA, null);
				CurrencyUtils.dropMoneyAmount(message.amount, en.getEntityWorld(), en.posX, en.posY, en.posZ);
			}
		}
	}
	return null;
}
 
开发者ID:Zundrel,项目名称:Never-Enough-Currency,代码行数:14,代码来源:MessageSyncDrops.java

示例5: SPacketCombatEvent

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
@SuppressWarnings("incomplete-switch")
public SPacketCombatEvent(CombatTracker tracker, SPacketCombatEvent.Event eventIn, boolean p_i46932_3_)
{
    this.eventType = eventIn;
    EntityLivingBase entitylivingbase = tracker.getBestAttacker();

    switch (eventIn)
    {
        case END_COMBAT:
            this.duration = tracker.getCombatDuration();
            this.entityId = entitylivingbase == null ? -1 : entitylivingbase.getEntityId();
            break;

        case ENTITY_DIED:
            this.playerId = tracker.getFighter().getEntityId();
            this.entityId = entitylivingbase == null ? -1 : entitylivingbase.getEntityId();

            if (p_i46932_3_)
            {
                this.deathMessage = tracker.getDeathMessage();
            }
            else
            {
                this.deathMessage = new TextComponentString("");
            }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:28,代码来源:SPacketCombatEvent.java

示例6: SPacketSpawnMob

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
public SPacketSpawnMob(EntityLivingBase entityIn)
{
    this.entityId = entityIn.getEntityId();
    this.uniqueId = entityIn.getUniqueID();
    this.type = EntityList.field_191308_b.getIDForObject(entityIn.getClass());
    this.x = entityIn.posX;
    this.y = entityIn.posY;
    this.z = entityIn.posZ;
    this.yaw = (byte)((int)(entityIn.rotationYaw * 256.0F / 360.0F));
    this.pitch = (byte)((int)(entityIn.rotationPitch * 256.0F / 360.0F));
    this.headPitch = (byte)((int)(entityIn.rotationYawHead * 256.0F / 360.0F));
    double d0 = 3.9D;
    double d1 = entityIn.motionX;
    double d2 = entityIn.motionY;
    double d3 = entityIn.motionZ;

    if (d1 < -3.9D)
    {
        d1 = -3.9D;
    }

    if (d2 < -3.9D)
    {
        d2 = -3.9D;
    }

    if (d3 < -3.9D)
    {
        d3 = -3.9D;
    }

    if (d1 > 3.9D)
    {
        d1 = 3.9D;
    }

    if (d2 > 3.9D)
    {
        d2 = 3.9D;
    }

    if (d3 > 3.9D)
    {
        d3 = 3.9D;
    }

    this.velocityX = (int)(d1 * 8000.0D);
    this.velocityY = (int)(d2 * 8000.0D);
    this.velocityZ = (int)(d3 * 8000.0D);
    this.dataManager = entityIn.getDataManager();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:52,代码来源:SPacketSpawnMob.java

示例7: MessageRequestEntityAnimation

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
public MessageRequestEntityAnimation(EntityLivingBase entity) {
	this.entityID = entity.getEntityId();
	System.out.println("Creating animation request");
}
 
开发者ID:ObsidianSuite,项目名称:ObsidianSuite,代码行数:5,代码来源:MessageRequestEntityAnimation.java

示例8: S0FPacketSpawnMob

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
public S0FPacketSpawnMob(EntityLivingBase entityIn)
{
    this.entityId = entityIn.getEntityId();
    this.type = (byte)EntityList.getEntityID(entityIn);
    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.yaw = (byte)((int)(entityIn.rotationYaw * 256.0F / 360.0F));
    this.pitch = (byte)((int)(entityIn.rotationPitch * 256.0F / 360.0F));
    this.headPitch = (byte)((int)(entityIn.rotationYawHead * 256.0F / 360.0F));
    double d0 = 3.9D;
    double d1 = entityIn.motionX;
    double d2 = entityIn.motionY;
    double d3 = entityIn.motionZ;

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

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

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

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

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

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

    this.velocityX = (int)(d1 * 8000.0D);
    this.velocityY = (int)(d2 * 8000.0D);
    this.velocityZ = (int)(d3 * 8000.0D);
    this.field_149043_l = entityIn.getDataWatcher();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:51,代码来源:S0FPacketSpawnMob.java

示例9: doRenderLayer

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
public void doRenderLayer(EntityLivingBase entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale)
{
    int i = entitylivingbaseIn.getArrowCountInEntity();

    if (i > 0)
    {
        Entity entity = new EntityArrow(entitylivingbaseIn.worldObj, entitylivingbaseIn.posX, entitylivingbaseIn.posY, entitylivingbaseIn.posZ);
        Random random = new Random((long)entitylivingbaseIn.getEntityId());
        RenderHelper.disableStandardItemLighting();

        for (int j = 0; j < i; ++j)
        {
            GlStateManager.pushMatrix();
            ModelRenderer modelrenderer = this.field_177168_a.getMainModel().getRandomModelBox(random);
            ModelBox modelbox = (ModelBox)modelrenderer.cubeList.get(random.nextInt(modelrenderer.cubeList.size()));
            modelrenderer.postRender(0.0625F);
            float f = random.nextFloat();
            float f1 = random.nextFloat();
            float f2 = random.nextFloat();
            float f3 = (modelbox.posX1 + (modelbox.posX2 - modelbox.posX1) * f) / 16.0F;
            float f4 = (modelbox.posY1 + (modelbox.posY2 - modelbox.posY1) * f1) / 16.0F;
            float f5 = (modelbox.posZ1 + (modelbox.posZ2 - modelbox.posZ1) * f2) / 16.0F;
            GlStateManager.translate(f3, f4, f5);
            f = f * 2.0F - 1.0F;
            f1 = f1 * 2.0F - 1.0F;
            f2 = f2 * 2.0F - 1.0F;
            f = f * -1.0F;
            f1 = f1 * -1.0F;
            f2 = f2 * -1.0F;
            float f6 = MathHelper.sqrt_float(f * f + f2 * f2);
            entity.prevRotationYaw = entity.rotationYaw = (float)(Math.atan2((double)f, (double)f2) * 180.0D / Math.PI);
            entity.prevRotationPitch = entity.rotationPitch = (float)(Math.atan2((double)f1, (double)f6) * 180.0D / Math.PI);
            double d0 = 0.0D;
            double d1 = 0.0D;
            double d2 = 0.0D;
            this.field_177168_a.getRenderManager().renderEntityWithPosYaw(entity, d0, d1, d2, 0.0F, partialTicks);
            GlStateManager.popMatrix();
        }

        RenderHelper.enableStandardItemLighting();
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:43,代码来源:LayerArrow.java

示例10: MessageSyncRemove

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
public MessageSyncRemove(EntityLivingBase entity) {
	this.entityId = entity.getEntityId();
}
 
开发者ID:Zundrel,项目名称:Never-Enough-Currency,代码行数:4,代码来源:MessageSyncRemove.java

示例11: MessageSyncDrops

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
public MessageSyncDrops(EntityLivingBase entity, float amount) {
	this.entityId = entity.getEntityId();
	this.amount = amount;
}
 
开发者ID:Zundrel,项目名称:Never-Enough-Currency,代码行数:5,代码来源:MessageSyncDrops.java

示例12: MessageSyncCart

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
public MessageSyncCart(EntityLivingBase entity, NonNullList<ItemStack> cart) {
	this.entityId = entity.getEntityId();
	this.cart = cart;
	;
}
 
开发者ID:Zundrel,项目名称:Never-Enough-Currency,代码行数:6,代码来源:MessageSyncCart.java

示例13: MessageSyncServer

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
public MessageSyncServer(EntityLivingBase entity, float amount) {
	this.entityId = entity.getEntityId();
	this.amount = amount;
}
 
开发者ID:Zundrel,项目名称:Never-Enough-Currency,代码行数:5,代码来源:MessageSyncServer.java

示例14: MessageSyncPrices

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
public MessageSyncPrices(EntityLivingBase entity, List<Float> prices) {
	this.entityId = entity.getEntityId();
	this.prices = prices;
}
 
开发者ID:Zundrel,项目名称:Never-Enough-Currency,代码行数:5,代码来源:MessageSyncPrices.java

示例15: MessageSyncAdd

import net.minecraft.entity.EntityLivingBase; //导入方法依赖的package包/类
public MessageSyncAdd(EntityLivingBase entity, float amount) {
	this.entityId = entity.getEntityId();
	this.amount = amount;
}
 
开发者ID:Zundrel,项目名称:Never-Enough-Currency,代码行数:5,代码来源:MessageSyncAdd.java


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