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


Java Material.VINE屬性代碼示例

本文整理匯總了Java中net.minecraft.block.material.Material.VINE屬性的典型用法代碼示例。如果您正苦於以下問題:Java Material.VINE屬性的具體用法?Java Material.VINE怎麽用?Java Material.VINE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在net.minecraft.block.material.Material的用法示例。


在下文中一共展示了Material.VINE屬性的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getDestroySpeed

@Override
public float getDestroySpeed(ItemStack stack, IBlockState state) {
	Block block = state.getBlock();

	if (block == Blocks.WEB) {
		return 15.0F;
	} else {
		Material material = state.getMaterial();
		return material != Material.PLANTS && material != Material.VINE && material != Material.CORAL
				&& material != Material.LEAVES && material != Material.GOURD ? 1.0F : 1.5F;
	}
}
 
開發者ID:the-realest-stu,項目名稱:Adventurers-Toolbox,代碼行數:12,代碼來源:ItemATSword.java

示例2: BlockDoublePlant

public BlockDoublePlant()
{
    super(Material.VINE);
    this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT, BlockDoublePlant.EnumPlantType.SUNFLOWER).withProperty(HALF, BlockDoublePlant.EnumBlockHalf.LOWER).withProperty(FACING, EnumFacing.NORTH));
    this.setHardness(0.0F);
    this.setSoundType(SoundType.PLANT);
    this.setUnlocalizedName("doublePlant");
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:8,代碼來源:BlockDoublePlant.java

示例3: getStrVsBlock

public float getStrVsBlock(ItemStack stack, IBlockState state)
{
    Block block = state.getBlock();

    if (block == Blocks.WEB)
    {
        return 15.0F;
    }
    else
    {
        Material material = state.getMaterial();
        return material != Material.PLANTS && material != Material.VINE && material != Material.CORAL && material != Material.LEAVES && material != Material.GOURD ? 1.0F : 1.5F;
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:14,代碼來源:ItemSword.java

示例4: getStrVsBlock

public float getStrVsBlock(ItemStack stack, IBlockState state)
{
    Material material = state.getMaterial();
    return material != Material.WOOD && material != Material.PLANTS && material != Material.VINE ? super.getStrVsBlock(stack, state) : this.efficiencyOnProperMaterial;
}
 
開發者ID:Bedrockbreaker,項目名稱:rtap,代碼行數:5,代碼來源:toolJelloAxe.java

示例5: getStrVsBlock

@Override
public float getStrVsBlock(ItemStack stack, IBlockState state)
   {
       Material material = state.getMaterial();
       return material != Material.WOOD && material != Material.PLANTS && material != Material.VINE ? super.getStrVsBlock(stack, state) : this.getStats(stack).getEfficiency();
   }
 
開發者ID:V0idWa1k3r,項目名稱:ExPetrum,代碼行數:6,代碼來源:ItemAxe.java

示例6: generate

public boolean generate(World worldIn, Random rand, BlockPos position) {
	int i = 2 + rand.nextInt(1) + this.minTreeHeight;
	boolean flag = true;

	if (position.getY() >= 1 && position.getY() + i + 1 <= worldIn.getHeight()) {
		for (int j = position.getY(); j <= position.getY() + 1 + i; ++j) {
			int k = 1;

			if (j == position.getY()) {
				k = 0;
			}

			if (j >= position.getY() + 1 + i - 2) {
				k = 2;
			}

			BlockPos.MutableBlockPos blockposmutableblockpos = new BlockPos.MutableBlockPos();

			for (int l = position.getX() - k; l <= position.getX() + k && flag; ++l) {
				for (int i1 = position.getZ() - k; i1 <= position.getZ() + k && flag; ++i1) {
					if (j >= 0 && j < worldIn.getHeight()) {
						if (!this.isReplaceable(worldIn, blockposmutableblockpos.setPos(l, j, i1))) {
							flag = false;
						}
					} else {
						flag = false;
					}
				}
			}
		}

		if (!flag) {
			return false;
		} else {
			IBlockState state = worldIn.getBlockState(position.down());

			if (state.getBlock().canSustainPlant(state, worldIn, position.down(), net.minecraft.util.EnumFacing.UP, (net.minecraft.block.BlockSapling) net.minecraft.init.Blocks.SAPLING) && position.getY() < worldIn.getHeight() - i - 1) {
				this.setDirtAt(worldIn, position.down());

				for (int i3 = position.getY() - 3 + i; i3 <= position.getY() + i; ++i3) {
					int i4 = i3 - (position.getY() + i);
					int j1 = 1 - i4 / 2;

					for (int k1 = position.getX() - j1; k1 <= position.getX() + j1; ++k1) {
						int l1 = k1 - position.getX();

						for (int i2 = position.getZ() - j1; i2 <= position.getZ() + j1; ++i2) {
							int j2 = i2 - position.getZ();

							if (Math.abs(l1) != j1 || Math.abs(j2) != j1 || rand.nextInt(2) != 0 && i4 != 0) {
								BlockPos blockpos = new BlockPos(k1, i3, i2);
								state = worldIn.getBlockState(blockpos);

								if (state.getBlock().isAir(state, worldIn, blockpos) || state.getBlock().isLeaves(state, worldIn, blockpos) || state.getMaterial() == Material.VINE) {
									this.setBlockAndNotifyAdequately(worldIn, blockpos, this.metaLeaves);
								}
							}
						}
					}
				}

				for (int j3 = 0; j3 < i; ++j3) {
					BlockPos upN = position.up(j3);
					state = worldIn.getBlockState(upN);

					if (state.getBlock().isAir(state, worldIn, upN) || state.getBlock().isLeaves(state, worldIn, upN) || state.getMaterial() == Material.VINE) {
						this.setBlockAndNotifyAdequately(worldIn, position.up(j3), this.metaWood);
					}
				}

				return true;
			} else {
				return false;
			}
		}
	} else {
		return false;
	}
}
 
開發者ID:MinecraftModDevelopmentMods,項目名稱:Got-Wood,代碼行數:79,代碼來源:WorldGenRubber.java

示例7: generate

public boolean generate(World worldIn, Random rand, BlockPos position) {
	int i = 2 + rand.nextInt(1) + this.minTreeHeight;
	boolean flag = true;

	if (position.getY() >= 1 && position.getY() + i + 1 <= worldIn.getHeight()) {
		for (int j = position.getY(); j <= position.getY() + 1 + i; ++j) {
			int k = 1;

			if (j == position.getY()) {
				k = 0;
			}

			if (j >= position.getY() + 1 + i - 2) {
				k = 2;
			}

			BlockPos.MutableBlockPos blockposmutableblockpos = new BlockPos.MutableBlockPos();

			for (int l = position.getX() - k; l <= position.getX() + k && flag; ++l) {
				for (int i1 = position.getZ() - k; i1 <= position.getZ() + k && flag; ++i1) {
					if (j >= 0 && j < worldIn.getHeight()) {
						if (!this.isReplaceable(worldIn, blockposmutableblockpos.setPos(l, j, i1))) {
							flag = false;
						}
					} else {
						flag = false;
					}
				}
			}
		}

		if (!flag) {
			return false;
		} else {
			IBlockState state = worldIn.getBlockState(position.down());

			if (state.getBlock().canSustainPlant(state, worldIn, position.down(), net.minecraft.util.EnumFacing.UP, (net.minecraft.block.BlockSapling) net.minecraft.init.Blocks.SAPLING) && position.getY() < worldIn.getHeight() - i - 1) {
				this.setDirtAt(worldIn, position.down());

				for (int i3 = position.getY() - 3 + i; i3 <= position.getY() + i; ++i3) {
					int i4 = i3 - (position.getY() + i);
					int j1 = 1 - i4 / 2;

					for (int k1 = position.getX() - j1; k1 <= position.getX() + j1; ++k1) {
						int l1 = k1 - position.getX();

						for (int i2 = position.getZ() - j1; i2 <= position.getZ() + j1; ++i2) {
							int j2 = i2 - position.getZ();

							if (Math.abs(l1) != j1 || Math.abs(j2) != j1 || rand.nextInt(2) != 0 && i4 != 0) {
								BlockPos blockpos = new BlockPos(k1, i3, i2);
								state = worldIn.getBlockState(blockpos);

								if (state.getBlock().isAir(state, worldIn, blockpos) || state.getBlock().isLeaves(state, worldIn, blockpos) || state.getMaterial() == Material.VINE) {
									this.setBlockAndNotifyAdequately(worldIn, blockpos, this.metaLeaves.withProperty(BlockFruitingLeaves.FRUITING, rand.nextInt(ConfigurationHandler.appleFruitingGenChance) == 0?rand.nextInt(1)+1:0));
								}
							}
						}
					}
				}

				for (int j3 = 0; j3 < i; ++j3) {
					BlockPos upN = position.up(j3);
					state = worldIn.getBlockState(upN);

					if (state.getBlock().isAir(state, worldIn, upN) || state.getBlock().isLeaves(state, worldIn, upN) || state.getMaterial() == Material.VINE) {
						this.setBlockAndNotifyAdequately(worldIn, position.up(j3), this.metaWood);
					}
				}

				return true;
			} else {
				return false;
			}
		}
	} else {
		return false;
	}
}
 
開發者ID:MinecraftModDevelopmentMods,項目名稱:Got-Wood,代碼行數:79,代碼來源:WorldGenApple.java

示例8: generateNormal

private boolean generateNormal(World worldIn, Random rand, BlockPos position) {
	int i = rand.nextInt(3) + 5;
	boolean flag = true;

	if (position.getY() >= 1 && position.getY() + i + 1 <= worldIn.getHeight()) {

		flag = isAreaClear(worldIn, position, i);

		if (!flag) {
			return false;
		} else {
			IBlockState state = worldIn.getBlockState(position.down());

			if (state.getBlock().canSustainPlant(state, worldIn, position.down(), net.minecraft.util.EnumFacing.UP, (net.minecraft.block.BlockSapling) net.minecraft.init.Blocks.SAPLING) && position.getY() < worldIn.getHeight() - i - 1) {
				this.setDirtAt(worldIn, position.down());

				for (int i3 = position.getY() - 3 + i; i3 <= position.getY() + i; ++i3) {
					int i4 = i3 - (position.getY() + i);
					int j1 = 1 - i4 / 2;

					for (int k1 = position.getX() - j1; k1 <= position.getX() + j1; ++k1) {
						int l1 = k1 - position.getX();

						for (int i2 = position.getZ() - j1; i2 <= position.getZ() + j1; ++i2) {
							int j2 = i2 - position.getZ();

							if (Math.abs(l1) != j1 || Math.abs(j2) != j1 || rand.nextInt(2) != 0 && i4 != 0) {
								BlockPos blockpos = new BlockPos(k1, i3, i2);
								state = worldIn.getBlockState(blockpos);

								if (state.getBlock().isAir(state, worldIn, blockpos) || state.getBlock().isLeaves(state, worldIn, blockpos) || state.getMaterial() == Material.VINE) {
									this.setBlockAndNotifyAdequately(worldIn, blockpos, this.metaLeaves);
								}
							}
						}
					}
				}

				for (int j3 = 0; j3 < i; ++j3) {
					BlockPos upN = position.up(j3);
					state = worldIn.getBlockState(upN);

					if (state.getBlock().isAir(state, worldIn, upN) || state.getBlock().isLeaves(state, worldIn, upN) || state.getMaterial() == Material.VINE) {
						this.setBlockAndNotifyAdequately(worldIn, position.up(j3), this.metaWood);
					}
				}

				return true;
			} else {
				return false;
			}
		}
	} else {
		return false;
	}
}
 
開發者ID:MinecraftModDevelopmentMods,項目名稱:Got-Wood,代碼行數:56,代碼來源:WorldGenMaple.java

示例9: generateBig

private boolean generateBig(World worldIn, Random rand, BlockPos position) {
	int i = rand.nextInt(2) + 9;
	boolean flag = true;

	if (position.getY() >= 1 && position.getY() + i + 1 <= worldIn.getHeight()) {
		flag = isAreaClear(worldIn, position, i);

		if (!flag) {
			return false;
		}

		//If we can actually make the tree
		else {
			IBlockState state = worldIn.getBlockState(position.down());

			if (state.getBlock().canSustainPlant(state, worldIn, position.down(), net.minecraft.util.EnumFacing.UP, (net.minecraft.block.BlockSapling) net.minecraft.init.Blocks.SAPLING) && position.getY() < worldIn.getHeight() - i - 1) {
				this.setDirtAt(worldIn, position.down());

				//MAKE LEAVES
				final int[][] leafPos = new int[][] { { -1, 0, 0 }, { 0, 0, 1 }, { 0, 0, -1 }, { 1, 0, 0 }, { -1, 1, 1 }, { -1, 1, 0 }, { -1, 1, -1 }, { 0, 1, 1 }, { 0, 1, -1 }, { 1, 1, 1 }, { 1, 1, 0 }, { 1, 1, -1 }, { 2, 1, 1 }, { -2, 1, 1 }, { -2, 1, 0 }, { -2, 1, -1 }, { -1, 1, 2 }, { -1, 1, -2 }, { 0, 1, 2 }, { 0, 1, -2 }, { 2, 1, 0 }, { 2, 1, -1 }, { 1, 1, 2 }, { 1, 1, -2 }, { -3, 1, 0 }, { 3, 1, 0 }, { 0, 1, -3 }, { 0, 1, 3 }, { -2, 1, 2 }, { -2, 1, -2 }, { 2, 1, 2 }, { 2, 1, -2 }, { -1, 2, 1 }, { -1, 2, 0 }, { -1, 2, -1 }, { 0, 2, 1 }, { 0, 2, -1 }, { 1, 2, 1 }, { 1, 2, 0 }, { 1, 2, -1 }, { 2, 2, 1 }, { -2, 2, 1 }, { -2, 2, 0 }, { -2, 2, -1 }, { -1, 2, 2 }, { -1, 2, -2 }, { 0, 2, 2 }, { 0, 2, -2 }, { 2, 2, 0 }, { 2, 2, -1 }, { 1, 2, 2 }, { 1, 2, -2 }, { -3, 2, 0 }, { 3, 2, 0 },
					{ 0, 2, -3 }, { 0, 2, 3 }, { -2, 2, 2 }, { -2, 2, -2 }, { 2, 2, 2 }, { 2, 2, -2 }, { -3, 2, -1 }, { -3, 2, 1 }, { -1, 2, -3 }, { -1, 2, 3 }, { 1, 2, 3 }, { 3, 2, 1 }, { 1, 2, -3 }, { 3, 2, -1 }, { -1, 3, 1 }, { -1, 3, 0 }, { -1, 3, -1 }, { 0, 3, 1 }, { 0, 3, -1 }, { 1, 3, 1 }, { 1, 3, 0 }, { 1, 3, -1 }, { 2, 3, 1 }, { -2, 3, 1 }, { -2, 3, 0 }, { -2, 3, -1 }, { -1, 3, 2 }, { -1, 3, -2 }, { 0, 3, 2 }, { 0, 3, -2 }, { 2, 3, 0 }, { 2, 3, -1 }, { 1, 3, 2 }, { 1, 3, -2 }, { -3, 3, 0 }, { 3, 3, 0 }, { 0, 3, -3 }, { 0, 3, 3 }, { -2, 3, 2 }, { -2, 3, -2 }, { 2, 3, 2 }, { 2, 3, -2 }, { -3, 3, -1 }, { -3, 3, 1 }, { -1, 3, -3 }, { -1, 3, 3 }, { 1, 3, 3 }, { 3, 3, 1 }, { 1, 3, -3 }, { 3, 3, -1 }, { -1, 4, 1 }, { -1, 4, 0 }, { -1, 4, -1 }, { 0, 4, 1 }, { 0, 4, -1 }, { 1, 4, 1 },
					{ 1, 4, 0 }, { 1, 4, -1 }, { 2, 4, 1 }, { -2, 4, 1 }, { -2, 4, 0 }, { -2, 4, -1 }, { -1, 4, 2 }, { -1, 4, -2 }, { 0, 4, 2 }, { 0, 4, -2 }, { 2, 4, 0 }, { 2, 4, -1 }, { 1, 4, 2 }, { 1, 4, -2 }, { -3, 4, 0 }, { 3, 4, 0 }, { 0, 4, -3 }, { 0, 4, 3 }, { -1, 5, 1 }, { -1, 5, 0 }, { -1, 5, -1 }, { 0, 5, 1 }, { 0, 5, -1 }, { 1, 5, 1 }, { 1, 5, 0 }, { 1, 5, -1 }, { 2, 5, 1 }, { -2, 5, 1 }, { -2, 5, 0 }, { -2, 5, -1 }, { -1, 5, 2 }, { -1, 5, -2 }, { 0, 5, 2 }, { 0, 5, -2 }, { 2, 5, 0 }, { 2, 5, -1 }, { 1, 5, 2 }, { 1, 5, -2 }, { -1, 6, 0 }, { 0, 6, 1 }, { 0, 6, -1 }, { 1, 6, 0 }, { 0, 7, 0 } };

				for (int[] coord : leafPos) {
					BlockPos blockpos = position.add(coord[0], coord[1] + (i - 7), coord[2]);
					state = worldIn.getBlockState(blockpos);
					if (state.getBlock().isAir(state, worldIn, blockpos) || state.getBlock().isLeaves(state, worldIn, blockpos) || state.getMaterial() == Material.VINE) {
						this.setBlockAndNotifyAdequately(worldIn, blockpos, this.metaLeaves);
					}
				}

				//MAKE TRUNK
				for (int j3 = 0; j3 < i; ++j3) {
					BlockPos upN = position.up(j3);
					state = worldIn.getBlockState(upN);

					if (state.getBlock().isAir(state, worldIn, upN) || state.getBlock().isLeaves(state, worldIn, upN) || state.getMaterial() == Material.VINE) {
						this.setBlockAndNotifyAdequately(worldIn, position.up(j3), this.metaWood);
						if (j3 == i - 4) {

							this.setBlockAndNotifyAdequately(worldIn, position.up(j3).north(), this.metaWood.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.Z));
							this.setBlockAndNotifyAdequately(worldIn, position.up(j3).south(), this.metaWood.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.Z));
							this.setBlockAndNotifyAdequately(worldIn, position.up(j3).north(2), this.metaWood.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.Z));
							this.setBlockAndNotifyAdequately(worldIn, position.up(j3).south(2), this.metaWood.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.Z));
							if (rand.nextBoolean()) {
								this.setBlockAndNotifyAdequately(worldIn, position.up(j3).east(), this.metaWood.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.X));
								this.setBlockAndNotifyAdequately(worldIn, position.up(j3).west(), this.metaWood.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.X));
								this.setBlockAndNotifyAdequately(worldIn, position.up(j3).east(2), this.metaWood.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.X));
								this.setBlockAndNotifyAdequately(worldIn, position.up(j3).west(2), this.metaWood.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.X));
							}

						} else if (j3 == i - 6) {
							this.setBlockAndNotifyAdequately(worldIn, position.up(j3).north(), this.metaWood.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.Z));
							this.setBlockAndNotifyAdequately(worldIn, position.up(j3).south(), this.metaWood.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.Z));
							if (rand.nextBoolean()) {
								this.setBlockAndNotifyAdequately(worldIn, position.up(j3).east(), this.metaWood.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.X));
								this.setBlockAndNotifyAdequately(worldIn, position.up(j3).west(), this.metaWood.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.X));
							}
						}
					}
				}

				return true;
			} else {
				return false;
			}
		}
	} else {
		return false;
	}
}
 
開發者ID:MinecraftModDevelopmentMods,項目名稱:Got-Wood,代碼行數:71,代碼來源:WorldGenMaple.java

示例10: generateMini

private boolean generateMini(World worldIn, Random rand, BlockPos position) {
	int i = rand.nextInt(2) + 6;
	boolean flag = true;

	if (position.getY() >= 1 && position.getY() + i + 1 <= worldIn.getHeight()) {
		flag = isAreaClear(worldIn, position, i);

		if (!flag) {
			return false;
		}

		//If we can actually make the tree
		else {
			IBlockState state = worldIn.getBlockState(position.down());

			if (state.getBlock().canSustainPlant(state, worldIn, position.down(), net.minecraft.util.EnumFacing.UP, (net.minecraft.block.BlockSapling) net.minecraft.init.Blocks.SAPLING) && position.getY() < worldIn.getHeight() - i - 1) {
				this.setDirtAt(worldIn, position.down());

				//MAKE LEAVES
				final int[][] leafPos = new int[][] { { -1, 0, 1 }, { -1, 0, 0 }, { -1, 0, -1 }, { 0, 0, 1 }, { 0, 0, -1 }, { 1, 0, 1 }, { 1, 0, 0 }, { 1, 0, -1 }, { -1, 1, 1 }, { -1, 1, 0 }, { -1, 1, -1 }, { 0, 1, 1 }, { 0, 1, -1 }, { 0, 1, -2 }, { 1, 1, 1 }, { 1, 1, 0 }, { 1, 1, -1 }, { -1, 1, 0 }, { -1, 1, -1 }, { -2, 1, 1 }, { -2, 1, 0 }, { -2, 1, -1 }, { 2, 1, -1 }, { 2, 1, 0 }, { 2, 1, 1 }, { -1, 1, 2 }, { 0, 1, 2 }, { 1, 1, 2 }, { -1, 1, -2 }, { 1, 1, -2 }, { 1, 1, -2 }, { -1, 2, 1 }, { -1, 2, 0 }, { -1, 2, -1 }, { 0, 2, 1 }, { 0, 2, -1 }, { 1, 2, 1 }, { 1, 2, 0 }, { 1, 2, -1 }, { -2, 2, 0 }, { 2, 2, 0 }, { 0, 2, 2 }, { 0, 2, -2 }, { -1, 3, 1 }, { -1, 3, 0 }, { -1, 3, -1 }, { 0, 3, 1 }, { 0, 3, -1 }, { 1, 3, 1 }, { 1, 3, 0 }, { 1, 3, -1 }, { -1, 4, 0 }, { 0, 4, 1 },
					{ 0, 4, -1 }, { 1, 4, 0 }, { 0, 5, 0 } };

				for (int[] coord : leafPos) {
					BlockPos blockpos = position.add(coord[0], coord[1] + (i - 5), coord[2]);
					state = worldIn.getBlockState(blockpos);
					if (state.getBlock().isAir(state, worldIn, blockpos) || state.getBlock().isLeaves(state, worldIn, blockpos) || state.getMaterial() == Material.VINE) {
						this.setBlockAndNotifyAdequately(worldIn, blockpos, this.metaLeaves);
					}
				}
				//MAKE TRUNK
				for (int j3 = 0; j3 < i; ++j3) {
					BlockPos upN = position.up(j3);
					state = worldIn.getBlockState(upN);

					if (state.getBlock().isAir(state, worldIn, upN) || state.getBlock().isLeaves(state, worldIn, upN) || state.getMaterial() == Material.VINE) {
						this.setBlockAndNotifyAdequately(worldIn, position.up(j3), this.metaWood);
						if (j3 == i - 4) {

							this.setBlockAndNotifyAdequately(worldIn, position.up(j3).north(), this.metaWood.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.Z));
							this.setBlockAndNotifyAdequately(worldIn, position.up(j3).south(), this.metaWood.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.Z));
							if (rand.nextBoolean()) {
								this.setBlockAndNotifyAdequately(worldIn, position.up(j3).east(), this.metaWood.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.X));
								this.setBlockAndNotifyAdequately(worldIn, position.up(j3).west(), this.metaWood.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.X));
							}

						}
					}
				}

				return true;
			} else {
				return false;
			}
		}
	} else {
		return false;
	}
}
 
開發者ID:MinecraftModDevelopmentMods,項目名稱:Got-Wood,代碼行數:58,代碼來源:WorldGenMaple.java

示例11: generateNormal

private boolean generateNormal(World worldIn, Random rand, BlockPos position) {
	int i = rand.nextInt(3) + 5;
	boolean flag = true;

	if (position.getY() >= 1 && position.getY() + i + 1 <= worldIn.getHeight()) {
		
		flag = isAreaClear(worldIn, position, i);

		if (!flag) {
			return false;
		} else {
			
			IBlockState state = worldIn.getBlockState(position.down());

			if (state.getBlock().canSustainPlant(state, worldIn, position.down(), net.minecraft.util.EnumFacing.UP, net.minecraft.init.Blocks.DEADBUSH) && position.getY() < worldIn.getHeight() - i - 1) {
				System.out.println("doot ");
				this.setDirtAt(worldIn, position.down());

				for (int i3 = position.getY() - 3 + i; i3 <= position.getY() + i; ++i3) {
					int i4 = i3 - (position.getY() + i);
					int j1 = 1 - i4 / 2;

					for (int k1 = position.getX() - j1; k1 <= position.getX() + j1; ++k1) {
						int l1 = k1 - position.getX();

						for (int i2 = position.getZ() - j1; i2 <= position.getZ() + j1; ++i2) {
							int j2 = i2 - position.getZ();

							if (Math.abs(l1) != j1 || Math.abs(j2) != j1 || rand.nextInt(2) != 0 && i4 != 0) {
								BlockPos blockpos = new BlockPos(k1, i3, i2);
								state = worldIn.getBlockState(blockpos);

								if (state.getBlock().isAir(state, worldIn, blockpos) || state.getBlock().isLeaves(state, worldIn, blockpos) || state.getMaterial() == Material.VINE) {
									this.setBlockAndNotifyAdequately(worldIn, blockpos, this.metaLeaves);
								}
							}
						}
					}
				}

				for (int j3 = 0; j3 < i; ++j3) {
					BlockPos upN = position.up(j3);
					state = worldIn.getBlockState(upN);

					if (state.getBlock().isAir(state, worldIn, upN) || state.getBlock().isLeaves(state, worldIn, upN) || state.getMaterial() == Material.VINE) {
						this.setBlockAndNotifyAdequately(worldIn, position.up(j3), this.metaWood);
					}
				}

				return true;
			} else {
				return false;
			}
		}
	} else {
		return false;
	}
}
 
開發者ID:MinecraftModDevelopmentMods,項目名稱:Got-Wood,代碼行數:58,代碼來源:WorldGenPalm.java

示例12: BlockTallGrass

protected BlockTallGrass()
{
    super(Material.VINE);
    this.setDefaultState(this.blockState.getBaseState().withProperty(TYPE, BlockTallGrass.EnumType.DEAD_BUSH));
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:5,代碼來源:BlockTallGrass.java


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