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