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


Java Block.getLightLevel方法代码示例

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


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

示例1: CraftBlockState

import org.bukkit.block.Block; //导入方法依赖的package包/类
public CraftBlockState(final Block block) {
    this.world = (CraftWorld) block.getWorld();
    this.x = block.getX();
    this.y = block.getY();
    this.z = block.getZ();
    this.type = block.getTypeId();
    this.light = block.getLightLevel();
    this.chunk = (CraftChunk) block.getChunk();
    this.flag = 3;
    // Cauldron start - save TE data
    TileEntity te = world.getHandle().getTileEntity(x, y, z);
    if (te != null)
    {
        nbt = new NBTTagCompound();
        te.writeToNBT(nbt);
    }
    else nbt = null;
    // Cauldron end

    createData(block.getData());
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:22,代码来源:CraftBlockState.java

示例2: averageLightLevel

import org.bukkit.block.Block; //导入方法依赖的package包/类
/**
 * Get the average light level of all empty (air) blocks in the Cuboid.  Returns 0
 * if there are no empty blocks.
 *
 * @return	the average light level of this Cuboid
 */
public byte averageLightLevel() {
	long total = 0;
	int n = 0;
	for (Block b : this) {
		if (b.isEmpty()) {
			total += b.getLightLevel();
			++n;
		}
	}
	return n > 0 ? (byte) (total / n) : 0;
}
 
开发者ID:ArcadiaPlugins,项目名称:Arcadia-Spigot,代码行数:18,代码来源:Cuboid.java

示例3: getAverageLightLevel

import org.bukkit.block.Block; //导入方法依赖的package包/类
/**
 * Get the average light level of all empty (air) blocks in the Cuboid.
 * Returns 0 if there are no empty blocks.
 *
 * @return The average light level of this Cuboid
 */
public byte getAverageLightLevel() {
    long total = 0;
    int n = 0;
    for (Block b : this) {
        if (b.isEmpty()) {
            total += b.getLightLevel();
            ++n;
        }
    }
    return n > 0 ? (byte) (total / n) : 0;
}
 
开发者ID:AlphaHelixDev,项目名称:AlphaLibary,代码行数:18,代码来源:Cuboid.java

示例4: getAverageLightLevel

import org.bukkit.block.Block; //导入方法依赖的package包/类
/**
 * Get the average light level of all empty (air) blocks in the Cuboid.  Returns 0 if there are no empty blocks.
 *
 * @return The average light level of this Cuboid
 */
public byte getAverageLightLevel() {
    long total = 0;
    int n = 0;
    for (Block b : this) {
        if (b.isEmpty()) {
            total += b.getLightLevel();
            ++n;
        }
    }
    return n > 0 ? (byte) (total / n) : 0;
}
 
开发者ID:ijoeleoli,项目名称:ZorahPractice,代码行数:17,代码来源:Cuboid.java

示例5: setBed

import org.bukkit.block.Block; //导入方法依赖的package包/类
public void setBed(Block bed){
	light=bed.getLightLevel();
}
 
开发者ID:SchoolUniform,项目名称:RealSurvival,代码行数:4,代码来源:PlayerData.java


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