本文整理汇总了Java中net.minecraft.entity.passive.EntityCow.setPosition方法的典型用法代码示例。如果您正苦于以下问题:Java EntityCow.setPosition方法的具体用法?Java EntityCow.setPosition怎么用?Java EntityCow.setPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.entity.passive.EntityCow
的用法示例。
在下文中一共展示了EntityCow.setPosition方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: apply
import net.minecraft.entity.passive.EntityCow; //导入方法依赖的package包/类
@Override
public void apply(World world, BlockPos pos, EntityLivingBase entity, int amplifier, int tick) {
if (entity instanceof EntityMooshroom) {
EntityCow cow = new EntityCow(world);
cow.setPosition(pos.getX(), pos.getY(), pos.getZ());
entity.setDead();
world.spawnEntity(cow);
}
}
示例2: doSpellCasterEffect
import net.minecraft.entity.passive.EntityCow; //导入方法依赖的package包/类
@Override
public void doSpellCasterEffect(EntityPlayer caster)
{
caster.worldObj.playSoundAtEntity(caster, "spellbound:surge", 1.0F, 1.0F);
final EntityCow cow = new EntityCow(caster.worldObj);
cow.setPosition(caster.posX, caster.posY, caster.posZ);
caster.worldObj.spawnEntityInWorld(cow);
}
示例3: onUpdate
import net.minecraft.entity.passive.EntityCow; //导入方法依赖的package包/类
@Override
public void onUpdate() {
super.onUpdate();
if (!world.isRemote) {
AxisAlignedBB bucketboundingBox = new AxisAlignedBB(calcTwoOffsetX(bedRampBackOffset, 90, -1) + posX - .5d, posY, calcTwoOffsetZ(bedRampBackOffset, 90, -1) + posZ - .5d, calcTwoOffsetX(bedRampBackOffset, 90, 1) + posX + .5d, posY + 1, calcTwoOffsetZ(bedRampBackOffset, 90, 1) + posZ + .5d);
List list = this.world.getEntitiesWithinAABBExcludingEntity(this, bucketboundingBox);
collidedEntitiesInList(list);
if (!this.inventory.getStackInSlot(0).isEmpty()) {
if (this.inventory.getStackInSlot(0).getItem() instanceof ItemSemiTrailerFlatBed) {
if (this.Attribute1 > 9) {
if (!this.inventory.getStackInSlot(1).isEmpty() && this.inventory.getStackInSlot(1).getItem() instanceof ItemTransportable) {
EntityMachineModRideable eMMR = ((ItemTransportable) this.inventory.getStackInSlot(1).getItem()).getEntityToSpawn(world);
eMMR.setPosition(calcTwoOffsetX(bedRampBackOffset + -3, 90, -1) + posX - .5d, posY, calcTwoOffsetZ(bedRampBackOffset + -3, 90, -1) + posZ - .5d);
eMMR.prevPosX = calcTwoOffsetX(bedRampBackOffset + -1, 90, -1) + posX - .5d;
eMMR.prevPosY = posY + 1.0d;
eMMR.prevPosZ = calcTwoOffsetZ(bedRampBackOffset + -1, 90, -1) + posZ - .5d;
eMMR.currentFuelLevel = carriedMachinesFuelStorage;
world.spawnEntity(eMMR);
carriedMachinesFuelStorage = 0;
this.inventory.extractItem(1, 1, false);
}
}
} else if (this.inventory.getStackInSlot(0).getItem() instanceof ItemSemiTrailerLivestock) {
if (this.Attribute1 > 9) {
for (int j = CarriedEntities.length - 1; j >= 0; j--) {
if (CarriedEntities[j] != null) {
// TODO set other attributes of the entity !!
// EntityCow temp = (EntityCow) CarriedEntities[j];
EntityCow temp = new EntityCow(world);
temp.setHealth(CarriedEntities[j].getHealth());
temp.setPosition(calcTwoOffsetX(bedRampBackOffset + -3, 90, -1) + posX - .5d, posY, calcTwoOffsetZ(bedRampBackOffset + -3, 90, -1) + posZ - .5d);
world.spawnEntity(temp);
CarriedEntities[j] = null;
return;
}
}
}
}
}
if (fluid != null && fluid.amount > 0) {
// LogHelper.info(fluid.amount);
}
}
}