当前位置: 首页>>代码示例>>Java>>正文


Java World.func_147480_a方法代码示例

本文整理汇总了Java中net.minecraft.world.World.func_147480_a方法的典型用法代码示例。如果您正苦于以下问题:Java World.func_147480_a方法的具体用法?Java World.func_147480_a怎么用?Java World.func_147480_a使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.world.World的用法示例。


在下文中一共展示了World.func_147480_a方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateTask

import net.minecraft.world.World; //导入方法依赖的package包/类
@Override
public void updateTask() {
	super.updateTask();
	getLookHelper().setLookPosition(destinationBlock.getX() + 0.5D, destinationBlock.getY() + 1, destinationBlock.getZ() + 0.5D, 10.0F, getVerticalFaceSpeed());

	if (getIsAboveDestination()) {
		World world = worldObj;
		BlockPos blockpos = destinationBlock.up();
		Block block = world.getBlock(blockpos.getX(), blockpos.getY(), blockpos.getZ());
		int meta = world.getBlockMetadata(blockpos.getX(), blockpos.getY(), blockpos.getZ());

		if (field_179499_e && block instanceof BlockCarrot && meta >= 7) {
			world.func_147480_a(blockpos.getX(), blockpos.getY(), blockpos.getZ(), false);
			carrotTicks = 100;
		}

		field_179499_e = false;
		runDelay = 10;
	}
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:21,代码来源:EntityRabbit.java

示例2: updateTick

import net.minecraft.world.World; //导入方法依赖的package包/类
@Override
public void updateTick(World world, int x, int y, int z, Random rand) {
	if (world.isRemote)
		return;
	int meta = world.getBlockMetadata(x, y, z);
	if (meta >= 5)
		return;

	if (!canBlockStay(world, x, y, z))
		world.func_147480_a(x, y, z, true);
	else if (world.isAirBlock(x, y + 1, z)) {
		boolean canGrowUp = false;
		boolean isSegmentOnEndstone = false;
		Block lowerBlock = world.getBlock(x, y - 1, z);
		if (lowerBlock == Blocks.end_stone)
			canGrowUp = true;
		else if (lowerBlock == ModBlocks.chorus_plant) {
			int par8 = 1;
			int height;
			for (height = 0; height < 4; height++) {
				Block b = world.getBlock(x, y - (par8 + 1), z);
				if (b != ModBlocks.chorus_plant) {
					if (b == Blocks.end_stone)
						isSegmentOnEndstone = true;
					break;
				}
				par8++;
			}

			height = 4;
			if (isSegmentOnEndstone)
				height++;

			if (par8 < 2 || rand.nextInt(height) >= par8)
				canGrowUp = true;
		} else if (lowerBlock.isAir(world, x, y - 1, z))
			canGrowUp = true;

		if (canGrowUp && isSpaceAroundFree(world, x, y + 1, z, ForgeDirection.DOWN) && world.isAirBlock(x, y + 2, z)) {
			world.setBlock(x, y, z, ModBlocks.chorus_plant);
			world.setBlock(x, y + 1, z, this, meta, 3);
		} else if (meta < 4) {
			int tries = rand.nextInt(4);
			boolean grew = false;
			if (isSegmentOnEndstone)
				tries++;
			for (int i = 0; i < tries; i++) {
				ForgeDirection dir = ForgeDirection.VALID_DIRECTIONS[rand.nextInt(ForgeDirection.VALID_DIRECTIONS.length)];
				int xx = x + dir.offsetX;
				int yy = y + dir.offsetY;
				int zz = z + dir.offsetZ;
				if (world.isAirBlock(xx, yy, zz) && isSpaceAroundFree(world, xx, yy, zz, dir.getOpposite())) {
					world.setBlock(xx, yy, zz, this, meta + 1, 3);
					grew = true;
				}
			}
			if (grew)
				world.setBlock(x, y, z, ModBlocks.chorus_plant, 0, 3);
			else
				world.setBlock(x, y, z, this, 5, 3);
		} else if (meta == 4)
			world.setBlock(x, y, z, this, 5, 3);
	}
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:65,代码来源:ChorusFlower.java

示例3: onNeighborBlockChange

import net.minecraft.world.World; //导入方法依赖的package包/类
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, Block neighbour) {
	if (!canBlockStay(world, x, y, z))
		world.func_147480_a(x, y, z, false);
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:6,代码来源:ChorusFlower.java

示例4: onNeighborBlockChange

import net.minecraft.world.World; //导入方法依赖的package包/类
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, Block neighbour) {
	if (neighbour == this)
		world.func_147480_a(x, y, z, true);
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:6,代码来源:ChorusPlant.java


注:本文中的net.minecraft.world.World.func_147480_a方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。