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