當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。