本文整理汇总了Java中ethanjones.cubes.core.util.BlockFace.negZ方法的典型用法代码示例。如果您正苦于以下问题:Java BlockFace.negZ方法的具体用法?Java BlockFace.negZ怎么用?Java BlockFace.negZ使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ethanjones.cubes.core.util.BlockFace
的用法示例。
在下文中一共展示了BlockFace.negZ方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: placeMeta
import ethanjones.cubes.core.util.BlockFace; //导入方法依赖的package包/类
@EventHandler
public void placeMeta(PlayerPlaceBlockEvent event) {
if (event.getBlock() == Blocks.log) {
placeMetaSwitch(event);
} else if (event.getBlock() == Blocks.chest) {
Vector3 pos = event.getPlayer().position.cpy();
pos.sub(event.getBlockReference().asVector3());
pos.nor();
BlockFace blockFace = VectorUtil.directionXZ(pos);
if (blockFace == null || blockFace == BlockFace.posX) {
event.setMeta(0);
} else if (blockFace == BlockFace.negX) {
event.setMeta(1);
} else if (blockFace == BlockFace.posZ) {
event.setMeta(2);
} else if (blockFace == BlockFace.negZ) {
event.setMeta(3);
}
}
}
示例2: placeMeta
import ethanjones.cubes.core.util.BlockFace; //导入方法依赖的package包/类
@EventHandler
public void placeMeta(PlayerPlaceBlockEvent event) {
if (event.getBlock() == Blocks.log) {
switch (event.getBlockIntersection().getBlockFace()) {
case posY:
case negY:
event.setMeta(0);
break;
case posX:
case negX:
event.setMeta(1);
break;
case posZ:
case negZ:
event.setMeta(2);
break;
}
} else if (event.getBlock() == Blocks.chest) {
Vector3 pos = event.getPlayer().position.cpy();
pos.sub(event.getBlockReference().asVector3());
pos.nor();
BlockFace blockFace = VectorUtil.directionXZ(pos);
if (blockFace == null || blockFace == BlockFace.posX) {
event.setMeta(0);
} else if (blockFace == BlockFace.negX) {
event.setMeta(1);
} else if (blockFace == BlockFace.posZ) {
event.setMeta(2);
} else if (blockFace == BlockFace.negZ) {
event.setMeta(3);
}
}
}
示例3: interationIf4
import ethanjones.cubes.core.util.BlockFace; //导入方法依赖的package包/类
private void interationIf4(int stepZ,BlockFace blockFace){
if (stepZ > 0)
blockFace = BlockFace.negZ;
if (stepZ < 0)
blockFace = BlockFace.posZ;
}