當前位置: 首頁>>代碼示例>>Java>>正文


Java EntityCow.setPosition方法代碼示例

本文整理匯總了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);
	}
}
 
開發者ID:Um-Mitternacht,項目名稱:Bewitchment,代碼行數:10,代碼來源:GrassGrowBrew.java

示例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);
}
 
開發者ID:WildBamaBoy,項目名稱:spellbound,代碼行數:11,代碼來源:SurgeCow.java

示例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);
		}
	}

}
 
開發者ID:TechStack,項目名稱:TechStack-s-HeavyMachineryMod,代碼行數:57,代碼來源:EntitySemiTractor.java


注:本文中的net.minecraft.entity.passive.EntityCow.setPosition方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。