本文整理匯總了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;
}
}
示例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;
}
}
示例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();
}
示例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;
}
}
示例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;
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例9: S12PacketEntityVelocity
import net.minecraft.entity.Entity; //導入方法依賴的package包/類
public S12PacketEntityVelocity(Entity entityIn)
{
this(entityIn.getEntityId(), entityIn.motionX, entityIn.motionY, entityIn.motionZ);
}
示例10: C02PacketUseEntity
import net.minecraft.entity.Entity; //導入方法依賴的package包/類
public C02PacketUseEntity(Entity entity, C02PacketUseEntity.Action action)
{
this.entityId = entity.getEntityId();
this.action = action;
}
示例11: SPacketEntityHeadLook
import net.minecraft.entity.Entity; //導入方法依賴的package包/類
public SPacketEntityHeadLook(Entity entityIn, byte yawIn)
{
this.entityId = entityIn.getEntityId();
this.yaw = yawIn;
}
示例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;
}
示例13: isFakeLocalPlayer
import net.minecraft.entity.Entity; //導入方法依賴的package包/類
public static boolean isFakeLocalPlayer(Entity entity) {
return entity != null && entity.getEntityId() == -100;
}
示例14: S19PacketEntityStatus
import net.minecraft.entity.Entity; //導入方法依賴的package包/類
public S19PacketEntityStatus(Entity entityIn, byte opCodeIn)
{
this.entityId = entityIn.getEntityId();
this.logicOpcode = opCodeIn;
}
示例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_;
}