/**
* "simulate" a block place when you click on the side of a duct
*/
public static boolean placeBlock(Player p, Block b, Block placedAgainst, int id, byte data, EquipmentSlot es) {
if (!DuctUtils.canBuild(p, b, placedAgainst, es)) {
return false;
}
// check if there is already a duct at this position
Map<BlockLoc, Duct> ductMap = TransportPipes.instance.getDuctMap(b.getWorld());
if (ductMap != null) {
if (ductMap.containsKey(BlockLoc.convertBlockLoc(b.getLocation()))) {
return false;
}
}
if (!(b.getType() == Material.AIR || b.isLiquid())) {
return false;
}
b.setTypeIdAndData(id, data, true);
if (TransportPipes.instance.containerBlockUtils.isIdContainerBlock(id)) {
TransportPipes.instance.containerBlockUtils.updateDuctNeighborBlockSync(b, true);
}
return true;
}
HitboxUtils.java 文件源码
java
阅读 26
收藏 0
点赞 0
评论 0
项目:Transport-Pipes
作者:
评论列表
文章目录