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


Java World.canSeeSky方法代码示例

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


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

示例1: gen

import net.minecraft.world.World; //导入方法依赖的package包/类
@Override
void gen(World world, int x, int z, IChunkGenerator generator, IChunkProvider provider) {
	random.setSeed(world.getSeed());
	long good = random.nextLong();
	long succ = random.nextLong();

	good *= x >> 1;
	succ *= z >> 1;
	random.setSeed(good ^ succ ^ world.getSeed());
	//Generate
	if(GEN_CONFIG.ASHEN_CUBE_STRUCTURE.rarity > 0D && GEN_CONFIG.ASHEN_CUBE_STRUCTURE.rarity / 100D > random.nextDouble()) {
		BlockPos center = new BlockPos(x, 15 + random.nextInt(25), z);
		if(!world.canSeeSky(center) || !GEN_CONFIG.ASHEN_CUBE_STRUCTURE.underground) {
			genCubes(world, center);
		}
	}
}
 
开发者ID:ArekkuusuJerii,项目名称:Solar,代码行数:18,代码来源:AshenCubeStructure.java

示例2: genCubes

import net.minecraft.world.World; //导入方法依赖的package包/类
private void genCubes(World world, BlockPos pos) {
	//Gen Cube
	BlockPos origin = pos.add(5, 0, 5);
	Template template = Structure.ASHEN_CUBE.load(world);
	boolean loot = GEN_CONFIG.ASHEN_CUBE_STRUCTURE.loot / 100D > random.nextDouble();
	PlacementSettings integrity = new PlacementSettings();
	integrity.setIntegrity(loot ? 1F : 0.35F + 0.45F * random.nextFloat());
	template.addBlocksToWorld(world, origin, integrity);
	integrity.setIntegrity(!loot && random.nextFloat() > 0.45F ? 1F : random.nextFloat());
	Structure.ASHEN_CUBE_.generate(world, origin, integrity);
	//Add loot
	for (int i = 0; i < 6 + random.nextInt(6); i++) {
		loot = GEN_CONFIG.MONOLITH_CONFIG.MONOLITH_STRUCTURE.loot / 100D > random.nextDouble();
		if (loot) {
			BlockPos inside = origin.add(1 + random.nextInt(4), 1, 1 + random.nextInt(4));
			IBlockState pot = ModBlocks.LARGE_POT.getDefaultState().withProperty(State.POT_VARIANT, random.nextInt(3));
			world.setBlockState(inside, pot);
		}
	}
	//Gen Cubes
	AxisAlignedBB cubeBB = new AxisAlignedBB(origin, origin.add(template.getSize()));
	for(int i = 0; i < GEN_CONFIG.ASHEN_CUBE_STRUCTURE.size; i++) {
		Template cube = nuggets.next().load(world);
		Rotation rotation = Rotation.values()[random.nextInt(4)];
		Vector3 vec = Vector3.create(cube.getSize()).rotate(rotation);
		BlockPos offset = randomVector().add(pos).toBlockPos();
		if(offset.getY() < 1  || (world.canSeeSky(offset) && GEN_CONFIG.ASHEN_CUBE_STRUCTURE.underground)) continue;
		AxisAlignedBB nuggetBB = new AxisAlignedBB(offset, vec.add(offset).toBlockPos());
		if(!nuggetBB.intersects(cubeBB)) {
			PlacementSettings settings = new PlacementSettings();
			settings.setIntegrity(random.nextFloat() > 0.85F ? 0.9F : 0.35F + 0.45F * random.nextFloat());
			settings.setRotation(rotation);
			settings.setRandom(random);
			cube.addBlocksToWorld(world, offset, settings);
		}
	}
}
 
开发者ID:ArekkuusuJerii,项目名称:Solar,代码行数:38,代码来源:AshenCubeStructure.java

示例3: canBlockStay

import net.minecraft.world.World; //导入方法依赖的package包/类
public boolean canBlockStay(World worldIn, BlockPos pos, IBlockState state)
{
    return (worldIn.getLight(pos) >= 8 || worldIn.canSeeSky(pos)) && this.canPlaceBlockOn(worldIn.getBlockState(pos.down()).getBlock());
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:5,代码来源:BlockCrops.java

示例4: canBlockStay

import net.minecraft.world.World; //导入方法依赖的package包/类
public boolean canBlockStay(World worldIn, BlockPos pos, IBlockState state)
{
    return (worldIn.getLight(pos) >= 8 || worldIn.canSeeSky(pos)) && this.canSustainBush(worldIn.getBlockState(pos.down()));
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:5,代码来源:BlockCrops.java

示例5: canBlockStay

import net.minecraft.world.World; //导入方法依赖的package包/类
public boolean canBlockStay(World worldIn, BlockPos pos, IBlockState state)
{
    IBlockState soil = worldIn.getBlockState(pos.down());
    return (worldIn.getLight(pos) >= 8 || worldIn.canSeeSky(pos)) && soil.getBlock().canSustainPlant(soil, worldIn, pos.down(), net.minecraft.util.EnumFacing.UP, this);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:6,代码来源:BlockCrops.java

示例6: matches

import net.minecraft.world.World; //导入方法依赖的package包/类
@Override
public boolean matches(World world, BlockPos pos) {
    return world.getLight(pos.up()) >= this.level || world.canSeeSky(pos.up());
}
 
开发者ID:LasmGratel,项目名称:FoodCraft-Reloaded,代码行数:5,代码来源:BlockQuery.java

示例7: canBlockStay

import net.minecraft.world.World; //导入方法依赖的package包/类
public boolean canBlockStay(World worldIn, BlockPos pos, IBlockState state) {

      IBlockState soil = worldIn.getBlockState(pos.down());
      return (worldIn.getLight(pos) >= 8 || worldIn.canSeeSky(pos)) && soil.getBlock().canSustainPlant(soil, worldIn, pos.down(), net.minecraft.util.EnumFacing.UP, this);
      
  }
 
开发者ID:Bedrockbreaker,项目名称:rtap,代码行数:7,代码来源:cropPeppers.java


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