当前位置: 首页>>代码示例>>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;未经允许,请勿转载。