本文整理匯總了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);
}
}
}