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


Java Block.getChunk方法代码示例

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


在下文中一共展示了Block.getChunk方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: WaterFowLimitor

import org.bukkit.block.Block; //导入方法依赖的package包/类
@EventHandler
  public void WaterFowLimitor(BlockFromToEvent event) {
if(ConfigOptimize.WaterFlowLimitorenable == true){
	Block block = event.getBlock();
	Chunk chunk = block.getChunk();
       if (block.getType() == Material.STATIONARY_WATER || block.getType() == Material.STATIONARY_LAVA) {
           if(CheckFast(block.getChunk())){
           	if(CheckedTimes.get(chunk) == null){
       			CheckedTimes.put(chunk, 0);
       		}
       		CheckedTimes.put(chunk, CheckedTimes.get(chunk) + 1);
       		if(CheckedTimes.get(chunk) > ConfigOptimize.WaterFlowLimitorPerChunkTimes){
       			event.setCancelled(true);
       		}
           }else{
               ChunkLastTime.put(block.getChunk(), System.currentTimeMillis());
           }
       }
}
  }
 
开发者ID:GelandiAssociation,项目名称:EscapeLag,代码行数:21,代码来源:WaterFlowLimitor.java

示例3: placeSnow

import org.bukkit.block.Block; //导入方法依赖的package包/类
private void placeSnow(final Block block)
{
	final Location loc = block.getLocation();
	final Chunk chunk = block.getChunk();
	
	placeSnow(chunk, chunk.getChunkSnapshot(true, false, false), Math.abs((chunk.getX() * 16) - loc.getBlockX()), loc.getBlockY(), Math.abs((chunk.getZ() * 16) - loc.getBlockZ()));
}
 
开发者ID:FattyMieo,项目名称:SurvivalPlus,代码行数:8,代码来源:SnowGeneration.java

示例4: SimpleInventoryContainer

import org.bukkit.block.Block; //导入方法依赖的package包/类
public SimpleInventoryContainer(Block block) {
	super(block);
	this.cachedChunk = block.getChunk();
	this.cachedInvHolder = (InventoryHolder) block.getState();
	this.cachedInv = cachedInvHolder.getInventory();
	updateOtherDoubleChestBlocks();
}
 
开发者ID:RoboTricker,项目名称:Transport-Pipes,代码行数:8,代码来源:SimpleInventoryContainer.java

示例5: BrewingStandContainer

import org.bukkit.block.Block; //导入方法依赖的package包/类
public BrewingStandContainer(Block block) {
	super(block);
	this.cachedChunk = block.getChunk();
	this.cachedBrewingStand = (BrewingStand) block.getState();
	this.cachedInv = cachedBrewingStand.getInventory();
}
 
开发者ID:RoboTricker,项目名称:Transport-Pipes,代码行数:7,代码来源:BrewingStandContainer.java

示例6: FurnaceContainer

import org.bukkit.block.Block; //导入方法依赖的package包/类
public FurnaceContainer(Block block) {
	super(block);
	this.cachedChunk = block.getChunk();
	this.cachedFurnace = (Furnace) block.getState();
	this.cachedInv = cachedFurnace.getInventory();
}
 
开发者ID:RoboTricker,项目名称:Transport-Pipes,代码行数:7,代码来源:FurnaceContainer.java


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