本文整理汇总了Java中org.bukkit.block.Block.setBiome方法的典型用法代码示例。如果您正苦于以下问题:Java Block.setBiome方法的具体用法?Java Block.setBiome怎么用?Java Block.setBiome使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.block.Block
的用法示例。
在下文中一共展示了Block.setBiome方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: paste
import org.bukkit.block.Block; //导入方法依赖的package包/类
/**
* Paste this block at blockLoc
* @param nms
* @param blockLoc
*/
//@SuppressWarnings("deprecation")
@SuppressWarnings("deprecation")
public void paste(NMSAbstraction nms, Location blockLoc, boolean usePhysics, Biome biome) {
// Only paste air if it is below the sea level and in the overworld
Block block = new Location(blockLoc.getWorld(), x, y, z).add(blockLoc).getBlock();
block.setBiome(biome);
block.getChunk().load();
nms.setBlockSuperFast(block, typeId, data, usePhysics);
if (signText != null) {
if (block.getTypeId() != typeId) {
block.setTypeId(typeId);
}
// Sign
Sign sign = (Sign) block.getState();
int index = 0;
for (String line : signText) {
sign.setLine(index++, line);
}
sign.update();
} else if (banner != null) {
banner.set(block);
} else if (spawnerBlockType != null) {
if (block.getTypeId() != typeId) {
block.setTypeId(typeId);
}
CreatureSpawner cs = (CreatureSpawner)block.getState();
cs.setSpawnedType(spawnerBlockType);
} else if (!chestContents.isEmpty()) {
if (block.getTypeId() != typeId) {
block.setTypeId(typeId);
}
// Check if this is a double chest
Chest chestBlock = (Chest) block.getState();
InventoryHolder iH = chestBlock.getInventory().getHolder();
if (iH instanceof DoubleChest) {
//Bukkit.getLogger().info("DEBUG: double chest");
DoubleChest doubleChest = (DoubleChest) iH;
for (ItemStack chestItem: chestContents.values()) {
doubleChest.getInventory().addItem(chestItem);
}
} else {
// Single chest
for (Entry<Byte, ItemStack> en : chestContents.entrySet()) {
chestBlock.getInventory().setItem(en.getKey(), en.getValue());
}
}
}
}