本文整理汇总了Java中buildcraft.api.core.BuildCraftAPI类的典型用法代码示例。如果您正苦于以下问题:Java BuildCraftAPI类的具体用法?Java BuildCraftAPI怎么用?Java BuildCraftAPI使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BuildCraftAPI类属于buildcraft.api.core包,在下文中一共展示了BuildCraftAPI类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: writeToWorld
import buildcraft.api.core.BuildCraftAPI; //导入依赖的package包/类
@Override
public void writeToWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
if (isConcrete) {
if (stacks.size() == 0 || !BuildCraftAPI.isSoftBlock(context.world(), x, y, z)) {
return;
} else {
ItemStack stack = stacks.getFirst();
// force the block to be air block, in case it's just a soft
// block which replacement is not straightforward
context.world().setBlock(x, y, z, Blocks.air, 0, 3);
stack.tryPlaceItemIntoWorld(
BuildCraftAPI.proxy.getBuildCraftPlayer((WorldServer) context.world()).get(),
context.world(), x, y, z, 1, 0.0f, 0.0f, 0.0f);
}
} else {
context.world().setBlock(x, y, z, Blocks.air, 0, 3);
}
}
开发者ID:4Space,项目名称:4Space-5,代码行数:21,代码来源:SchematicMask.java
示例2: placeInWorld
import buildcraft.api.core.BuildCraftAPI; //导入依赖的package包/类
@Override
public void placeInWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) {
if (isConcrete) {
if (stacks.size() == 0 || !BuildCraftAPI.isSoftBlock(context.world(), x, y, z)) {
return;
} else {
ItemStack stack = stacks.getFirst();
// force the block to be air block, in case it's just a soft
// block which replacement is not straightforward
context.world().setBlock(x, y, z, Blocks.air, 0, 3);
stack.tryPlaceItemIntoWorld(
BuildCraftAPI.proxy.getBuildCraftPlayer((WorldServer) context.world()).get(),
context.world(), x, y, z, 1, 0.0f, 0.0f, 0.0f);
}
} else {
context.world().setBlock(x, y, z, Blocks.air, 0, 3);
}
}
开发者ID:amadornes,项目名称:Connected,代码行数:21,代码来源:SchematicMask.java
示例3: getSignature
import buildcraft.api.core.BuildCraftAPI; //导入依赖的package包/类
/**
* By default, block class name, block tile name and block name are used to define block signature. Overriding this subprogram may allow to replace some of
* these with stars, specify the mod that this block kind is coming from or add custom data to the signature.
*/
public BlockSignature getSignature(Block block) {
BlockSignature sig = new BlockSignature();
if (block.blockID > BuildCraftAPI.LAST_ORIGINAL_BLOCK) {
sig.blockClassName = block.getClass().getSimpleName();
if (block instanceof BlockContainer) {
// TODO: Try to see if we can get a world instance to call with instead of null
TileEntity tile = ((BlockContainer) block).createNewTileEntity(null);
if (tile != null) {
sig.tileClassName = tile.getClass().getSimpleName();
}
}
}
sig.blockName = block.getUnlocalizedName();
sig.replaceNullWithStar();
return sig;
}
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:26,代码来源:BptBlock.java
示例4: isAlreadyBuilt
import buildcraft.api.core.BuildCraftAPI; //导入依赖的package包/类
@Override
public boolean isAlreadyBuilt(IBuilderContext context, int x, int y, int z) {
if (isConcrete) {
return !BuildCraftAPI.isSoftBlock(context.world(), x, y, z);
} else {
return BuildCraftAPI.isSoftBlock(context.world(), x, y, z);
}
}
开发者ID:4Space,项目名称:4Space-5,代码行数:9,代码来源:SchematicMask.java
示例5: getItemSignature
import buildcraft.api.core.BuildCraftAPI; //导入依赖的package包/类
public static ItemSignature getItemSignature(Item item) {
ItemSignature sig = new ItemSignature();
if (item.itemID >= Block.blocksList.length + BuildCraftAPI.LAST_ORIGINAL_ITEM) {
sig.itemClassName = item.getClass().getSimpleName();
}
sig.itemName = item.getUnlocalizedName(new ItemStack(item));
return sig;
}
开发者ID:austinv11,项目名称:PeripheralsPlusPlus,代码行数:12,代码来源:BlueprintManager.java
注:本文中的buildcraft.api.core.BuildCraftAPI类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论