本文整理汇总了Java中buildcraft.api.core.BuildCraftAPI.isSoftBlock方法的典型用法代码示例。如果您正苦于以下问题:Java BuildCraftAPI.isSoftBlock方法的具体用法?Java BuildCraftAPI.isSoftBlock怎么用?Java BuildCraftAPI.isSoftBlock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类buildcraft.api.core.BuildCraftAPI
的用法示例。
在下文中一共展示了BuildCraftAPI.isSoftBlock方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例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);
}
}
示例3: 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);
}
}