本文整理汇总了Java中org.bukkit.material.Torch类的典型用法代码示例。如果您正苦于以下问题:Java Torch类的具体用法?Java Torch怎么用?Java Torch使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Torch类属于org.bukkit.material包,在下文中一共展示了Torch类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: placeBlock
import org.bukkit.material.Torch; //导入依赖的package包/类
private void placeBlock(Block worldBlock, BlockDef block)
{
if (block.face == null && block.metadata == 0)
{
worldBlock.setType(block.material);
}
else
{
//I would prefer to do this without depreciated method and the weird torch hack,
//but the bukkit/spigot API seems to be buggy. If I set the block type with setType and then
//set the direction, attachable blocks will for some reason pop off, even if I
//tell setType to disable physics updates.
if (block.face != null)
{
Torch torch = new Torch();
torch.setFacingDirection(block.face);
worldBlock.setTypeIdAndData(block.material.getId(), torch.getData(), true);
}
else
{
worldBlock.setTypeIdAndData(block.material.getId(), block.metadata, true);
}
}
}
开发者ID:OpenRedstoneEngineers,项目名称:autoprogram-plugin,代码行数:25,代码来源:ProgParser.java
示例2: addLightToWall
import org.bukkit.material.Torch; //导入依赖的package包/类
public void addLightToWall(int x, int y, int z,BlockFace dir) {
World w = Castle.getInstance().getWorld();
Block b = w.getBlockAt(x, y, z);
// a hack. Creating a torch will cause it
// to drop, unless there's something under it.
// Even when it's attached to a wall.
// Madness.
Block bunder = w.getBlockAt(x, y-1, z);
if(canOverwrite(bunder) && canOverwrite(b)){
bunder.setType(Material.DIRT);
Torch t = new Torch(Material.TORCH);
t.setFacingDirection(dir);
b.setType(Material.TORCH);
b.setData(t.getData());
bunder.setType(Material.AIR);
}
}
开发者ID:jimfinnis,项目名称:Gorm,代码行数:22,代码来源:Castle.java
示例3: Torch
import org.bukkit.material.Torch; //导入依赖的package包/类
public Torch() {
}
开发者ID:deathcap,项目名称:BedrockAPI,代码行数:3,代码来源:Torch.java
示例4: clone
import org.bukkit.material.Torch; //导入依赖的package包/类
public Torch clone() {
return null;
}
开发者ID:deathcap,项目名称:BedrockAPI,代码行数:4,代码来源:Torch.java
注:本文中的org.bukkit.material.Torch类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论